
(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)));
}
real(8) function code(x, l, t)
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]
\begin{array}{l}
\\
\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}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 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)));
}
real(8) function code(x, l, t)
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]
\begin{array}{l}
\\
\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}}
\end{array}
(FPCore (x l t)
:precision binary64
(let* ((t_1 (+ (* l l) (* 2.0 (* t t))))
(t_2 (/ (* l l) x))
(t_3 (* 2.0 (+ (* t t) (/ (* t t) x)))))
(if (<= t -2e+26)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t -5e-154)
(* t (/ (sqrt 2.0) (sqrt (+ t_2 (+ t_2 t_3)))))
(if (<= t 3e-301)
(* (sqrt 2.0) (/ t (* (fabs l) (sqrt (/ 2.0 x)))))
(if (<= t 4.5e-168)
(*
t
(/
(sqrt 2.0)
(fma
0.5
(/ (+ t_1 t_1) (* (sqrt 2.0) (* t x)))
(* t (sqrt 2.0)))))
(if (<= t 8.2e+76)
(*
t
(/
(sqrt 2.0)
(sqrt (+ t_2 (+ t_3 (/ (fma (* t 2.0) t (* l l)) x))))))
(- 1.0 (/ 1.0 x)))))))))
double code(double x, double l, double t) {
double t_1 = (l * l) + (2.0 * (t * t));
double t_2 = (l * l) / x;
double t_3 = 2.0 * ((t * t) + ((t * t) / x));
double tmp;
if (t <= -2e+26) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= -5e-154) {
tmp = t * (sqrt(2.0) / sqrt((t_2 + (t_2 + t_3))));
} else if (t <= 3e-301) {
tmp = sqrt(2.0) * (t / (fabs(l) * sqrt((2.0 / x))));
} else if (t <= 4.5e-168) {
tmp = t * (sqrt(2.0) / fma(0.5, ((t_1 + t_1) / (sqrt(2.0) * (t * x))), (t * sqrt(2.0))));
} else if (t <= 8.2e+76) {
tmp = t * (sqrt(2.0) / sqrt((t_2 + (t_3 + (fma((t * 2.0), t, (l * l)) / x)))));
} else {
tmp = 1.0 - (1.0 / x);
}
return tmp;
}
function code(x, l, t) t_1 = Float64(Float64(l * l) + Float64(2.0 * Float64(t * t))) t_2 = Float64(Float64(l * l) / x) t_3 = Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x))) tmp = 0.0 if (t <= -2e+26) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= -5e-154) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(t_2 + Float64(t_2 + t_3))))); elseif (t <= 3e-301) tmp = Float64(sqrt(2.0) * Float64(t / Float64(abs(l) * sqrt(Float64(2.0 / x))))); elseif (t <= 4.5e-168) tmp = Float64(t * Float64(sqrt(2.0) / fma(0.5, Float64(Float64(t_1 + t_1) / Float64(sqrt(2.0) * Float64(t * x))), Float64(t * sqrt(2.0))))); elseif (t <= 8.2e+76) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(t_2 + Float64(t_3 + Float64(fma(Float64(t * 2.0), t, Float64(l * l)) / x)))))); else tmp = Float64(1.0 - Float64(1.0 / x)); end return tmp end
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2e+26], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, -5e-154], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(t$95$2 + N[(t$95$2 + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e-301], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(N[Abs[l], $MachinePrecision] * N[Sqrt[N[(2.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.5e-168], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(0.5 * N[(N[(t$95$1 + t$95$1), $MachinePrecision] / N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.2e+76], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(t$95$2 + N[(t$95$3 + N[(N[(N[(t * 2.0), $MachinePrecision] * t + N[(l * l), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\\
t_2 := \frac{\ell \cdot \ell}{x}\\
t_3 := 2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right)\\
\mathbf{if}\;t \leq -2 \cdot 10^{+26}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq -5 \cdot 10^{-154}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{t_2 + \left(t_2 + t_3\right)}}\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-301}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\left|\ell\right| \cdot \sqrt{\frac{2}{x}}}\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-168}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(0.5, \frac{t_1 + t_1}{\sqrt{2} \cdot \left(t \cdot x\right)}, t \cdot \sqrt{2}\right)}\\
\mathbf{elif}\;t \leq 8.2 \cdot 10^{+76}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{t_2 + \left(t_3 + \frac{\mathsf{fma}\left(t \cdot 2, t, \ell \cdot \ell\right)}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{1}{x}\\
\end{array}
\end{array}
if t < -2.0000000000000001e26Initial program 31.7%
associate-*r/31.6%
fma-neg31.6%
sub-neg31.6%
metadata-eval31.6%
+-commutative31.6%
fma-def31.6%
distribute-rgt-neg-in31.6%
Simplified31.6%
associate-*r/31.7%
metadata-eval31.7%
sub-neg31.7%
fma-udef31.7%
+-commutative31.7%
distribute-rgt-neg-out31.7%
fma-neg31.7%
*-commutative31.7%
fma-neg31.7%
Applied egg-rr81.8%
Taylor expanded in t around -inf 93.2%
mul-1-neg93.2%
sub-neg93.2%
metadata-eval93.2%
Simplified93.2%
if -2.0000000000000001e26 < t < -5.0000000000000002e-154Initial program 43.3%
associate-*l/43.3%
Simplified43.3%
Taylor expanded in x around inf 87.4%
associate--l+87.4%
unpow287.4%
distribute-lft-out87.4%
unpow287.4%
unpow287.4%
associate-*r/87.4%
mul-1-neg87.4%
+-commutative87.4%
unpow287.4%
associate-*l*87.4%
unpow287.4%
fma-udef87.4%
Simplified87.4%
Taylor expanded in t around 0 87.4%
unpow287.4%
associate-*r/87.4%
mul-1-neg87.4%
distribute-rgt-neg-in87.4%
Simplified87.4%
if -5.0000000000000002e-154 < t < 2.99999999999999999e-301Initial program 2.9%
associate-*r/2.9%
fma-neg2.9%
sub-neg2.9%
metadata-eval2.9%
+-commutative2.9%
fma-def2.9%
distribute-rgt-neg-in2.9%
Simplified2.9%
Taylor expanded in l around inf 2.8%
*-commutative2.8%
unpow22.8%
associate--l+2.9%
sub-neg2.9%
metadata-eval2.9%
+-commutative2.9%
sub-neg2.9%
metadata-eval2.9%
+-commutative2.9%
Simplified2.9%
Taylor expanded in x around inf 53.8%
sqrt-prod63.1%
Applied egg-rr63.1%
rem-sqrt-square76.4%
Simplified76.4%
if 2.99999999999999999e-301 < t < 4.5000000000000001e-168Initial program 9.2%
associate-*l/9.2%
Simplified9.2%
Taylor expanded in x around inf 50.5%
associate--l+50.5%
unpow250.5%
distribute-lft-out50.5%
unpow250.5%
unpow250.5%
associate-*r/50.5%
mul-1-neg50.5%
+-commutative50.5%
unpow250.5%
associate-*l*50.5%
unpow250.5%
fma-udef50.5%
Simplified50.5%
Taylor expanded in x around inf 72.3%
fma-def72.3%
unpow272.3%
+-commutative72.3%
unpow272.3%
mul-1-neg72.3%
unpow272.3%
+-commutative72.3%
unpow272.3%
*-commutative72.3%
Simplified72.3%
if 4.5000000000000001e-168 < t < 8.1999999999999997e76Initial program 57.4%
associate-*l/57.5%
Simplified57.5%
Taylor expanded in x around inf 89.5%
associate--l+89.5%
unpow289.5%
distribute-lft-out89.5%
unpow289.5%
unpow289.5%
associate-*r/89.5%
mul-1-neg89.5%
+-commutative89.5%
unpow289.5%
associate-*l*89.5%
unpow289.5%
fma-udef89.5%
Simplified89.5%
if 8.1999999999999997e76 < t Initial program 30.1%
associate-/l*30.0%
fma-neg30.0%
remove-double-neg30.0%
fma-neg30.0%
sub-neg30.0%
metadata-eval30.0%
remove-double-neg30.0%
fma-def30.0%
Simplified30.0%
Taylor expanded in l around 0 100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
Final simplification88.9%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (* l l) x)))
(if (<= t -8.2e+19)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t -5e-154)
(*
t
(/
(sqrt 2.0)
(sqrt (+ t_1 (+ t_1 (* 2.0 (+ (* t t) (/ (* t t) x))))))))
(if (<= t 4.2e-107)
(* (sqrt 2.0) (/ t (* (fabs l) (sqrt (/ 2.0 x)))))
(+ (+ 1.0 (/ 0.5 (* x x))) (/ -1.0 x)))))))
double code(double x, double l, double t) {
double t_1 = (l * l) / x;
double tmp;
if (t <= -8.2e+19) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= -5e-154) {
tmp = t * (sqrt(2.0) / sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else if (t <= 4.2e-107) {
tmp = sqrt(2.0) * (t / (fabs(l) * sqrt((2.0 / x))));
} else {
tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x);
}
return tmp;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (l * l) / x
if (t <= (-8.2d+19)) then
tmp = -sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else if (t <= (-5d-154)) then
tmp = t * (sqrt(2.0d0) / sqrt((t_1 + (t_1 + (2.0d0 * ((t * t) + ((t * t) / x)))))))
else if (t <= 4.2d-107) then
tmp = sqrt(2.0d0) * (t / (abs(l) * sqrt((2.0d0 / x))))
else
tmp = (1.0d0 + (0.5d0 / (x * x))) + ((-1.0d0) / x)
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double t_1 = (l * l) / x;
double tmp;
if (t <= -8.2e+19) {
tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= -5e-154) {
tmp = t * (Math.sqrt(2.0) / Math.sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else if (t <= 4.2e-107) {
tmp = Math.sqrt(2.0) * (t / (Math.abs(l) * Math.sqrt((2.0 / x))));
} else {
tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x);
}
return tmp;
}
def code(x, l, t): t_1 = (l * l) / x tmp = 0 if t <= -8.2e+19: tmp = -math.sqrt(((x + -1.0) / (x + 1.0))) elif t <= -5e-154: tmp = t * (math.sqrt(2.0) / math.sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x))))))) elif t <= 4.2e-107: tmp = math.sqrt(2.0) * (t / (math.fabs(l) * math.sqrt((2.0 / x)))) else: tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x) return tmp
function code(x, l, t) t_1 = Float64(Float64(l * l) / x) tmp = 0.0 if (t <= -8.2e+19) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= -5e-154) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(t_1 + Float64(t_1 + Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x)))))))); elseif (t <= 4.2e-107) tmp = Float64(sqrt(2.0) * Float64(t / Float64(abs(l) * sqrt(Float64(2.0 / x))))); else tmp = Float64(Float64(1.0 + Float64(0.5 / Float64(x * x))) + Float64(-1.0 / x)); end return tmp end
function tmp_2 = code(x, l, t) t_1 = (l * l) / x; tmp = 0.0; if (t <= -8.2e+19) tmp = -sqrt(((x + -1.0) / (x + 1.0))); elseif (t <= -5e-154) tmp = t * (sqrt(2.0) / sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x))))))); elseif (t <= 4.2e-107) tmp = sqrt(2.0) * (t / (abs(l) * sqrt((2.0 / x)))); else tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x); end tmp_2 = tmp; end
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t, -8.2e+19], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, -5e-154], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(t$95$1 + N[(t$95$1 + N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.2e-107], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(N[Abs[l], $MachinePrecision] * N[Sqrt[N[(2.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{x}\\
\mathbf{if}\;t \leq -8.2 \cdot 10^{+19}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq -5 \cdot 10^{-154}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{t_1 + \left(t_1 + 2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right)\right)}}\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-107}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\left|\ell\right| \cdot \sqrt{\frac{2}{x}}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{0.5}{x \cdot x}\right) + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -8.2e19Initial program 31.7%
associate-*r/31.6%
fma-neg31.6%
sub-neg31.6%
metadata-eval31.6%
+-commutative31.6%
fma-def31.6%
distribute-rgt-neg-in31.6%
Simplified31.6%
associate-*r/31.7%
metadata-eval31.7%
sub-neg31.7%
fma-udef31.7%
+-commutative31.7%
distribute-rgt-neg-out31.7%
fma-neg31.7%
*-commutative31.7%
fma-neg31.7%
Applied egg-rr81.8%
Taylor expanded in t around -inf 93.2%
mul-1-neg93.2%
sub-neg93.2%
metadata-eval93.2%
Simplified93.2%
if -8.2e19 < t < -5.0000000000000002e-154Initial program 43.3%
associate-*l/43.3%
Simplified43.3%
Taylor expanded in x around inf 87.4%
associate--l+87.4%
unpow287.4%
distribute-lft-out87.4%
unpow287.4%
unpow287.4%
associate-*r/87.4%
mul-1-neg87.4%
+-commutative87.4%
unpow287.4%
associate-*l*87.4%
unpow287.4%
fma-udef87.4%
Simplified87.4%
Taylor expanded in t around 0 87.4%
unpow287.4%
associate-*r/87.4%
mul-1-neg87.4%
distribute-rgt-neg-in87.4%
Simplified87.4%
if -5.0000000000000002e-154 < t < 4.1999999999999998e-107Initial program 5.6%
associate-*r/5.6%
fma-neg5.4%
sub-neg5.4%
metadata-eval5.4%
+-commutative5.4%
fma-def5.4%
distribute-rgt-neg-in5.4%
Simplified5.4%
Taylor expanded in l around inf 6.8%
*-commutative6.8%
unpow26.8%
associate--l+7.0%
sub-neg7.0%
metadata-eval7.0%
+-commutative7.0%
sub-neg7.0%
metadata-eval7.0%
+-commutative7.0%
Simplified7.0%
Taylor expanded in x around inf 54.2%
sqrt-prod60.4%
Applied egg-rr60.4%
rem-sqrt-square67.0%
Simplified67.0%
if 4.1999999999999998e-107 < t Initial program 42.7%
associate-/l*42.6%
fma-neg42.6%
remove-double-neg42.6%
fma-neg42.6%
sub-neg42.6%
metadata-eval42.6%
remove-double-neg42.6%
fma-def42.6%
Simplified42.6%
Taylor expanded in l around 0 93.2%
+-commutative93.2%
sub-neg93.2%
metadata-eval93.2%
+-commutative93.2%
Simplified93.2%
Taylor expanded in x around inf 93.2%
associate-*r/93.2%
metadata-eval93.2%
unpow293.2%
Simplified93.2%
Final simplification85.7%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (* l l) x)))
(if (<= t -8e+21)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t 1.7e+67)
(*
t
(/
(sqrt 2.0)
(sqrt (+ t_1 (+ t_1 (* 2.0 (+ (* t t) (/ (* t t) x))))))))
(- 1.0 (/ 1.0 x))))))
double code(double x, double l, double t) {
double t_1 = (l * l) / x;
double tmp;
if (t <= -8e+21) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 1.7e+67) {
tmp = t * (sqrt(2.0) / sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else {
tmp = 1.0 - (1.0 / x);
}
return tmp;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (l * l) / x
if (t <= (-8d+21)) then
tmp = -sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else if (t <= 1.7d+67) then
tmp = t * (sqrt(2.0d0) / sqrt((t_1 + (t_1 + (2.0d0 * ((t * t) + ((t * t) / x)))))))
else
tmp = 1.0d0 - (1.0d0 / x)
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double t_1 = (l * l) / x;
double tmp;
if (t <= -8e+21) {
tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 1.7e+67) {
tmp = t * (Math.sqrt(2.0) / Math.sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else {
tmp = 1.0 - (1.0 / x);
}
return tmp;
}
def code(x, l, t): t_1 = (l * l) / x tmp = 0 if t <= -8e+21: tmp = -math.sqrt(((x + -1.0) / (x + 1.0))) elif t <= 1.7e+67: tmp = t * (math.sqrt(2.0) / math.sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x))))))) else: tmp = 1.0 - (1.0 / x) return tmp
function code(x, l, t) t_1 = Float64(Float64(l * l) / x) tmp = 0.0 if (t <= -8e+21) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= 1.7e+67) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(t_1 + Float64(t_1 + Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x)))))))); else tmp = Float64(1.0 - Float64(1.0 / x)); end return tmp end
function tmp_2 = code(x, l, t) t_1 = (l * l) / x; tmp = 0.0; if (t <= -8e+21) tmp = -sqrt(((x + -1.0) / (x + 1.0))); elseif (t <= 1.7e+67) tmp = t * (sqrt(2.0) / sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x))))))); else tmp = 1.0 - (1.0 / x); end tmp_2 = tmp; end
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t, -8e+21], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 1.7e+67], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(t$95$1 + N[(t$95$1 + N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{x}\\
\mathbf{if}\;t \leq -8 \cdot 10^{+21}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{+67}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{t_1 + \left(t_1 + 2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{1}{x}\\
\end{array}
\end{array}
if t < -8e21Initial program 31.7%
associate-*r/31.6%
fma-neg31.6%
sub-neg31.6%
metadata-eval31.6%
+-commutative31.6%
fma-def31.6%
distribute-rgt-neg-in31.6%
Simplified31.6%
associate-*r/31.7%
metadata-eval31.7%
sub-neg31.7%
fma-udef31.7%
+-commutative31.7%
distribute-rgt-neg-out31.7%
fma-neg31.7%
*-commutative31.7%
fma-neg31.7%
Applied egg-rr81.8%
Taylor expanded in t around -inf 93.2%
mul-1-neg93.2%
sub-neg93.2%
metadata-eval93.2%
Simplified93.2%
if -8e21 < t < 1.7000000000000001e67Initial program 31.3%
associate-*l/31.4%
Simplified31.4%
Taylor expanded in x around inf 73.3%
associate--l+73.3%
unpow273.3%
distribute-lft-out73.3%
unpow273.3%
unpow273.3%
associate-*r/73.3%
mul-1-neg73.3%
+-commutative73.3%
unpow273.3%
associate-*l*73.3%
unpow273.3%
fma-udef73.3%
Simplified73.3%
Taylor expanded in t around 0 73.0%
unpow273.0%
associate-*r/73.0%
mul-1-neg73.0%
distribute-rgt-neg-in73.0%
Simplified73.0%
if 1.7000000000000001e67 < t Initial program 30.1%
associate-/l*30.0%
fma-neg30.0%
remove-double-neg30.0%
fma-neg30.0%
sub-neg30.0%
metadata-eval30.0%
remove-double-neg30.0%
fma-def30.0%
Simplified30.0%
Taylor expanded in l around 0 100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
Final simplification83.6%
(FPCore (x l t)
:precision binary64
(if (<= t -1.8e-140)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t 4e-107)
(* (sqrt 2.0) (/ t (sqrt (* 2.0 (/ l (/ x l))))))
(+ (+ 1.0 (/ 0.5 (* x x))) (/ -1.0 x)))))
double code(double x, double l, double t) {
double tmp;
if (t <= -1.8e-140) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 4e-107) {
tmp = sqrt(2.0) * (t / sqrt((2.0 * (l / (x / l)))));
} else {
tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x);
}
return tmp;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.8d-140)) then
tmp = -sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else if (t <= 4d-107) then
tmp = sqrt(2.0d0) * (t / sqrt((2.0d0 * (l / (x / l)))))
else
tmp = (1.0d0 + (0.5d0 / (x * x))) + ((-1.0d0) / x)
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= -1.8e-140) {
tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 4e-107) {
tmp = Math.sqrt(2.0) * (t / Math.sqrt((2.0 * (l / (x / l)))));
} else {
tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x);
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -1.8e-140: tmp = -math.sqrt(((x + -1.0) / (x + 1.0))) elif t <= 4e-107: tmp = math.sqrt(2.0) * (t / math.sqrt((2.0 * (l / (x / l))))) else: tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -1.8e-140) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= 4e-107) tmp = Float64(sqrt(2.0) * Float64(t / sqrt(Float64(2.0 * Float64(l / Float64(x / l)))))); else tmp = Float64(Float64(1.0 + Float64(0.5 / Float64(x * x))) + Float64(-1.0 / x)); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -1.8e-140) tmp = -sqrt(((x + -1.0) / (x + 1.0))); elseif (t <= 4e-107) tmp = sqrt(2.0) * (t / sqrt((2.0 * (l / (x / l))))); else tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -1.8e-140], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 4e-107], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[Sqrt[N[(2.0 * N[(l / N[(x / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{-140}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-107}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{\ell}{\frac{x}{\ell}}}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{0.5}{x \cdot x}\right) + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -1.8e-140Initial program 38.3%
associate-*r/38.2%
fma-neg38.2%
sub-neg38.2%
metadata-eval38.2%
+-commutative38.2%
fma-def38.2%
distribute-rgt-neg-in38.2%
Simplified38.2%
associate-*r/38.3%
metadata-eval38.3%
sub-neg38.3%
fma-udef38.3%
+-commutative38.3%
distribute-rgt-neg-out38.3%
fma-neg38.3%
*-commutative38.3%
fma-neg38.3%
Applied egg-rr68.4%
Taylor expanded in t around -inf 83.5%
mul-1-neg83.5%
sub-neg83.5%
metadata-eval83.5%
Simplified83.5%
if -1.8e-140 < t < 4e-107Initial program 5.4%
associate-*r/5.4%
fma-neg5.2%
sub-neg5.2%
metadata-eval5.2%
+-commutative5.2%
fma-def5.2%
distribute-rgt-neg-in5.2%
Simplified5.2%
Taylor expanded in l around inf 6.6%
*-commutative6.6%
unpow26.6%
associate--l+6.7%
sub-neg6.7%
metadata-eval6.7%
+-commutative6.7%
sub-neg6.7%
metadata-eval6.7%
+-commutative6.7%
Simplified6.7%
Taylor expanded in x around inf 54.4%
Taylor expanded in l around 0 54.4%
unpow254.4%
associate-/l*57.1%
Simplified57.1%
if 4e-107 < t Initial program 42.7%
associate-/l*42.6%
fma-neg42.6%
remove-double-neg42.6%
fma-neg42.6%
sub-neg42.6%
metadata-eval42.6%
remove-double-neg42.6%
fma-def42.6%
Simplified42.6%
Taylor expanded in l around 0 93.2%
+-commutative93.2%
sub-neg93.2%
metadata-eval93.2%
+-commutative93.2%
Simplified93.2%
Taylor expanded in x around inf 93.2%
associate-*r/93.2%
metadata-eval93.2%
unpow293.2%
Simplified93.2%
Final simplification79.9%
(FPCore (x l t)
:precision binary64
(if (<= t -3.8e-143)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t 1.1e-257)
(* (/ t l) (sqrt x))
(/ 1.0 (sqrt (/ (+ x 1.0) (+ x -1.0)))))))
double code(double x, double l, double t) {
double tmp;
if (t <= -3.8e-143) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 1.1e-257) {
tmp = (t / l) * sqrt(x);
} else {
tmp = 1.0 / sqrt(((x + 1.0) / (x + -1.0)));
}
return tmp;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-3.8d-143)) then
tmp = -sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else if (t <= 1.1d-257) then
tmp = (t / l) * sqrt(x)
else
tmp = 1.0d0 / sqrt(((x + 1.0d0) / (x + (-1.0d0))))
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= -3.8e-143) {
tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 1.1e-257) {
tmp = (t / l) * Math.sqrt(x);
} else {
tmp = 1.0 / Math.sqrt(((x + 1.0) / (x + -1.0)));
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -3.8e-143: tmp = -math.sqrt(((x + -1.0) / (x + 1.0))) elif t <= 1.1e-257: tmp = (t / l) * math.sqrt(x) else: tmp = 1.0 / math.sqrt(((x + 1.0) / (x + -1.0))) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -3.8e-143) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= 1.1e-257) tmp = Float64(Float64(t / l) * sqrt(x)); else tmp = Float64(1.0 / sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0)))); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -3.8e-143) tmp = -sqrt(((x + -1.0) / (x + 1.0))); elseif (t <= 1.1e-257) tmp = (t / l) * sqrt(x); else tmp = 1.0 / sqrt(((x + 1.0) / (x + -1.0))); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -3.8e-143], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 1.1e-257], N[(N[(t / l), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{-143}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{-257}:\\
\;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{\frac{x + 1}{x + -1}}}\\
\end{array}
\end{array}
if t < -3.79999999999999981e-143Initial program 38.0%
associate-*r/37.8%
fma-neg37.8%
sub-neg37.8%
metadata-eval37.8%
+-commutative37.8%
fma-def37.8%
distribute-rgt-neg-in37.8%
Simplified37.8%
associate-*r/38.0%
metadata-eval38.0%
sub-neg38.0%
fma-udef38.0%
+-commutative38.0%
distribute-rgt-neg-out38.0%
fma-neg38.0%
*-commutative38.0%
fma-neg38.0%
Applied egg-rr67.7%
Taylor expanded in t around -inf 82.7%
mul-1-neg82.7%
sub-neg82.7%
metadata-eval82.7%
Simplified82.7%
if -3.79999999999999981e-143 < t < 1.09999999999999994e-257Initial program 4.2%
associate-*r/4.2%
fma-neg4.2%
sub-neg4.2%
metadata-eval4.2%
+-commutative4.2%
fma-def4.2%
distribute-rgt-neg-in4.2%
Simplified4.2%
Taylor expanded in l around inf 4.1%
*-commutative4.1%
unpow24.1%
associate--l+4.2%
sub-neg4.2%
metadata-eval4.2%
+-commutative4.2%
sub-neg4.2%
metadata-eval4.2%
+-commutative4.2%
Simplified4.2%
Taylor expanded in x around inf 56.0%
Taylor expanded in t around 0 51.5%
if 1.09999999999999994e-257 < t Initial program 35.1%
associate-/l*35.0%
fma-neg34.9%
remove-double-neg34.9%
fma-neg35.0%
sub-neg35.0%
metadata-eval35.0%
remove-double-neg35.0%
fma-def35.0%
Simplified35.0%
Taylor expanded in l around 0 82.6%
+-commutative82.6%
sub-neg82.6%
metadata-eval82.6%
+-commutative82.6%
Simplified82.6%
expm1-log1p-u82.6%
expm1-udef82.6%
associate-/r*82.6%
pow1/282.6%
pow1/282.6%
pow-div82.6%
metadata-eval82.6%
metadata-eval82.6%
+-commutative82.6%
+-commutative82.6%
Applied egg-rr82.6%
expm1-def82.7%
expm1-log1p82.7%
Simplified82.7%
Final simplification77.6%
(FPCore (x l t) :precision binary64 (if (<= t -7e-144) (- (/ 1.0 x) (+ 1.0 (/ 0.5 (* x x)))) (if (<= t 7.2e-257) (* (/ t l) (sqrt x)) (sqrt (/ (+ x -1.0) (+ x 1.0))))))
double code(double x, double l, double t) {
double tmp;
if (t <= -7e-144) {
tmp = (1.0 / x) - (1.0 + (0.5 / (x * x)));
} else if (t <= 7.2e-257) {
tmp = (t / l) * sqrt(x);
} else {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-7d-144)) then
tmp = (1.0d0 / x) - (1.0d0 + (0.5d0 / (x * x)))
else if (t <= 7.2d-257) then
tmp = (t / l) * sqrt(x)
else
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= -7e-144) {
tmp = (1.0 / x) - (1.0 + (0.5 / (x * x)));
} else if (t <= 7.2e-257) {
tmp = (t / l) * Math.sqrt(x);
} else {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -7e-144: tmp = (1.0 / x) - (1.0 + (0.5 / (x * x))) elif t <= 7.2e-257: tmp = (t / l) * math.sqrt(x) else: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -7e-144) tmp = Float64(Float64(1.0 / x) - Float64(1.0 + Float64(0.5 / Float64(x * x)))); elseif (t <= 7.2e-257) tmp = Float64(Float64(t / l) * sqrt(x)); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -7e-144) tmp = (1.0 / x) - (1.0 + (0.5 / (x * x))); elseif (t <= 7.2e-257) tmp = (t / l) * sqrt(x); else tmp = sqrt(((x + -1.0) / (x + 1.0))); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -7e-144], N[(N[(1.0 / x), $MachinePrecision] - N[(1.0 + N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e-257], N[(N[(t / l), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{-144}:\\
\;\;\;\;\frac{1}{x} - \left(1 + \frac{0.5}{x \cdot x}\right)\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-257}:\\
\;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -6.9999999999999997e-144Initial program 38.0%
associate-*r/37.8%
fma-neg37.8%
sub-neg37.8%
metadata-eval37.8%
+-commutative37.8%
fma-def37.8%
distribute-rgt-neg-in37.8%
Simplified37.8%
Taylor expanded in t around -inf 82.5%
associate-*r*82.5%
*-commutative82.5%
neg-mul-182.5%
distribute-rgt-neg-in82.5%
+-commutative82.5%
sub-neg82.5%
metadata-eval82.5%
+-commutative82.5%
Simplified82.5%
Taylor expanded in x around inf 80.9%
associate-*r/80.9%
metadata-eval80.9%
unpow280.9%
Simplified80.9%
if -6.9999999999999997e-144 < t < 7.20000000000000013e-257Initial program 4.2%
associate-*r/4.2%
fma-neg4.2%
sub-neg4.2%
metadata-eval4.2%
+-commutative4.2%
fma-def4.2%
distribute-rgt-neg-in4.2%
Simplified4.2%
Taylor expanded in l around inf 4.1%
*-commutative4.1%
unpow24.1%
associate--l+4.2%
sub-neg4.2%
metadata-eval4.2%
+-commutative4.2%
sub-neg4.2%
metadata-eval4.2%
+-commutative4.2%
Simplified4.2%
Taylor expanded in x around inf 56.0%
Taylor expanded in t around 0 51.5%
if 7.20000000000000013e-257 < t Initial program 35.1%
associate-*r/35.0%
fma-neg34.9%
sub-neg34.9%
metadata-eval34.9%
+-commutative34.9%
fma-def34.9%
distribute-rgt-neg-in34.9%
Simplified34.9%
associate-*r/35.0%
metadata-eval35.0%
sub-neg35.0%
fma-udef35.0%
+-commutative35.0%
distribute-rgt-neg-out35.0%
fma-neg35.1%
*-commutative35.1%
fma-neg35.0%
Applied egg-rr73.1%
Taylor expanded in t around inf 82.6%
Final simplification76.9%
(FPCore (x l t) :precision binary64 (let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0))))) (if (<= t -8.4e-144) (- t_1) (if (<= t 3e-257) (* (/ t l) (sqrt x)) t_1))))
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -8.4e-144) {
tmp = -t_1;
} else if (t <= 3e-257) {
tmp = (t / l) * sqrt(x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
if (t <= (-8.4d-144)) then
tmp = -t_1
else if (t <= 3d-257) then
tmp = (t / l) * sqrt(x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -8.4e-144) {
tmp = -t_1;
} else if (t <= 3e-257) {
tmp = (t / l) * Math.sqrt(x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, l, t): t_1 = math.sqrt(((x + -1.0) / (x + 1.0))) tmp = 0 if t <= -8.4e-144: tmp = -t_1 elif t <= 3e-257: tmp = (t / l) * math.sqrt(x) else: tmp = t_1 return tmp
function code(x, l, t) t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -8.4e-144) tmp = Float64(-t_1); elseif (t <= 3e-257) tmp = Float64(Float64(t / l) * sqrt(x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, l, t) t_1 = sqrt(((x + -1.0) / (x + 1.0))); tmp = 0.0; if (t <= -8.4e-144) tmp = -t_1; elseif (t <= 3e-257) tmp = (t / l) * sqrt(x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -8.4e-144], (-t$95$1), If[LessEqual[t, 3e-257], N[(N[(t / l), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -8.4 \cdot 10^{-144}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-257}:\\
\;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -8.4000000000000005e-144Initial program 38.0%
associate-*r/37.8%
fma-neg37.8%
sub-neg37.8%
metadata-eval37.8%
+-commutative37.8%
fma-def37.8%
distribute-rgt-neg-in37.8%
Simplified37.8%
associate-*r/38.0%
metadata-eval38.0%
sub-neg38.0%
fma-udef38.0%
+-commutative38.0%
distribute-rgt-neg-out38.0%
fma-neg38.0%
*-commutative38.0%
fma-neg38.0%
Applied egg-rr67.7%
Taylor expanded in t around -inf 82.7%
mul-1-neg82.7%
sub-neg82.7%
metadata-eval82.7%
Simplified82.7%
if -8.4000000000000005e-144 < t < 2.9999999999999999e-257Initial program 4.2%
associate-*r/4.2%
fma-neg4.2%
sub-neg4.2%
metadata-eval4.2%
+-commutative4.2%
fma-def4.2%
distribute-rgt-neg-in4.2%
Simplified4.2%
Taylor expanded in l around inf 4.1%
*-commutative4.1%
unpow24.1%
associate--l+4.2%
sub-neg4.2%
metadata-eval4.2%
+-commutative4.2%
sub-neg4.2%
metadata-eval4.2%
+-commutative4.2%
Simplified4.2%
Taylor expanded in x around inf 56.0%
Taylor expanded in t around 0 51.5%
if 2.9999999999999999e-257 < t Initial program 35.1%
associate-*r/35.0%
fma-neg34.9%
sub-neg34.9%
metadata-eval34.9%
+-commutative34.9%
fma-def34.9%
distribute-rgt-neg-in34.9%
Simplified34.9%
associate-*r/35.0%
metadata-eval35.0%
sub-neg35.0%
fma-udef35.0%
+-commutative35.0%
distribute-rgt-neg-out35.0%
fma-neg35.1%
*-commutative35.1%
fma-neg35.0%
Applied egg-rr73.1%
Taylor expanded in t around inf 82.6%
Final simplification77.5%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (+ 1.0 (/ 0.5 (* x x)))))
(if (<= t -4.8e-144)
(- (/ 1.0 x) t_1)
(if (<= t 2.25e-255) (* (/ t l) (sqrt x)) (+ t_1 (/ -1.0 x))))))
double code(double x, double l, double t) {
double t_1 = 1.0 + (0.5 / (x * x));
double tmp;
if (t <= -4.8e-144) {
tmp = (1.0 / x) - t_1;
} else if (t <= 2.25e-255) {
tmp = (t / l) * sqrt(x);
} else {
tmp = t_1 + (-1.0 / x);
}
return tmp;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 + (0.5d0 / (x * x))
if (t <= (-4.8d-144)) then
tmp = (1.0d0 / x) - t_1
else if (t <= 2.25d-255) then
tmp = (t / l) * sqrt(x)
else
tmp = t_1 + ((-1.0d0) / x)
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double t_1 = 1.0 + (0.5 / (x * x));
double tmp;
if (t <= -4.8e-144) {
tmp = (1.0 / x) - t_1;
} else if (t <= 2.25e-255) {
tmp = (t / l) * Math.sqrt(x);
} else {
tmp = t_1 + (-1.0 / x);
}
return tmp;
}
def code(x, l, t): t_1 = 1.0 + (0.5 / (x * x)) tmp = 0 if t <= -4.8e-144: tmp = (1.0 / x) - t_1 elif t <= 2.25e-255: tmp = (t / l) * math.sqrt(x) else: tmp = t_1 + (-1.0 / x) return tmp
function code(x, l, t) t_1 = Float64(1.0 + Float64(0.5 / Float64(x * x))) tmp = 0.0 if (t <= -4.8e-144) tmp = Float64(Float64(1.0 / x) - t_1); elseif (t <= 2.25e-255) tmp = Float64(Float64(t / l) * sqrt(x)); else tmp = Float64(t_1 + Float64(-1.0 / x)); end return tmp end
function tmp_2 = code(x, l, t) t_1 = 1.0 + (0.5 / (x * x)); tmp = 0.0; if (t <= -4.8e-144) tmp = (1.0 / x) - t_1; elseif (t <= 2.25e-255) tmp = (t / l) * sqrt(x); else tmp = t_1 + (-1.0 / x); end tmp_2 = tmp; end
code[x_, l_, t_] := Block[{t$95$1 = N[(1.0 + N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.8e-144], N[(N[(1.0 / x), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t, 2.25e-255], N[(N[(t / l), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 + \frac{0.5}{x \cdot x}\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{-144}:\\
\;\;\;\;\frac{1}{x} - t_1\\
\mathbf{elif}\;t \leq 2.25 \cdot 10^{-255}:\\
\;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;t_1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -4.79999999999999988e-144Initial program 38.0%
associate-*r/37.8%
fma-neg37.8%
sub-neg37.8%
metadata-eval37.8%
+-commutative37.8%
fma-def37.8%
distribute-rgt-neg-in37.8%
Simplified37.8%
Taylor expanded in t around -inf 82.5%
associate-*r*82.5%
*-commutative82.5%
neg-mul-182.5%
distribute-rgt-neg-in82.5%
+-commutative82.5%
sub-neg82.5%
metadata-eval82.5%
+-commutative82.5%
Simplified82.5%
Taylor expanded in x around inf 80.9%
associate-*r/80.9%
metadata-eval80.9%
unpow280.9%
Simplified80.9%
if -4.79999999999999988e-144 < t < 2.2499999999999999e-255Initial program 4.2%
associate-*r/4.2%
fma-neg4.2%
sub-neg4.2%
metadata-eval4.2%
+-commutative4.2%
fma-def4.2%
distribute-rgt-neg-in4.2%
Simplified4.2%
Taylor expanded in l around inf 4.1%
*-commutative4.1%
unpow24.1%
associate--l+4.2%
sub-neg4.2%
metadata-eval4.2%
+-commutative4.2%
sub-neg4.2%
metadata-eval4.2%
+-commutative4.2%
Simplified4.2%
Taylor expanded in x around inf 56.0%
Taylor expanded in t around 0 51.5%
if 2.2499999999999999e-255 < t Initial program 35.1%
associate-/l*35.0%
fma-neg34.9%
remove-double-neg34.9%
fma-neg35.0%
sub-neg35.0%
metadata-eval35.0%
remove-double-neg35.0%
fma-def35.0%
Simplified35.0%
Taylor expanded in l around 0 82.6%
+-commutative82.6%
sub-neg82.6%
metadata-eval82.6%
+-commutative82.6%
Simplified82.6%
Taylor expanded in x around inf 82.6%
associate-*r/82.6%
metadata-eval82.6%
unpow282.6%
Simplified82.6%
Final simplification76.8%
(FPCore (x l t) :precision binary64 (if (<= t -1e-309) (+ -1.0 (/ 1.0 x)) (+ (+ 1.0 (/ 0.5 (* x x))) (/ -1.0 x))))
double code(double x, double l, double t) {
double tmp;
if (t <= -1e-309) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x);
}
return tmp;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1d-309)) then
tmp = (-1.0d0) + (1.0d0 / x)
else
tmp = (1.0d0 + (0.5d0 / (x * x))) + ((-1.0d0) / x)
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= -1e-309) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x);
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -1e-309: tmp = -1.0 + (1.0 / x) else: tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -1e-309) tmp = Float64(-1.0 + Float64(1.0 / x)); else tmp = Float64(Float64(1.0 + Float64(0.5 / Float64(x * x))) + Float64(-1.0 / x)); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -1e-309) tmp = -1.0 + (1.0 / x); else tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -1e-309], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{-309}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{0.5}{x \cdot x}\right) + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -1.000000000000002e-309Initial program 29.5%
associate-*r/29.4%
fma-neg29.4%
sub-neg29.4%
metadata-eval29.4%
+-commutative29.4%
fma-def29.4%
distribute-rgt-neg-in29.4%
Simplified29.4%
Taylor expanded in t around -inf 69.8%
associate-*r*69.8%
*-commutative69.8%
neg-mul-169.8%
distribute-rgt-neg-in69.8%
+-commutative69.8%
sub-neg69.8%
metadata-eval69.8%
+-commutative69.8%
Simplified69.8%
Taylor expanded in x around inf 68.1%
if -1.000000000000002e-309 < t Initial program 32.7%
associate-/l*32.7%
fma-neg32.6%
remove-double-neg32.6%
fma-neg32.7%
sub-neg32.7%
metadata-eval32.7%
remove-double-neg32.7%
fma-def32.7%
Simplified32.7%
Taylor expanded in l around 0 76.8%
+-commutative76.8%
sub-neg76.8%
metadata-eval76.8%
+-commutative76.8%
Simplified76.8%
Taylor expanded in x around inf 76.7%
associate-*r/76.7%
metadata-eval76.7%
unpow276.7%
Simplified76.7%
Final simplification72.4%
(FPCore (x l t) :precision binary64 (let* ((t_1 (+ 1.0 (/ 0.5 (* x x))))) (if (<= t -1e-309) (- (/ 1.0 x) t_1) (+ t_1 (/ -1.0 x)))))
double code(double x, double l, double t) {
double t_1 = 1.0 + (0.5 / (x * x));
double tmp;
if (t <= -1e-309) {
tmp = (1.0 / x) - t_1;
} else {
tmp = t_1 + (-1.0 / x);
}
return tmp;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 + (0.5d0 / (x * x))
if (t <= (-1d-309)) then
tmp = (1.0d0 / x) - t_1
else
tmp = t_1 + ((-1.0d0) / x)
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double t_1 = 1.0 + (0.5 / (x * x));
double tmp;
if (t <= -1e-309) {
tmp = (1.0 / x) - t_1;
} else {
tmp = t_1 + (-1.0 / x);
}
return tmp;
}
def code(x, l, t): t_1 = 1.0 + (0.5 / (x * x)) tmp = 0 if t <= -1e-309: tmp = (1.0 / x) - t_1 else: tmp = t_1 + (-1.0 / x) return tmp
function code(x, l, t) t_1 = Float64(1.0 + Float64(0.5 / Float64(x * x))) tmp = 0.0 if (t <= -1e-309) tmp = Float64(Float64(1.0 / x) - t_1); else tmp = Float64(t_1 + Float64(-1.0 / x)); end return tmp end
function tmp_2 = code(x, l, t) t_1 = 1.0 + (0.5 / (x * x)); tmp = 0.0; if (t <= -1e-309) tmp = (1.0 / x) - t_1; else tmp = t_1 + (-1.0 / x); end tmp_2 = tmp; end
code[x_, l_, t_] := Block[{t$95$1 = N[(1.0 + N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1e-309], N[(N[(1.0 / x), $MachinePrecision] - t$95$1), $MachinePrecision], N[(t$95$1 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 + \frac{0.5}{x \cdot x}\\
\mathbf{if}\;t \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{1}{x} - t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -1.000000000000002e-309Initial program 29.5%
associate-*r/29.4%
fma-neg29.4%
sub-neg29.4%
metadata-eval29.4%
+-commutative29.4%
fma-def29.4%
distribute-rgt-neg-in29.4%
Simplified29.4%
Taylor expanded in t around -inf 69.8%
associate-*r*69.8%
*-commutative69.8%
neg-mul-169.8%
distribute-rgt-neg-in69.8%
+-commutative69.8%
sub-neg69.8%
metadata-eval69.8%
+-commutative69.8%
Simplified69.8%
Taylor expanded in x around inf 68.5%
associate-*r/68.5%
metadata-eval68.5%
unpow268.5%
Simplified68.5%
if -1.000000000000002e-309 < t Initial program 32.7%
associate-/l*32.7%
fma-neg32.6%
remove-double-neg32.6%
fma-neg32.7%
sub-neg32.7%
metadata-eval32.7%
remove-double-neg32.7%
fma-def32.7%
Simplified32.7%
Taylor expanded in l around 0 76.8%
+-commutative76.8%
sub-neg76.8%
metadata-eval76.8%
+-commutative76.8%
Simplified76.8%
Taylor expanded in x around inf 76.7%
associate-*r/76.7%
metadata-eval76.7%
unpow276.7%
Simplified76.7%
Final simplification72.6%
(FPCore (x l t) :precision binary64 (if (<= t -1e-309) -1.0 (+ 1.0 (/ -1.0 x))))
double code(double x, double l, double t) {
double tmp;
if (t <= -1e-309) {
tmp = -1.0;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1d-309)) then
tmp = -1.0d0
else
tmp = 1.0d0 + ((-1.0d0) / x)
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= -1e-309) {
tmp = -1.0;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -1e-309: tmp = -1.0 else: tmp = 1.0 + (-1.0 / x) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -1e-309) tmp = -1.0; else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -1e-309) tmp = -1.0; else tmp = 1.0 + (-1.0 / x); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -1e-309], -1.0, N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{-309}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -1.000000000000002e-309Initial program 29.5%
associate-*r/29.4%
fma-neg29.4%
sub-neg29.4%
metadata-eval29.4%
+-commutative29.4%
fma-def29.4%
distribute-rgt-neg-in29.4%
Simplified29.4%
associate-*r/29.5%
metadata-eval29.5%
sub-neg29.5%
fma-udef29.5%
+-commutative29.5%
distribute-rgt-neg-out29.5%
fma-neg29.5%
*-commutative29.5%
fma-neg29.5%
Applied egg-rr58.2%
Taylor expanded in t around inf 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt67.3%
Simplified67.3%
if -1.000000000000002e-309 < t Initial program 32.7%
associate-/l*32.7%
fma-neg32.6%
remove-double-neg32.6%
fma-neg32.7%
sub-neg32.7%
metadata-eval32.7%
remove-double-neg32.7%
fma-def32.7%
Simplified32.7%
Taylor expanded in l around 0 76.8%
+-commutative76.8%
sub-neg76.8%
metadata-eval76.8%
+-commutative76.8%
Simplified76.8%
Taylor expanded in x around inf 76.3%
Final simplification71.8%
(FPCore (x l t) :precision binary64 (if (<= t -1e-309) (+ -1.0 (/ 1.0 x)) (- 1.0 (/ 1.0 x))))
double code(double x, double l, double t) {
double tmp;
if (t <= -1e-309) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0 - (1.0 / x);
}
return tmp;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1d-309)) then
tmp = (-1.0d0) + (1.0d0 / x)
else
tmp = 1.0d0 - (1.0d0 / x)
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= -1e-309) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0 - (1.0 / x);
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -1e-309: tmp = -1.0 + (1.0 / x) else: tmp = 1.0 - (1.0 / x) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -1e-309) tmp = Float64(-1.0 + Float64(1.0 / x)); else tmp = Float64(1.0 - Float64(1.0 / x)); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -1e-309) tmp = -1.0 + (1.0 / x); else tmp = 1.0 - (1.0 / x); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -1e-309], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{-309}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{1}{x}\\
\end{array}
\end{array}
if t < -1.000000000000002e-309Initial program 29.5%
associate-*r/29.4%
fma-neg29.4%
sub-neg29.4%
metadata-eval29.4%
+-commutative29.4%
fma-def29.4%
distribute-rgt-neg-in29.4%
Simplified29.4%
Taylor expanded in t around -inf 69.8%
associate-*r*69.8%
*-commutative69.8%
neg-mul-169.8%
distribute-rgt-neg-in69.8%
+-commutative69.8%
sub-neg69.8%
metadata-eval69.8%
+-commutative69.8%
Simplified69.8%
Taylor expanded in x around inf 68.1%
if -1.000000000000002e-309 < t Initial program 32.7%
associate-/l*32.7%
fma-neg32.6%
remove-double-neg32.6%
fma-neg32.7%
sub-neg32.7%
metadata-eval32.7%
remove-double-neg32.7%
fma-def32.7%
Simplified32.7%
Taylor expanded in l around 0 76.8%
+-commutative76.8%
sub-neg76.8%
metadata-eval76.8%
+-commutative76.8%
Simplified76.8%
Taylor expanded in x around inf 76.3%
Final simplification72.2%
(FPCore (x l t) :precision binary64 (if (<= t -1e-309) -1.0 1.0))
double code(double x, double l, double t) {
double tmp;
if (t <= -1e-309) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1d-309)) then
tmp = -1.0d0
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= -1e-309) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -1e-309: tmp = -1.0 else: tmp = 1.0 return tmp
function code(x, l, t) tmp = 0.0 if (t <= -1e-309) tmp = -1.0; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -1e-309) tmp = -1.0; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -1e-309], -1.0, 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{-309}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -1.000000000000002e-309Initial program 29.5%
associate-*r/29.4%
fma-neg29.4%
sub-neg29.4%
metadata-eval29.4%
+-commutative29.4%
fma-def29.4%
distribute-rgt-neg-in29.4%
Simplified29.4%
associate-*r/29.5%
metadata-eval29.5%
sub-neg29.5%
fma-udef29.5%
+-commutative29.5%
distribute-rgt-neg-out29.5%
fma-neg29.5%
*-commutative29.5%
fma-neg29.5%
Applied egg-rr58.2%
Taylor expanded in t around inf 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt67.3%
Simplified67.3%
if -1.000000000000002e-309 < t Initial program 32.7%
associate-/l*32.7%
fma-neg32.6%
remove-double-neg32.6%
fma-neg32.7%
sub-neg32.7%
metadata-eval32.7%
remove-double-neg32.7%
fma-def32.7%
Simplified32.7%
Taylor expanded in l around 0 76.8%
+-commutative76.8%
sub-neg76.8%
metadata-eval76.8%
+-commutative76.8%
Simplified76.8%
Taylor expanded in x around inf 75.4%
Final simplification71.4%
(FPCore (x l t) :precision binary64 -1.0)
double code(double x, double l, double t) {
return -1.0;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = -1.0d0
end function
public static double code(double x, double l, double t) {
return -1.0;
}
def code(x, l, t): return -1.0
function code(x, l, t) return -1.0 end
function tmp = code(x, l, t) tmp = -1.0; end
code[x_, l_, t_] := -1.0
\begin{array}{l}
\\
-1
\end{array}
Initial program 31.1%
associate-*r/31.0%
fma-neg31.0%
sub-neg31.0%
metadata-eval31.0%
+-commutative31.0%
fma-def31.0%
distribute-rgt-neg-in31.0%
Simplified31.0%
associate-*r/31.1%
metadata-eval31.1%
sub-neg31.1%
fma-udef31.1%
+-commutative31.1%
distribute-rgt-neg-out31.1%
fma-neg31.1%
*-commutative31.1%
fma-neg31.1%
Applied egg-rr64.4%
Taylor expanded in t around inf 39.3%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt34.6%
Simplified34.6%
Final simplification34.6%
herbie shell --seed 2023178
(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)))))