
(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, l, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, l, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* -1.0 (pow l 2.0)))
(t_2 (* (sqrt 2.0) (fabs t)))
(t_3 (pow (fabs t) 2.0))
(t_4 (fma 2.0 t_3 (pow l 2.0)))
(t_5 (* -1.0 t_3))
(t_6 (* 2.0 t_3))
(t_7 (* -1.0 t_4)))
(*
(copysign 1.0 t)
(if (<= (fabs t) 1.25e-285)
(/
t_2
(sqrt
(fma
-1.0
(/
(fma
-1.0
(- (pow l 2.0) t_1)
(fma
-1.0
(/ (fma -1.0 (- t_1 (pow l 2.0)) (* 2.0 (- t_3 t_5))) x)
(* 2.0 (- t_5 t_3))))
x)
t_6)))
(if (<= (fabs t) 3.25e-224)
(- 1.0 (/ 1.0 x))
(if (<= (fabs t) 1.4e+29)
(/
t_2
(sqrt
(fma
-1.0
(/
(fma
-1.0
(- t_4 t_7)
(*
-1.0
(/
(-
(fma -1.0 (- t_7 t_4) (fma 2.0 (/ t_3 x) (/ (pow l 2.0) x)))
(* -1.0 (/ t_4 x)))
x)))
x)
t_6)))
(sqrt (/ -1.0 (/ (- -1.0 x) (- x 1.0))))))))))double code(double x, double l, double t) {
double t_1 = -1.0 * pow(l, 2.0);
double t_2 = sqrt(2.0) * fabs(t);
double t_3 = pow(fabs(t), 2.0);
double t_4 = fma(2.0, t_3, pow(l, 2.0));
double t_5 = -1.0 * t_3;
double t_6 = 2.0 * t_3;
double t_7 = -1.0 * t_4;
double tmp;
if (fabs(t) <= 1.25e-285) {
tmp = t_2 / sqrt(fma(-1.0, (fma(-1.0, (pow(l, 2.0) - t_1), fma(-1.0, (fma(-1.0, (t_1 - pow(l, 2.0)), (2.0 * (t_3 - t_5))) / x), (2.0 * (t_5 - t_3)))) / x), t_6));
} else if (fabs(t) <= 3.25e-224) {
tmp = 1.0 - (1.0 / x);
} else if (fabs(t) <= 1.4e+29) {
tmp = t_2 / sqrt(fma(-1.0, (fma(-1.0, (t_4 - t_7), (-1.0 * ((fma(-1.0, (t_7 - t_4), fma(2.0, (t_3 / x), (pow(l, 2.0) / x))) - (-1.0 * (t_4 / x))) / x))) / x), t_6));
} else {
tmp = sqrt((-1.0 / ((-1.0 - x) / (x - 1.0))));
}
return copysign(1.0, t) * tmp;
}
function code(x, l, t) t_1 = Float64(-1.0 * (l ^ 2.0)) t_2 = Float64(sqrt(2.0) * abs(t)) t_3 = abs(t) ^ 2.0 t_4 = fma(2.0, t_3, (l ^ 2.0)) t_5 = Float64(-1.0 * t_3) t_6 = Float64(2.0 * t_3) t_7 = Float64(-1.0 * t_4) tmp = 0.0 if (abs(t) <= 1.25e-285) tmp = Float64(t_2 / sqrt(fma(-1.0, Float64(fma(-1.0, Float64((l ^ 2.0) - t_1), fma(-1.0, Float64(fma(-1.0, Float64(t_1 - (l ^ 2.0)), Float64(2.0 * Float64(t_3 - t_5))) / x), Float64(2.0 * Float64(t_5 - t_3)))) / x), t_6))); elseif (abs(t) <= 3.25e-224) tmp = Float64(1.0 - Float64(1.0 / x)); elseif (abs(t) <= 1.4e+29) tmp = Float64(t_2 / sqrt(fma(-1.0, Float64(fma(-1.0, Float64(t_4 - t_7), Float64(-1.0 * Float64(Float64(fma(-1.0, Float64(t_7 - t_4), fma(2.0, Float64(t_3 / x), Float64((l ^ 2.0) / x))) - Float64(-1.0 * Float64(t_4 / x))) / x))) / x), t_6))); else tmp = sqrt(Float64(-1.0 / Float64(Float64(-1.0 - x) / Float64(x - 1.0)))); end return Float64(copysign(1.0, t) * tmp) end
code[x_, l_, t_] := Block[{t$95$1 = N[(-1.0 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] * N[Abs[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[Abs[t], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$4 = N[(2.0 * t$95$3 + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(-1.0 * t$95$3), $MachinePrecision]}, Block[{t$95$6 = N[(2.0 * t$95$3), $MachinePrecision]}, Block[{t$95$7 = N[(-1.0 * t$95$4), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[t], $MachinePrecision], 1.25e-285], N[(t$95$2 / N[Sqrt[N[(-1.0 * N[(N[(-1.0 * N[(N[Power[l, 2.0], $MachinePrecision] - t$95$1), $MachinePrecision] + N[(-1.0 * N[(N[(-1.0 * N[(t$95$1 - N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(t$95$3 - t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(2.0 * N[(t$95$5 - t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + t$95$6), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[t], $MachinePrecision], 3.25e-224], N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[t], $MachinePrecision], 1.4e+29], N[(t$95$2 / N[Sqrt[N[(-1.0 * N[(N[(-1.0 * N[(t$95$4 - t$95$7), $MachinePrecision] + N[(-1.0 * N[(N[(N[(-1.0 * N[(t$95$7 - t$95$4), $MachinePrecision] + N[(2.0 * N[(t$95$3 / x), $MachinePrecision] + N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(-1.0 * N[(t$95$4 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + t$95$6), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(-1.0 / N[(N[(-1.0 - x), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_1 := -1 \cdot {\ell}^{2}\\
t_2 := \sqrt{2} \cdot \left|t\right|\\
t_3 := {\left(\left|t\right|\right)}^{2}\\
t_4 := \mathsf{fma}\left(2, t\_3, {\ell}^{2}\right)\\
t_5 := -1 \cdot t\_3\\
t_6 := 2 \cdot t\_3\\
t_7 := -1 \cdot t\_4\\
\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|t\right| \leq 1.25 \cdot 10^{-285}:\\
\;\;\;\;\frac{t\_2}{\sqrt{\mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(-1, {\ell}^{2} - t\_1, \mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(-1, t\_1 - {\ell}^{2}, 2 \cdot \left(t\_3 - t\_5\right)\right)}{x}, 2 \cdot \left(t\_5 - t\_3\right)\right)\right)}{x}, t\_6\right)}}\\
\mathbf{elif}\;\left|t\right| \leq 3.25 \cdot 10^{-224}:\\
\;\;\;\;1 - \frac{1}{x}\\
\mathbf{elif}\;\left|t\right| \leq 1.4 \cdot 10^{+29}:\\
\;\;\;\;\frac{t\_2}{\sqrt{\mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(-1, t\_4 - t\_7, -1 \cdot \frac{\mathsf{fma}\left(-1, t\_7 - t\_4, \mathsf{fma}\left(2, \frac{t\_3}{x}, \frac{{\ell}^{2}}{x}\right)\right) - -1 \cdot \frac{t\_4}{x}}{x}\right)}{x}, t\_6\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{-1}{\frac{-1 - x}{x - 1}}}\\
\end{array}
\end{array}
if t < 1.25000000000000005e-285Initial program 34.1%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
lift-+.f64N/A
distribute-lft-inN/A
associate-+l+N/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*l*N/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
Applied rewrites33.2%
Taylor expanded in x around -inf
lower-fma.f64N/A
Applied rewrites53.1%
if 1.25000000000000005e-285 < t < 3.25e-224Initial program 34.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower--.f6438.8
Applied rewrites38.8%
lift-/.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-undivN/A
lower-sqrt.f64N/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/r*N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
Applied rewrites38.8%
Taylor expanded in x around inf
lower--.f64N/A
lower-/.f6438.5
Applied rewrites38.5%
if 3.25e-224 < t < 1.4e29Initial program 34.1%
Taylor expanded in x around -inf
lower-fma.f64N/A
Applied rewrites53.2%
if 1.4e29 < t Initial program 34.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower--.f6438.8
Applied rewrites38.8%
lift-/.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-undivN/A
lower-sqrt.f64N/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/r*N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
Applied rewrites38.8%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* -1.0 (pow l 2.0)))
(t_2 (pow (fabs t) 2.0))
(t_3 (* 2.0 t_2))
(t_4 (fma 2.0 t_2 (pow l 2.0)))
(t_5 (* -1.0 t_2)))
(*
(copysign 1.0 t)
(if (<= (fabs t) 1.25e-285)
(/
(* (sqrt 2.0) (fabs t))
(sqrt
(fma
-1.0
(/
(fma
-1.0
(- (pow l 2.0) t_1)
(fma
-1.0
(/ (fma -1.0 (- t_1 (pow l 2.0)) (* 2.0 (- t_2 t_5))) x)
(* 2.0 (- t_5 t_2))))
x)
t_3)))
(if (<= (fabs t) 3.25e-224)
(- 1.0 (/ 1.0 x))
(if (<= (fabs t) 1.4e+29)
(/
(* 1.4142135623730951 (fabs t))
(sqrt
(fma
-1.0
(/
(-
(fma -1.0 (- t_4 (* -1.0 t_4)) (* -1.0 (/ t_4 x)))
(fma 2.0 (/ t_2 x) (/ (pow l 2.0) x)))
x)
t_3)))
(sqrt (/ -1.0 (/ (- -1.0 x) (- x 1.0))))))))))double code(double x, double l, double t) {
double t_1 = -1.0 * pow(l, 2.0);
double t_2 = pow(fabs(t), 2.0);
double t_3 = 2.0 * t_2;
double t_4 = fma(2.0, t_2, pow(l, 2.0));
double t_5 = -1.0 * t_2;
double tmp;
if (fabs(t) <= 1.25e-285) {
tmp = (sqrt(2.0) * fabs(t)) / sqrt(fma(-1.0, (fma(-1.0, (pow(l, 2.0) - t_1), fma(-1.0, (fma(-1.0, (t_1 - pow(l, 2.0)), (2.0 * (t_2 - t_5))) / x), (2.0 * (t_5 - t_2)))) / x), t_3));
} else if (fabs(t) <= 3.25e-224) {
tmp = 1.0 - (1.0 / x);
} else if (fabs(t) <= 1.4e+29) {
tmp = (1.4142135623730951 * fabs(t)) / sqrt(fma(-1.0, ((fma(-1.0, (t_4 - (-1.0 * t_4)), (-1.0 * (t_4 / x))) - fma(2.0, (t_2 / x), (pow(l, 2.0) / x))) / x), t_3));
} else {
tmp = sqrt((-1.0 / ((-1.0 - x) / (x - 1.0))));
}
return copysign(1.0, t) * tmp;
}
function code(x, l, t) t_1 = Float64(-1.0 * (l ^ 2.0)) t_2 = abs(t) ^ 2.0 t_3 = Float64(2.0 * t_2) t_4 = fma(2.0, t_2, (l ^ 2.0)) t_5 = Float64(-1.0 * t_2) tmp = 0.0 if (abs(t) <= 1.25e-285) tmp = Float64(Float64(sqrt(2.0) * abs(t)) / sqrt(fma(-1.0, Float64(fma(-1.0, Float64((l ^ 2.0) - t_1), fma(-1.0, Float64(fma(-1.0, Float64(t_1 - (l ^ 2.0)), Float64(2.0 * Float64(t_2 - t_5))) / x), Float64(2.0 * Float64(t_5 - t_2)))) / x), t_3))); elseif (abs(t) <= 3.25e-224) tmp = Float64(1.0 - Float64(1.0 / x)); elseif (abs(t) <= 1.4e+29) tmp = Float64(Float64(1.4142135623730951 * abs(t)) / sqrt(fma(-1.0, Float64(Float64(fma(-1.0, Float64(t_4 - Float64(-1.0 * t_4)), Float64(-1.0 * Float64(t_4 / x))) - fma(2.0, Float64(t_2 / x), Float64((l ^ 2.0) / x))) / x), t_3))); else tmp = sqrt(Float64(-1.0 / Float64(Float64(-1.0 - x) / Float64(x - 1.0)))); end return Float64(copysign(1.0, t) * tmp) end
code[x_, l_, t_] := Block[{t$95$1 = N[(-1.0 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Abs[t], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(2.0 * t$95$2 + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(-1.0 * t$95$2), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[t], $MachinePrecision], 1.25e-285], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[Abs[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(-1.0 * N[(N[(-1.0 * N[(N[Power[l, 2.0], $MachinePrecision] - t$95$1), $MachinePrecision] + N[(-1.0 * N[(N[(-1.0 * N[(t$95$1 - N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(t$95$2 - t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(2.0 * N[(t$95$5 - t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[t], $MachinePrecision], 3.25e-224], N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[t], $MachinePrecision], 1.4e+29], N[(N[(1.4142135623730951 * N[Abs[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(-1.0 * N[(N[(N[(-1.0 * N[(t$95$4 - N[(-1.0 * t$95$4), $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[(t$95$4 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(2.0 * N[(t$95$2 / x), $MachinePrecision] + N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(-1.0 / N[(N[(-1.0 - x), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := -1 \cdot {\ell}^{2}\\
t_2 := {\left(\left|t\right|\right)}^{2}\\
t_3 := 2 \cdot t\_2\\
t_4 := \mathsf{fma}\left(2, t\_2, {\ell}^{2}\right)\\
t_5 := -1 \cdot t\_2\\
\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|t\right| \leq 1.25 \cdot 10^{-285}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left|t\right|}{\sqrt{\mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(-1, {\ell}^{2} - t\_1, \mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(-1, t\_1 - {\ell}^{2}, 2 \cdot \left(t\_2 - t\_5\right)\right)}{x}, 2 \cdot \left(t\_5 - t\_2\right)\right)\right)}{x}, t\_3\right)}}\\
\mathbf{elif}\;\left|t\right| \leq 3.25 \cdot 10^{-224}:\\
\;\;\;\;1 - \frac{1}{x}\\
\mathbf{elif}\;\left|t\right| \leq 1.4 \cdot 10^{+29}:\\
\;\;\;\;\frac{1.4142135623730951 \cdot \left|t\right|}{\sqrt{\mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(-1, t\_4 - -1 \cdot t\_4, -1 \cdot \frac{t\_4}{x}\right) - \mathsf{fma}\left(2, \frac{t\_2}{x}, \frac{{\ell}^{2}}{x}\right)}{x}, t\_3\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{-1}{\frac{-1 - x}{x - 1}}}\\
\end{array}
\end{array}
if t < 1.25000000000000005e-285Initial program 34.1%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
lift-+.f64N/A
distribute-lft-inN/A
associate-+l+N/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*l*N/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
Applied rewrites33.2%
Taylor expanded in x around -inf
lower-fma.f64N/A
Applied rewrites53.1%
if 1.25000000000000005e-285 < t < 3.25e-224Initial program 34.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower--.f6438.8
Applied rewrites38.8%
lift-/.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-undivN/A
lower-sqrt.f64N/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/r*N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
Applied rewrites38.8%
Taylor expanded in x around inf
lower--.f64N/A
lower-/.f6438.5
Applied rewrites38.5%
if 3.25e-224 < t < 1.4e29Initial program 34.1%
Evaluated real constant34.1%
Taylor expanded in x around -inf
lower-fma.f64N/A
Applied rewrites53.1%
if 1.4e29 < t Initial program 34.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower--.f6438.8
Applied rewrites38.8%
lift-/.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-undivN/A
lower-sqrt.f64N/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/r*N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
Applied rewrites38.8%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (pow (fabs t) 2.0))
(t_2 (fma 2.0 t_1 (pow l 2.0)))
(t_3
(/
(* 1.4142135623730951 (fabs t))
(sqrt
(fma
-1.0
(/
(-
(fma -1.0 (- t_2 (* -1.0 t_2)) (* -1.0 (/ t_2 x)))
(fma 2.0 (/ t_1 x) (/ (pow l 2.0) x)))
x)
(* 2.0 t_1))))))
(*
(copysign 1.0 t)
(if (<= (fabs t) 1.25e-285)
t_3
(if (<= (fabs t) 3.25e-224)
(- 1.0 (/ 1.0 x))
(if (<= (fabs t) 1.4e+29)
t_3
(sqrt (/ -1.0 (/ (- -1.0 x) (- x 1.0))))))))))double code(double x, double l, double t) {
double t_1 = pow(fabs(t), 2.0);
double t_2 = fma(2.0, t_1, pow(l, 2.0));
double t_3 = (1.4142135623730951 * fabs(t)) / sqrt(fma(-1.0, ((fma(-1.0, (t_2 - (-1.0 * t_2)), (-1.0 * (t_2 / x))) - fma(2.0, (t_1 / x), (pow(l, 2.0) / x))) / x), (2.0 * t_1)));
double tmp;
if (fabs(t) <= 1.25e-285) {
tmp = t_3;
} else if (fabs(t) <= 3.25e-224) {
tmp = 1.0 - (1.0 / x);
} else if (fabs(t) <= 1.4e+29) {
tmp = t_3;
} else {
tmp = sqrt((-1.0 / ((-1.0 - x) / (x - 1.0))));
}
return copysign(1.0, t) * tmp;
}
function code(x, l, t) t_1 = abs(t) ^ 2.0 t_2 = fma(2.0, t_1, (l ^ 2.0)) t_3 = Float64(Float64(1.4142135623730951 * abs(t)) / sqrt(fma(-1.0, Float64(Float64(fma(-1.0, Float64(t_2 - Float64(-1.0 * t_2)), Float64(-1.0 * Float64(t_2 / x))) - fma(2.0, Float64(t_1 / x), Float64((l ^ 2.0) / x))) / x), Float64(2.0 * t_1)))) tmp = 0.0 if (abs(t) <= 1.25e-285) tmp = t_3; elseif (abs(t) <= 3.25e-224) tmp = Float64(1.0 - Float64(1.0 / x)); elseif (abs(t) <= 1.4e+29) tmp = t_3; else tmp = sqrt(Float64(-1.0 / Float64(Float64(-1.0 - x) / Float64(x - 1.0)))); end return Float64(copysign(1.0, t) * tmp) end
code[x_, l_, t_] := Block[{t$95$1 = N[Power[N[Abs[t], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * t$95$1 + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(1.4142135623730951 * N[Abs[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(-1.0 * N[(N[(N[(-1.0 * N[(t$95$2 - N[(-1.0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[(t$95$2 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(2.0 * N[(t$95$1 / x), $MachinePrecision] + N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[t], $MachinePrecision], 1.25e-285], t$95$3, If[LessEqual[N[Abs[t], $MachinePrecision], 3.25e-224], N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[t], $MachinePrecision], 1.4e+29], t$95$3, N[Sqrt[N[(-1.0 / N[(N[(-1.0 - x), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := {\left(\left|t\right|\right)}^{2}\\
t_2 := \mathsf{fma}\left(2, t\_1, {\ell}^{2}\right)\\
t_3 := \frac{1.4142135623730951 \cdot \left|t\right|}{\sqrt{\mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(-1, t\_2 - -1 \cdot t\_2, -1 \cdot \frac{t\_2}{x}\right) - \mathsf{fma}\left(2, \frac{t\_1}{x}, \frac{{\ell}^{2}}{x}\right)}{x}, 2 \cdot t\_1\right)}}\\
\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|t\right| \leq 1.25 \cdot 10^{-285}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;\left|t\right| \leq 3.25 \cdot 10^{-224}:\\
\;\;\;\;1 - \frac{1}{x}\\
\mathbf{elif}\;\left|t\right| \leq 1.4 \cdot 10^{+29}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{-1}{\frac{-1 - x}{x - 1}}}\\
\end{array}
\end{array}
if t < 1.25000000000000005e-285 or 3.25e-224 < t < 1.4e29Initial program 34.1%
Evaluated real constant34.1%
Taylor expanded in x around -inf
lower-fma.f64N/A
Applied rewrites53.1%
if 1.25000000000000005e-285 < t < 3.25e-224Initial program 34.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower--.f6438.8
Applied rewrites38.8%
lift-/.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-undivN/A
lower-sqrt.f64N/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/r*N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
Applied rewrites38.8%
Taylor expanded in x around inf
lower--.f64N/A
lower-/.f6438.5
Applied rewrites38.5%
if 1.4e29 < t Initial program 34.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower--.f6438.8
Applied rewrites38.8%
lift-/.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-undivN/A
lower-sqrt.f64N/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/r*N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
Applied rewrites38.8%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (pow (fabs t) 2.0)))
(*
(copysign 1.0 t)
(if (<= (fabs t) 1.25e-285)
(/
(* 1.4142135623730951 (fabs t))
(sqrt
(-
(fma 2.0 (/ t_1 x) (fma 2.0 t_1 (/ (pow l 2.0) x)))
(* -1.0 (/ (fma 2.0 t_1 (pow l 2.0)) x)))))
(if (<= (fabs t) 3.25e-224)
(- 1.0 (/ 1.0 x))
(if (<= (fabs t) 2.6e-43)
(/
(* (sqrt 2.0) (fabs t))
(sqrt
(fma
-1.0
(/
(fma
-1.0
(- (pow l 2.0) (* -1.0 (pow l 2.0)))
(* 2.0 (- (* -1.0 t_1) t_1)))
x)
(* 2.0 t_1))))
(sqrt (/ -1.0 (/ (- -1.0 x) (- x 1.0))))))))))double code(double x, double l, double t) {
double t_1 = pow(fabs(t), 2.0);
double tmp;
if (fabs(t) <= 1.25e-285) {
tmp = (1.4142135623730951 * fabs(t)) / sqrt((fma(2.0, (t_1 / x), fma(2.0, t_1, (pow(l, 2.0) / x))) - (-1.0 * (fma(2.0, t_1, pow(l, 2.0)) / x))));
} else if (fabs(t) <= 3.25e-224) {
tmp = 1.0 - (1.0 / x);
} else if (fabs(t) <= 2.6e-43) {
tmp = (sqrt(2.0) * fabs(t)) / sqrt(fma(-1.0, (fma(-1.0, (pow(l, 2.0) - (-1.0 * pow(l, 2.0))), (2.0 * ((-1.0 * t_1) - t_1))) / x), (2.0 * t_1)));
} else {
tmp = sqrt((-1.0 / ((-1.0 - x) / (x - 1.0))));
}
return copysign(1.0, t) * tmp;
}
function code(x, l, t) t_1 = abs(t) ^ 2.0 tmp = 0.0 if (abs(t) <= 1.25e-285) tmp = Float64(Float64(1.4142135623730951 * abs(t)) / sqrt(Float64(fma(2.0, Float64(t_1 / x), fma(2.0, t_1, Float64((l ^ 2.0) / x))) - Float64(-1.0 * Float64(fma(2.0, t_1, (l ^ 2.0)) / x))))); elseif (abs(t) <= 3.25e-224) tmp = Float64(1.0 - Float64(1.0 / x)); elseif (abs(t) <= 2.6e-43) tmp = Float64(Float64(sqrt(2.0) * abs(t)) / sqrt(fma(-1.0, Float64(fma(-1.0, Float64((l ^ 2.0) - Float64(-1.0 * (l ^ 2.0))), Float64(2.0 * Float64(Float64(-1.0 * t_1) - t_1))) / x), Float64(2.0 * t_1)))); else tmp = sqrt(Float64(-1.0 / Float64(Float64(-1.0 - x) / Float64(x - 1.0)))); end return Float64(copysign(1.0, t) * tmp) end
code[x_, l_, t_] := Block[{t$95$1 = N[Power[N[Abs[t], $MachinePrecision], 2.0], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[t], $MachinePrecision], 1.25e-285], N[(N[(1.4142135623730951 * N[Abs[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[(2.0 * N[(t$95$1 / x), $MachinePrecision] + N[(2.0 * t$95$1 + N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(-1.0 * N[(N[(2.0 * t$95$1 + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[t], $MachinePrecision], 3.25e-224], N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[t], $MachinePrecision], 2.6e-43], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[Abs[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(-1.0 * N[(N[(-1.0 * N[(N[Power[l, 2.0], $MachinePrecision] - N[(-1.0 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[(-1.0 * t$95$1), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(-1.0 / N[(N[(-1.0 - x), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
t_1 := {\left(\left|t\right|\right)}^{2}\\
\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|t\right| \leq 1.25 \cdot 10^{-285}:\\
\;\;\;\;\frac{1.4142135623730951 \cdot \left|t\right|}{\sqrt{\mathsf{fma}\left(2, \frac{t\_1}{x}, \mathsf{fma}\left(2, t\_1, \frac{{\ell}^{2}}{x}\right)\right) - -1 \cdot \frac{\mathsf{fma}\left(2, t\_1, {\ell}^{2}\right)}{x}}}\\
\mathbf{elif}\;\left|t\right| \leq 3.25 \cdot 10^{-224}:\\
\;\;\;\;1 - \frac{1}{x}\\
\mathbf{elif}\;\left|t\right| \leq 2.6 \cdot 10^{-43}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left|t\right|}{\sqrt{\mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(-1, {\ell}^{2} - -1 \cdot {\ell}^{2}, 2 \cdot \left(-1 \cdot t\_1 - t\_1\right)\right)}{x}, 2 \cdot t\_1\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{-1}{\frac{-1 - x}{x - 1}}}\\
\end{array}
\end{array}
if t < 1.25000000000000005e-285Initial program 34.1%
Evaluated real constant34.1%
Taylor expanded in x around inf
lower--.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-fma.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-fma.f64N/A
lower-pow.f64N/A
lower-pow.f6452.9
Applied rewrites52.9%
if 1.25000000000000005e-285 < t < 3.25e-224Initial program 34.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower--.f6438.8
Applied rewrites38.8%
lift-/.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-undivN/A
lower-sqrt.f64N/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/r*N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
Applied rewrites38.8%
Taylor expanded in x around inf
lower--.f64N/A
lower-/.f6438.5
Applied rewrites38.5%
if 3.25e-224 < t < 2.6e-43Initial program 34.1%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
lift-+.f64N/A
distribute-lft-inN/A
associate-+l+N/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*l*N/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
Applied rewrites33.2%
Taylor expanded in x around -inf
lower-fma.f64N/A
Applied rewrites52.9%
if 2.6e-43 < t Initial program 34.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower--.f6438.8
Applied rewrites38.8%
lift-/.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-undivN/A
lower-sqrt.f64N/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/r*N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
Applied rewrites38.8%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (pow (fabs t) 2.0))
(t_2
(/
(* 1.4142135623730951 (fabs t))
(sqrt
(-
(fma 2.0 (/ t_1 x) (fma 2.0 t_1 (/ (pow l 2.0) x)))
(* -1.0 (/ (fma 2.0 t_1 (pow l 2.0)) x)))))))
(*
(copysign 1.0 t)
(if (<= (fabs t) 1.25e-285)
t_2
(if (<= (fabs t) 3.25e-224)
(- 1.0 (/ 1.0 x))
(if (<= (fabs t) 2.6e-43)
t_2
(sqrt (/ -1.0 (/ (- -1.0 x) (- x 1.0))))))))))double code(double x, double l, double t) {
double t_1 = pow(fabs(t), 2.0);
double t_2 = (1.4142135623730951 * fabs(t)) / sqrt((fma(2.0, (t_1 / x), fma(2.0, t_1, (pow(l, 2.0) / x))) - (-1.0 * (fma(2.0, t_1, pow(l, 2.0)) / x))));
double tmp;
if (fabs(t) <= 1.25e-285) {
tmp = t_2;
} else if (fabs(t) <= 3.25e-224) {
tmp = 1.0 - (1.0 / x);
} else if (fabs(t) <= 2.6e-43) {
tmp = t_2;
} else {
tmp = sqrt((-1.0 / ((-1.0 - x) / (x - 1.0))));
}
return copysign(1.0, t) * tmp;
}
function code(x, l, t) t_1 = abs(t) ^ 2.0 t_2 = Float64(Float64(1.4142135623730951 * abs(t)) / sqrt(Float64(fma(2.0, Float64(t_1 / x), fma(2.0, t_1, Float64((l ^ 2.0) / x))) - Float64(-1.0 * Float64(fma(2.0, t_1, (l ^ 2.0)) / x))))) tmp = 0.0 if (abs(t) <= 1.25e-285) tmp = t_2; elseif (abs(t) <= 3.25e-224) tmp = Float64(1.0 - Float64(1.0 / x)); elseif (abs(t) <= 2.6e-43) tmp = t_2; else tmp = sqrt(Float64(-1.0 / Float64(Float64(-1.0 - x) / Float64(x - 1.0)))); end return Float64(copysign(1.0, t) * tmp) end
code[x_, l_, t_] := Block[{t$95$1 = N[Power[N[Abs[t], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.4142135623730951 * N[Abs[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[(2.0 * N[(t$95$1 / x), $MachinePrecision] + N[(2.0 * t$95$1 + N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(-1.0 * N[(N[(2.0 * t$95$1 + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[t], $MachinePrecision], 1.25e-285], t$95$2, If[LessEqual[N[Abs[t], $MachinePrecision], 3.25e-224], N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[t], $MachinePrecision], 2.6e-43], t$95$2, N[Sqrt[N[(-1.0 / N[(N[(-1.0 - x), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]), $MachinePrecision]]]
\begin{array}{l}
t_1 := {\left(\left|t\right|\right)}^{2}\\
t_2 := \frac{1.4142135623730951 \cdot \left|t\right|}{\sqrt{\mathsf{fma}\left(2, \frac{t\_1}{x}, \mathsf{fma}\left(2, t\_1, \frac{{\ell}^{2}}{x}\right)\right) - -1 \cdot \frac{\mathsf{fma}\left(2, t\_1, {\ell}^{2}\right)}{x}}}\\
\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|t\right| \leq 1.25 \cdot 10^{-285}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\left|t\right| \leq 3.25 \cdot 10^{-224}:\\
\;\;\;\;1 - \frac{1}{x}\\
\mathbf{elif}\;\left|t\right| \leq 2.6 \cdot 10^{-43}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{-1}{\frac{-1 - x}{x - 1}}}\\
\end{array}
\end{array}
if t < 1.25000000000000005e-285 or 3.25e-224 < t < 2.6e-43Initial program 34.1%
Evaluated real constant34.1%
Taylor expanded in x around inf
lower--.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-fma.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-fma.f64N/A
lower-pow.f64N/A
lower-pow.f6452.9
Applied rewrites52.9%
if 1.25000000000000005e-285 < t < 3.25e-224Initial program 34.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower--.f6438.8
Applied rewrites38.8%
lift-/.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-undivN/A
lower-sqrt.f64N/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/r*N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
Applied rewrites38.8%
Taylor expanded in x around inf
lower--.f64N/A
lower-/.f6438.5
Applied rewrites38.5%
if 2.6e-43 < t Initial program 34.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower--.f6438.8
Applied rewrites38.8%
lift-/.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-undivN/A
lower-sqrt.f64N/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/r*N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
Applied rewrites38.8%
(FPCore (x l t) :precision binary64 (* (copysign 1.0 t) (sqrt (/ -1.0 (/ (- -1.0 x) (- x 1.0))))))
double code(double x, double l, double t) {
return copysign(1.0, t) * sqrt((-1.0 / ((-1.0 - x) / (x - 1.0))));
}
public static double code(double x, double l, double t) {
return Math.copySign(1.0, t) * Math.sqrt((-1.0 / ((-1.0 - x) / (x - 1.0))));
}
def code(x, l, t): return math.copysign(1.0, t) * math.sqrt((-1.0 / ((-1.0 - x) / (x - 1.0))))
function code(x, l, t) return Float64(copysign(1.0, t) * sqrt(Float64(-1.0 / Float64(Float64(-1.0 - x) / Float64(x - 1.0))))) end
function tmp = code(x, l, t) tmp = (sign(t) * abs(1.0)) * sqrt((-1.0 / ((-1.0 - x) / (x - 1.0)))); end
code[x_, l_, t_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[Sqrt[N[(-1.0 / N[(N[(-1.0 - x), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\mathsf{copysign}\left(1, t\right) \cdot \sqrt{\frac{-1}{\frac{-1 - x}{x - 1}}}
Initial program 34.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower--.f6438.8
Applied rewrites38.8%
lift-/.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-undivN/A
lower-sqrt.f64N/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/r*N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
Applied rewrites38.8%
(FPCore (x l t) :precision binary64 (* (copysign 1.0 t) (sqrt (/ (- x 1.0) (- x -1.0)))))
double code(double x, double l, double t) {
return copysign(1.0, t) * sqrt(((x - 1.0) / (x - -1.0)));
}
public static double code(double x, double l, double t) {
return Math.copySign(1.0, t) * Math.sqrt(((x - 1.0) / (x - -1.0)));
}
def code(x, l, t): return math.copysign(1.0, t) * math.sqrt(((x - 1.0) / (x - -1.0)))
function code(x, l, t) return Float64(copysign(1.0, t) * sqrt(Float64(Float64(x - 1.0) / Float64(x - -1.0)))) end
function tmp = code(x, l, t) tmp = (sign(t) * abs(1.0)) * sqrt(((x - 1.0) / (x - -1.0))); end
code[x_, l_, t_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[Sqrt[N[(N[(x - 1.0), $MachinePrecision] / N[(x - -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\mathsf{copysign}\left(1, t\right) \cdot \sqrt{\frac{x - 1}{x - -1}}
Initial program 34.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower--.f6438.8
Applied rewrites38.8%
lift-/.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-undivN/A
lower-sqrt.f64N/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/r*N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
Applied rewrites38.8%
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
lift-/.f64N/A
lift--.f64N/A
sub-flipN/A
metadata-evalN/A
distribute-neg-outN/A
lift-+.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lift-/.f64N/A
mul-1-negN/A
lift-/.f64N/A
associate-*r/N/A
div-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
mul-1-negN/A
Applied rewrites38.8%
(FPCore (x l t) :precision binary64 (* (copysign 1.0 t) (- 1.0 (/ 1.0 x))))
double code(double x, double l, double t) {
return copysign(1.0, t) * (1.0 - (1.0 / x));
}
public static double code(double x, double l, double t) {
return Math.copySign(1.0, t) * (1.0 - (1.0 / x));
}
def code(x, l, t): return math.copysign(1.0, t) * (1.0 - (1.0 / x))
function code(x, l, t) return Float64(copysign(1.0, t) * Float64(1.0 - Float64(1.0 / x))) end
function tmp = code(x, l, t) tmp = (sign(t) * abs(1.0)) * (1.0 - (1.0 / x)); end
code[x_, l_, t_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\mathsf{copysign}\left(1, t\right) \cdot \left(1 - \frac{1}{x}\right)
Initial program 34.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower--.f6438.8
Applied rewrites38.8%
lift-/.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-undivN/A
lower-sqrt.f64N/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/r*N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
sub-negate-revN/A
lift--.f64N/A
distribute-frac-negN/A
Applied rewrites38.8%
Taylor expanded in x around inf
lower--.f64N/A
lower-/.f6438.5
Applied rewrites38.5%
(FPCore (x l t) :precision binary64 (* (copysign 1.0 t) (/ 1.4142135623730951 (sqrt 2.0))))
double code(double x, double l, double t) {
return copysign(1.0, t) * (1.4142135623730951 / sqrt(2.0));
}
public static double code(double x, double l, double t) {
return Math.copySign(1.0, t) * (1.4142135623730951 / Math.sqrt(2.0));
}
def code(x, l, t): return math.copysign(1.0, t) * (1.4142135623730951 / math.sqrt(2.0))
function code(x, l, t) return Float64(copysign(1.0, t) * Float64(1.4142135623730951 / sqrt(2.0))) end
function tmp = code(x, l, t) tmp = (sign(t) * abs(1.0)) * (1.4142135623730951 / sqrt(2.0)); end
code[x_, l_, t_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(1.4142135623730951 / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\mathsf{copysign}\left(1, t\right) \cdot \frac{1.4142135623730951}{\sqrt{2}}
Initial program 34.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower--.f6438.8
Applied rewrites38.8%
Taylor expanded in x around inf
Applied rewrites38.2%
Evaluated real constant38.2%
herbie shell --seed 2025178
(FPCore (x l t)
:name "Toniolo and Linder, Equation (7)"
:precision binary64
(/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))