# # canola - canon canola 1614p emulator # Copyright (C) 2011 Peter Miller # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 3, as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # ; ---------- Card-Pocket-Begin ------------------------------------------- ; Title: MS-16: asinh(x) ; Color: green ; Style: blank ; ---------- Card-Pocket-End --------------------------------------------- ; ; http://en.wikipedia.org/wiki/Hyperbolic_function ; ; Evaluated using the formula ; ; asinh(x) = ln(x + sqrt(x**2 + 1)) ; ; M14 => sign of result ; M13 => x ; M12 => ; SFJ $302 SM13 MJ $402 1 SM14 RV UJ $403 FJ $402 1 CS SM14 RV CS FJ $403 SM13 ; x * += 1 += SQRT RM13 += ; x + sqrt(x**2 + 1) SQRT ; this next is similar to the MS-12 ln(x) code SQRT SQRT SQRT 1 ; 1 - 2 / (x + 1) += ; is the same as / ; (x - 1) / (x + 1) 2 RV -= 1 SM10 ; odd denominator += ; "y" = (x - 1) / (x + 1) SM13 ; numerator SM11 ; series sum * += SM12 ; y**2 FJ $404 2 M10 ; bump denominator RM13 ; previous numerator * RM12 ; y**2 / SM13 ; save numerator RM10 ; odd denominatpr += M11 ; add to series sum CS MJ $404 RM11 ; series sum * 32 ; account for missing 2, and the 4 sqrt above * RM14 ; sign of result += SRJ