
(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 11 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 (* 2.0 (* t t)))
(t_2
(*
t
(/
(sqrt 2.0)
(sqrt
(+
(/ (* l l) x)
(+
(* 2.0 (+ (* t t) (/ (* t t) x)))
(/ (fma (* t 2.0) t (* l l)) x))))))))
(if (<= t -3.8e+37)
(+ -1.0 (/ 1.0 x))
(if (<= t -1.8e-293)
t_2
(if (<= t 9.2e-159)
(*
t
(/
(sqrt 2.0)
(fma
0.5
(/ (+ (* l l) (+ t_1 (+ (* l l) t_1))) (* (sqrt 2.0) (* t x)))
(* t (sqrt 2.0)))))
(if (<= t 5e+14) t_2 (+ 1.0 (/ -1.0 x))))))))
double code(double x, double l, double t) {
double t_1 = 2.0 * (t * t);
double t_2 = t * (sqrt(2.0) / sqrt((((l * l) / x) + ((2.0 * ((t * t) + ((t * t) / x))) + (fma((t * 2.0), t, (l * l)) / x)))));
double tmp;
if (t <= -3.8e+37) {
tmp = -1.0 + (1.0 / x);
} else if (t <= -1.8e-293) {
tmp = t_2;
} else if (t <= 9.2e-159) {
tmp = t * (sqrt(2.0) / fma(0.5, (((l * l) + (t_1 + ((l * l) + t_1))) / (sqrt(2.0) * (t * x))), (t * sqrt(2.0))));
} else if (t <= 5e+14) {
tmp = t_2;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
function code(x, l, t) t_1 = Float64(2.0 * Float64(t * t)) t_2 = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(Float64(l * l) / x) + Float64(Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x))) + Float64(fma(Float64(t * 2.0), t, Float64(l * l)) / x)))))) tmp = 0.0 if (t <= -3.8e+37) tmp = Float64(-1.0 + Float64(1.0 / x)); elseif (t <= -1.8e-293) tmp = t_2; elseif (t <= 9.2e-159) tmp = Float64(t * Float64(sqrt(2.0) / fma(0.5, Float64(Float64(Float64(l * l) + Float64(t_1 + Float64(Float64(l * l) + t_1))) / Float64(sqrt(2.0) * Float64(t * x))), Float64(t * sqrt(2.0))))); elseif (t <= 5e+14) tmp = t_2; else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
code[x_, l_, t_] := Block[{t$95$1 = N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision] + N[(N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(t * 2.0), $MachinePrecision] * t + N[(l * l), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.8e+37], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.8e-293], t$95$2, If[LessEqual[t, 9.2e-159], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(0.5 * N[(N[(N[(l * l), $MachinePrecision] + N[(t$95$1 + N[(N[(l * l), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $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, 5e+14], t$95$2, N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(t \cdot t\right)\\
t_2 := t \cdot \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right) + \frac{\mathsf{fma}\left(t \cdot 2, t, \ell \cdot \ell\right)}{x}\right)}}\\
\mathbf{if}\;t \leq -3.8 \cdot 10^{+37}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{elif}\;t \leq -1.8 \cdot 10^{-293}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 9.2 \cdot 10^{-159}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(0.5, \frac{\ell \cdot \ell + \left(t_1 + \left(\ell \cdot \ell + t_1\right)\right)}{\sqrt{2} \cdot \left(t \cdot x\right)}, t \cdot \sqrt{2}\right)}\\
\mathbf{elif}\;t \leq 5 \cdot 10^{+14}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -3.7999999999999999e37Initial program 33.5%
associate-/l*33.6%
fma-neg33.6%
remove-double-neg33.6%
fma-neg33.6%
sub-neg33.6%
metadata-eval33.6%
remove-double-neg33.6%
fma-def33.6%
Simplified33.6%
associate-/r/33.6%
Applied egg-rr90.8%
Taylor expanded in l around 0 1.6%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt95.7%
Simplified95.7%
if -3.7999999999999999e37 < t < -1.79999999999999993e-293 or 9.19999999999999914e-159 < t < 5e14Initial program 38.1%
associate-*l/38.2%
Simplified38.2%
Taylor expanded in x around inf 79.3%
associate--l+79.3%
unpow279.3%
distribute-lft-out79.3%
unpow279.3%
unpow279.3%
associate-*r/79.3%
mul-1-neg79.3%
+-commutative79.3%
unpow279.3%
associate-*l*79.3%
unpow279.3%
fma-udef79.3%
Simplified79.3%
if -1.79999999999999993e-293 < t < 9.19999999999999914e-159Initial program 10.1%
associate-*l/10.1%
Simplified10.1%
Taylor expanded in x around inf 40.1%
associate--l+40.1%
unpow240.1%
distribute-lft-out40.1%
unpow240.1%
unpow240.1%
associate-*r/40.1%
mul-1-neg40.1%
+-commutative40.1%
unpow240.1%
associate-*l*40.1%
unpow240.1%
fma-udef40.1%
Simplified40.1%
Taylor expanded in x around inf 62.0%
fma-def62.0%
associate--l+62.0%
unpow262.0%
unpow262.0%
mul-1-neg62.0%
unpow262.0%
unpow262.0%
*-commutative62.0%
Simplified62.0%
if 5e14 < t Initial program 45.5%
associate-/l*45.5%
fma-neg45.5%
remove-double-neg45.5%
fma-neg45.5%
sub-neg45.5%
metadata-eval45.5%
remove-double-neg45.5%
fma-def45.5%
Simplified45.5%
associate-/r/45.6%
Applied egg-rr89.5%
Taylor expanded in l around 0 97.4%
Taylor expanded in x around inf 97.4%
Final simplification87.0%
(FPCore (x l t)
:precision binary64
(if (<= t -8.2e+36)
(+ -1.0 (/ 1.0 x))
(if (<= t 1.75e+15)
(*
t
(/
(sqrt 2.0)
(sqrt
(+
(/ (* l l) x)
(+
(* 2.0 (+ (* t t) (/ (* t t) x)))
(/ (fma (* t 2.0) t (* l l)) x))))))
(+ 1.0 (/ -1.0 x)))))
double code(double x, double l, double t) {
double tmp;
if (t <= -8.2e+36) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 1.75e+15) {
tmp = t * (sqrt(2.0) / sqrt((((l * l) / x) + ((2.0 * ((t * t) + ((t * t) / x))) + (fma((t * 2.0), t, (l * l)) / x)))));
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
function code(x, l, t) tmp = 0.0 if (t <= -8.2e+36) tmp = Float64(-1.0 + Float64(1.0 / x)); elseif (t <= 1.75e+15) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(Float64(l * l) / x) + Float64(Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x))) + 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_] := If[LessEqual[t, -8.2e+36], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.75e+15], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision] + N[(N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 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}
\mathbf{if}\;t \leq -8.2 \cdot 10^{+36}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{+15}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right) + \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 < -8.20000000000000026e36Initial program 33.5%
associate-/l*33.6%
fma-neg33.6%
remove-double-neg33.6%
fma-neg33.6%
sub-neg33.6%
metadata-eval33.6%
remove-double-neg33.6%
fma-def33.6%
Simplified33.6%
associate-/r/33.6%
Applied egg-rr90.8%
Taylor expanded in l around 0 1.6%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt95.7%
Simplified95.7%
if -8.20000000000000026e36 < t < 1.75e15Initial program 33.5%
associate-*l/33.6%
Simplified33.6%
Taylor expanded in x around inf 72.8%
associate--l+72.8%
unpow272.8%
distribute-lft-out72.8%
unpow272.8%
unpow272.8%
associate-*r/72.8%
mul-1-neg72.8%
+-commutative72.8%
unpow272.8%
associate-*l*72.8%
unpow272.8%
fma-udef72.8%
Simplified72.8%
if 1.75e15 < t Initial program 45.5%
associate-/l*45.5%
fma-neg45.5%
remove-double-neg45.5%
fma-neg45.5%
sub-neg45.5%
metadata-eval45.5%
remove-double-neg45.5%
fma-def45.5%
Simplified45.5%
associate-/r/45.6%
Applied egg-rr89.5%
Taylor expanded in l around 0 97.4%
Taylor expanded in x around inf 97.4%
Final simplification85.3%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (* l l) x)))
(if (<= t -1.95e+37)
(+ -1.0 (/ 1.0 x))
(if (<= t 1.25e+17)
(*
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 <= -1.95e+37) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 1.25e+17) {
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 <= (-1.95d+37)) then
tmp = (-1.0d0) + (1.0d0 / x)
else if (t <= 1.25d+17) 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 <= -1.95e+37) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 1.25e+17) {
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 <= -1.95e+37: tmp = -1.0 + (1.0 / x) elif t <= 1.25e+17: 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 <= -1.95e+37) tmp = Float64(-1.0 + Float64(1.0 / x)); elseif (t <= 1.25e+17) 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 <= -1.95e+37) tmp = -1.0 + (1.0 / x); elseif (t <= 1.25e+17) 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, -1.95e+37], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.25e+17], 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 -1.95 \cdot 10^{+37}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{+17}:\\
\;\;\;\;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 < -1.9499999999999999e37Initial program 33.5%
associate-/l*33.6%
fma-neg33.6%
remove-double-neg33.6%
fma-neg33.6%
sub-neg33.6%
metadata-eval33.6%
remove-double-neg33.6%
fma-def33.6%
Simplified33.6%
associate-/r/33.6%
Applied egg-rr90.8%
Taylor expanded in l around 0 1.6%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt95.7%
Simplified95.7%
if -1.9499999999999999e37 < t < 1.25e17Initial program 33.5%
associate-*l/33.6%
Simplified33.6%
Taylor expanded in x around inf 72.8%
associate--l+72.8%
unpow272.8%
distribute-lft-out72.8%
unpow272.8%
unpow272.8%
associate-*r/72.8%
mul-1-neg72.8%
+-commutative72.8%
unpow272.8%
associate-*l*72.8%
unpow272.8%
fma-udef72.8%
Simplified72.8%
Taylor expanded in t around 0 72.7%
associate-*r/72.7%
mul-1-neg72.7%
unpow272.7%
distribute-rgt-neg-in72.7%
Simplified72.7%
if 1.25e17 < t Initial program 45.5%
associate-/l*45.5%
fma-neg45.5%
remove-double-neg45.5%
fma-neg45.5%
sub-neg45.5%
metadata-eval45.5%
remove-double-neg45.5%
fma-def45.5%
Simplified45.5%
associate-/r/45.6%
Applied egg-rr89.5%
Taylor expanded in l around 0 97.4%
Taylor expanded in x around inf 97.4%
Final simplification85.3%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* t (/ (sqrt 2.0) (sqrt (* 2.0 (/ (* l l) x)))))))
(if (<= t -1.22e-147)
(- (sqrt (/ (+ -1.0 x) (+ 1.0 x))))
(if (<= t -3.6e-222)
t_1
(if (<= t -1.5e-237)
-1.0
(if (<= t -1.42e-285)
(* (sqrt 2.0) (* (sqrt (* x 0.5)) (/ t l)))
(if (<= t 3.5e-119) t_1 (+ 1.0 (/ -1.0 x)))))))))
double code(double x, double l, double t) {
double t_1 = t * (sqrt(2.0) / sqrt((2.0 * ((l * l) / x))));
double tmp;
if (t <= -1.22e-147) {
tmp = -sqrt(((-1.0 + x) / (1.0 + x)));
} else if (t <= -3.6e-222) {
tmp = t_1;
} else if (t <= -1.5e-237) {
tmp = -1.0;
} else if (t <= -1.42e-285) {
tmp = sqrt(2.0) * (sqrt((x * 0.5)) * (t / l));
} else if (t <= 3.5e-119) {
tmp = t_1;
} 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 = t * (sqrt(2.0d0) / sqrt((2.0d0 * ((l * l) / x))))
if (t <= (-1.22d-147)) then
tmp = -sqrt((((-1.0d0) + x) / (1.0d0 + x)))
else if (t <= (-3.6d-222)) then
tmp = t_1
else if (t <= (-1.5d-237)) then
tmp = -1.0d0
else if (t <= (-1.42d-285)) then
tmp = sqrt(2.0d0) * (sqrt((x * 0.5d0)) * (t / l))
else if (t <= 3.5d-119) then
tmp = t_1
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 = t * (Math.sqrt(2.0) / Math.sqrt((2.0 * ((l * l) / x))));
double tmp;
if (t <= -1.22e-147) {
tmp = -Math.sqrt(((-1.0 + x) / (1.0 + x)));
} else if (t <= -3.6e-222) {
tmp = t_1;
} else if (t <= -1.5e-237) {
tmp = -1.0;
} else if (t <= -1.42e-285) {
tmp = Math.sqrt(2.0) * (Math.sqrt((x * 0.5)) * (t / l));
} else if (t <= 3.5e-119) {
tmp = t_1;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
def code(x, l, t): t_1 = t * (math.sqrt(2.0) / math.sqrt((2.0 * ((l * l) / x)))) tmp = 0 if t <= -1.22e-147: tmp = -math.sqrt(((-1.0 + x) / (1.0 + x))) elif t <= -3.6e-222: tmp = t_1 elif t <= -1.5e-237: tmp = -1.0 elif t <= -1.42e-285: tmp = math.sqrt(2.0) * (math.sqrt((x * 0.5)) * (t / l)) elif t <= 3.5e-119: tmp = t_1 else: tmp = 1.0 + (-1.0 / x) return tmp
function code(x, l, t) t_1 = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(2.0 * Float64(Float64(l * l) / x))))) tmp = 0.0 if (t <= -1.22e-147) tmp = Float64(-sqrt(Float64(Float64(-1.0 + x) / Float64(1.0 + x)))); elseif (t <= -3.6e-222) tmp = t_1; elseif (t <= -1.5e-237) tmp = -1.0; elseif (t <= -1.42e-285) tmp = Float64(sqrt(2.0) * Float64(sqrt(Float64(x * 0.5)) * Float64(t / l))); elseif (t <= 3.5e-119) tmp = t_1; else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
function tmp_2 = code(x, l, t) t_1 = t * (sqrt(2.0) / sqrt((2.0 * ((l * l) / x)))); tmp = 0.0; if (t <= -1.22e-147) tmp = -sqrt(((-1.0 + x) / (1.0 + x))); elseif (t <= -3.6e-222) tmp = t_1; elseif (t <= -1.5e-237) tmp = -1.0; elseif (t <= -1.42e-285) tmp = sqrt(2.0) * (sqrt((x * 0.5)) * (t / l)); elseif (t <= 3.5e-119) tmp = t_1; else tmp = 1.0 + (-1.0 / x); end tmp_2 = tmp; end
code[x_, l_, t_] := Block[{t$95$1 = N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(2.0 * N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.22e-147], (-N[Sqrt[N[(N[(-1.0 + x), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, -3.6e-222], t$95$1, If[LessEqual[t, -1.5e-237], -1.0, If[LessEqual[t, -1.42e-285], N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[N[(x * 0.5), $MachinePrecision]], $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e-119], t$95$1, N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{\ell \cdot \ell}{x}}}\\
\mathbf{if}\;t \leq -1.22 \cdot 10^{-147}:\\
\;\;\;\;-\sqrt{\frac{-1 + x}{1 + x}}\\
\mathbf{elif}\;t \leq -3.6 \cdot 10^{-222}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.5 \cdot 10^{-237}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq -1.42 \cdot 10^{-285}:\\
\;\;\;\;\sqrt{2} \cdot \left(\sqrt{x \cdot 0.5} \cdot \frac{t}{\ell}\right)\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-119}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -1.21999999999999995e-147Initial program 38.6%
associate-/l*38.7%
fma-neg38.7%
remove-double-neg38.7%
fma-neg38.7%
sub-neg38.7%
metadata-eval38.7%
remove-double-neg38.7%
fma-def38.7%
Simplified38.7%
associate-/r/38.7%
Applied egg-rr77.8%
Taylor expanded in t around -inf 87.0%
mul-1-neg87.0%
+-commutative87.0%
sub-neg87.0%
metadata-eval87.0%
Simplified87.0%
if -1.21999999999999995e-147 < t < -3.59999999999999974e-222 or -1.42e-285 < t < 3.5e-119Initial program 9.0%
associate-*l/9.0%
Simplified9.0%
Taylor expanded in x around inf 59.1%
associate--l+59.1%
unpow259.1%
distribute-lft-out59.1%
unpow259.1%
unpow259.1%
associate-*r/59.1%
mul-1-neg59.1%
+-commutative59.1%
unpow259.1%
associate-*l*59.1%
unpow259.1%
fma-udef59.1%
Simplified59.1%
Taylor expanded in t around 0 55.1%
cancel-sign-sub-inv55.1%
metadata-eval55.1%
distribute-rgt1-in55.1%
metadata-eval55.1%
unpow255.1%
Simplified55.1%
if -3.59999999999999974e-222 < t < -1.50000000000000012e-237Initial program 3.1%
associate-/l*3.1%
fma-neg3.1%
remove-double-neg3.1%
fma-neg3.1%
sub-neg3.1%
metadata-eval3.1%
remove-double-neg3.1%
fma-def3.1%
Simplified3.1%
associate-/r/3.1%
Applied egg-rr51.9%
Taylor expanded in l around 0 1.6%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt85.3%
Simplified85.3%
if -1.50000000000000012e-237 < t < -1.42e-285Initial program 18.2%
associate-*r/18.2%
fma-neg18.2%
sub-neg18.2%
metadata-eval18.2%
+-commutative18.2%
fma-def18.2%
distribute-rgt-neg-in18.2%
Simplified18.2%
Taylor expanded in l around inf 17.8%
Taylor expanded in x around inf 67.5%
*-commutative67.5%
Simplified67.5%
if 3.5e-119 < t Initial program 49.2%
associate-/l*49.2%
fma-neg49.2%
remove-double-neg49.2%
fma-neg49.2%
sub-neg49.2%
metadata-eval49.2%
remove-double-neg49.2%
fma-def49.2%
Simplified49.2%
associate-/r/49.3%
Applied egg-rr79.5%
Taylor expanded in l around 0 93.8%
Taylor expanded in x around inf 93.8%
Final simplification83.8%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* t (/ (sqrt 2.0) (sqrt (* 2.0 (/ (* l l) x)))))))
(if (<= t -8e-148)
(- (sqrt (/ (+ -1.0 x) (+ 1.0 x))))
(if (<= t -8.8e-222)
t_1
(if (<= t -9.5e-238)
-1.0
(if (<= t -3.6e-286)
(* (/ (* t (sqrt 2.0)) l) (sqrt (- (* x 0.5) 0.5)))
(if (<= t 8.8e-119) t_1 (+ 1.0 (/ -1.0 x)))))))))
double code(double x, double l, double t) {
double t_1 = t * (sqrt(2.0) / sqrt((2.0 * ((l * l) / x))));
double tmp;
if (t <= -8e-148) {
tmp = -sqrt(((-1.0 + x) / (1.0 + x)));
} else if (t <= -8.8e-222) {
tmp = t_1;
} else if (t <= -9.5e-238) {
tmp = -1.0;
} else if (t <= -3.6e-286) {
tmp = ((t * sqrt(2.0)) / l) * sqrt(((x * 0.5) - 0.5));
} else if (t <= 8.8e-119) {
tmp = t_1;
} 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 = t * (sqrt(2.0d0) / sqrt((2.0d0 * ((l * l) / x))))
if (t <= (-8d-148)) then
tmp = -sqrt((((-1.0d0) + x) / (1.0d0 + x)))
else if (t <= (-8.8d-222)) then
tmp = t_1
else if (t <= (-9.5d-238)) then
tmp = -1.0d0
else if (t <= (-3.6d-286)) then
tmp = ((t * sqrt(2.0d0)) / l) * sqrt(((x * 0.5d0) - 0.5d0))
else if (t <= 8.8d-119) then
tmp = t_1
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 = t * (Math.sqrt(2.0) / Math.sqrt((2.0 * ((l * l) / x))));
double tmp;
if (t <= -8e-148) {
tmp = -Math.sqrt(((-1.0 + x) / (1.0 + x)));
} else if (t <= -8.8e-222) {
tmp = t_1;
} else if (t <= -9.5e-238) {
tmp = -1.0;
} else if (t <= -3.6e-286) {
tmp = ((t * Math.sqrt(2.0)) / l) * Math.sqrt(((x * 0.5) - 0.5));
} else if (t <= 8.8e-119) {
tmp = t_1;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
def code(x, l, t): t_1 = t * (math.sqrt(2.0) / math.sqrt((2.0 * ((l * l) / x)))) tmp = 0 if t <= -8e-148: tmp = -math.sqrt(((-1.0 + x) / (1.0 + x))) elif t <= -8.8e-222: tmp = t_1 elif t <= -9.5e-238: tmp = -1.0 elif t <= -3.6e-286: tmp = ((t * math.sqrt(2.0)) / l) * math.sqrt(((x * 0.5) - 0.5)) elif t <= 8.8e-119: tmp = t_1 else: tmp = 1.0 + (-1.0 / x) return tmp
function code(x, l, t) t_1 = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(2.0 * Float64(Float64(l * l) / x))))) tmp = 0.0 if (t <= -8e-148) tmp = Float64(-sqrt(Float64(Float64(-1.0 + x) / Float64(1.0 + x)))); elseif (t <= -8.8e-222) tmp = t_1; elseif (t <= -9.5e-238) tmp = -1.0; elseif (t <= -3.6e-286) tmp = Float64(Float64(Float64(t * sqrt(2.0)) / l) * sqrt(Float64(Float64(x * 0.5) - 0.5))); elseif (t <= 8.8e-119) tmp = t_1; else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
function tmp_2 = code(x, l, t) t_1 = t * (sqrt(2.0) / sqrt((2.0 * ((l * l) / x)))); tmp = 0.0; if (t <= -8e-148) tmp = -sqrt(((-1.0 + x) / (1.0 + x))); elseif (t <= -8.8e-222) tmp = t_1; elseif (t <= -9.5e-238) tmp = -1.0; elseif (t <= -3.6e-286) tmp = ((t * sqrt(2.0)) / l) * sqrt(((x * 0.5) - 0.5)); elseif (t <= 8.8e-119) tmp = t_1; else tmp = 1.0 + (-1.0 / x); end tmp_2 = tmp; end
code[x_, l_, t_] := Block[{t$95$1 = N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(2.0 * N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -8e-148], (-N[Sqrt[N[(N[(-1.0 + x), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, -8.8e-222], t$95$1, If[LessEqual[t, -9.5e-238], -1.0, If[LessEqual[t, -3.6e-286], N[(N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[Sqrt[N[(N[(x * 0.5), $MachinePrecision] - 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.8e-119], t$95$1, N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \frac{\ell \cdot \ell}{x}}}\\
\mathbf{if}\;t \leq -8 \cdot 10^{-148}:\\
\;\;\;\;-\sqrt{\frac{-1 + x}{1 + x}}\\
\mathbf{elif}\;t \leq -8.8 \cdot 10^{-222}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -9.5 \cdot 10^{-238}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq -3.6 \cdot 10^{-286}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\ell} \cdot \sqrt{x \cdot 0.5 - 0.5}\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{-119}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -7.99999999999999949e-148Initial program 38.6%
associate-/l*38.7%
fma-neg38.7%
remove-double-neg38.7%
fma-neg38.7%
sub-neg38.7%
metadata-eval38.7%
remove-double-neg38.7%
fma-def38.7%
Simplified38.7%
associate-/r/38.7%
Applied egg-rr77.8%
Taylor expanded in t around -inf 87.0%
mul-1-neg87.0%
+-commutative87.0%
sub-neg87.0%
metadata-eval87.0%
Simplified87.0%
if -7.99999999999999949e-148 < t < -8.8000000000000001e-222 or -3.60000000000000013e-286 < t < 8.8000000000000002e-119Initial program 9.0%
associate-*l/9.0%
Simplified9.0%
Taylor expanded in x around inf 59.1%
associate--l+59.1%
unpow259.1%
distribute-lft-out59.1%
unpow259.1%
unpow259.1%
associate-*r/59.1%
mul-1-neg59.1%
+-commutative59.1%
unpow259.1%
associate-*l*59.1%
unpow259.1%
fma-udef59.1%
Simplified59.1%
Taylor expanded in t around 0 55.1%
cancel-sign-sub-inv55.1%
metadata-eval55.1%
distribute-rgt1-in55.1%
metadata-eval55.1%
unpow255.1%
Simplified55.1%
if -8.8000000000000001e-222 < t < -9.50000000000000059e-238Initial program 3.1%
associate-/l*3.1%
fma-neg3.1%
remove-double-neg3.1%
fma-neg3.1%
sub-neg3.1%
metadata-eval3.1%
remove-double-neg3.1%
fma-def3.1%
Simplified3.1%
associate-/r/3.1%
Applied egg-rr51.9%
Taylor expanded in l around 0 1.6%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt85.3%
Simplified85.3%
if -9.50000000000000059e-238 < t < -3.60000000000000013e-286Initial program 18.2%
associate-*r/18.2%
fma-neg18.2%
sub-neg18.2%
metadata-eval18.2%
+-commutative18.2%
fma-def18.2%
distribute-rgt-neg-in18.2%
Simplified18.2%
Taylor expanded in l around inf 17.8%
Taylor expanded in x around 0 67.5%
Taylor expanded in t around 0 67.7%
if 8.8000000000000002e-119 < t Initial program 49.2%
associate-/l*49.2%
fma-neg49.2%
remove-double-neg49.2%
fma-neg49.2%
sub-neg49.2%
metadata-eval49.2%
remove-double-neg49.2%
fma-def49.2%
Simplified49.2%
associate-/r/49.3%
Applied egg-rr79.5%
Taylor expanded in l around 0 93.8%
Taylor expanded in x around inf 93.8%
Final simplification83.8%
(FPCore (x l t) :precision binary64 (let* ((t_1 (sqrt (/ (+ -1.0 x) (+ 1.0 x))))) (if (<= t -2e-310) (- t_1) t_1)))
double code(double x, double l, double t) {
double t_1 = sqrt(((-1.0 + x) / (1.0 + x)));
double tmp;
if (t <= -2e-310) {
tmp = -t_1;
} 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((((-1.0d0) + x) / (1.0d0 + x)))
if (t <= (-2d-310)) then
tmp = -t_1
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(((-1.0 + x) / (1.0 + x)));
double tmp;
if (t <= -2e-310) {
tmp = -t_1;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, l, t): t_1 = math.sqrt(((-1.0 + x) / (1.0 + x))) tmp = 0 if t <= -2e-310: tmp = -t_1 else: tmp = t_1 return tmp
function code(x, l, t) t_1 = sqrt(Float64(Float64(-1.0 + x) / Float64(1.0 + x))) tmp = 0.0 if (t <= -2e-310) tmp = Float64(-t_1); else tmp = t_1; end return tmp end
function tmp_2 = code(x, l, t) t_1 = sqrt(((-1.0 + x) / (1.0 + x))); tmp = 0.0; if (t <= -2e-310) tmp = -t_1; else tmp = t_1; end tmp_2 = tmp; end
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(-1.0 + x), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -2e-310], (-t$95$1), t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\frac{-1 + x}{1 + x}}\\
\mathbf{if}\;t \leq -2 \cdot 10^{-310}:\\
\;\;\;\;-t_1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.999999999999994e-310Initial program 32.0%
associate-/l*32.0%
fma-neg32.0%
remove-double-neg32.0%
fma-neg32.0%
sub-neg32.0%
metadata-eval32.0%
remove-double-neg32.0%
fma-def32.0%
Simplified32.0%
associate-/r/32.0%
Applied egg-rr68.4%
Taylor expanded in t around -inf 75.5%
mul-1-neg75.5%
+-commutative75.5%
sub-neg75.5%
metadata-eval75.5%
Simplified75.5%
if -1.999999999999994e-310 < t Initial program 41.6%
associate-/l*41.6%
fma-neg41.6%
remove-double-neg41.6%
fma-neg41.6%
sub-neg41.6%
metadata-eval41.6%
remove-double-neg41.6%
fma-def41.6%
Simplified41.6%
associate-/r/41.7%
Applied egg-rr70.3%
Taylor expanded in l around 0 82.9%
Final simplification79.2%
(FPCore (x l t) :precision binary64 (if (<= t -1.8e-293) (+ -1.0 (/ 1.0 x)) (sqrt (/ (+ -1.0 x) (+ 1.0 x)))))
double code(double x, double l, double t) {
double tmp;
if (t <= -1.8e-293) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = sqrt(((-1.0 + 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-293)) then
tmp = (-1.0d0) + (1.0d0 / x)
else
tmp = sqrt((((-1.0d0) + 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-293) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = Math.sqrt(((-1.0 + x) / (1.0 + x)));
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -1.8e-293: tmp = -1.0 + (1.0 / x) else: tmp = math.sqrt(((-1.0 + x) / (1.0 + x))) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -1.8e-293) tmp = Float64(-1.0 + Float64(1.0 / x)); else tmp = sqrt(Float64(Float64(-1.0 + x) / Float64(1.0 + x))); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -1.8e-293) tmp = -1.0 + (1.0 / x); else tmp = sqrt(((-1.0 + x) / (1.0 + x))); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -1.8e-293], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(-1.0 + x), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{-293}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{-1 + x}{1 + x}}\\
\end{array}
\end{array}
if t < -1.79999999999999993e-293Initial program 31.4%
associate-/l*31.5%
fma-neg31.5%
remove-double-neg31.5%
fma-neg31.5%
sub-neg31.5%
metadata-eval31.5%
remove-double-neg31.5%
fma-def31.5%
Simplified31.5%
associate-/r/31.5%
Applied egg-rr68.2%
Taylor expanded in l around 0 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt75.6%
Simplified75.6%
if -1.79999999999999993e-293 < t Initial program 42.1%
associate-/l*42.0%
fma-neg42.0%
remove-double-neg42.0%
fma-neg42.0%
sub-neg42.0%
metadata-eval42.0%
remove-double-neg42.0%
fma-def42.0%
Simplified42.0%
associate-/r/42.1%
Applied egg-rr70.5%
Taylor expanded in l around 0 82.3%
Final simplification79.0%
(FPCore (x l t) :precision binary64 (if (<= t -1.8e-293) (+ -1.0 (/ 1.0 x)) 1.0))
double code(double x, double l, double t) {
double tmp;
if (t <= -1.8e-293) {
tmp = -1.0 + (1.0 / x);
} 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 <= (-1.8d-293)) then
tmp = (-1.0d0) + (1.0d0 / x)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= -1.8e-293) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -1.8e-293: tmp = -1.0 + (1.0 / x) else: tmp = 1.0 return tmp
function code(x, l, t) tmp = 0.0 if (t <= -1.8e-293) tmp = Float64(-1.0 + Float64(1.0 / x)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -1.8e-293) tmp = -1.0 + (1.0 / x); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -1.8e-293], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{-293}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -1.79999999999999993e-293Initial program 31.4%
associate-/l*31.5%
fma-neg31.5%
remove-double-neg31.5%
fma-neg31.5%
sub-neg31.5%
metadata-eval31.5%
remove-double-neg31.5%
fma-def31.5%
Simplified31.5%
associate-/r/31.5%
Applied egg-rr68.2%
Taylor expanded in l around 0 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt75.6%
Simplified75.6%
if -1.79999999999999993e-293 < t Initial program 42.1%
associate-/l*42.0%
fma-neg42.0%
remove-double-neg42.0%
fma-neg42.0%
sub-neg42.0%
metadata-eval42.0%
remove-double-neg42.0%
fma-def42.0%
Simplified42.0%
associate-/r/42.1%
Applied egg-rr70.5%
Taylor expanded in l around 0 82.3%
Taylor expanded in x around inf 81.8%
Final simplification78.7%
(FPCore (x l t) :precision binary64 (if (<= t -1.8e-293) (+ -1.0 (/ 1.0 x)) (+ 1.0 (/ -1.0 x))))
double code(double x, double l, double t) {
double tmp;
if (t <= -1.8e-293) {
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 <= (-1.8d-293)) 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 <= -1.8e-293) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -1.8e-293: 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 <= -1.8e-293) 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 <= -1.8e-293) 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, -1.8e-293], 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.8 \cdot 10^{-293}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -1.79999999999999993e-293Initial program 31.4%
associate-/l*31.5%
fma-neg31.5%
remove-double-neg31.5%
fma-neg31.5%
sub-neg31.5%
metadata-eval31.5%
remove-double-neg31.5%
fma-def31.5%
Simplified31.5%
associate-/r/31.5%
Applied egg-rr68.2%
Taylor expanded in l around 0 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt75.6%
Simplified75.6%
if -1.79999999999999993e-293 < t Initial program 42.1%
associate-/l*42.0%
fma-neg42.0%
remove-double-neg42.0%
fma-neg42.0%
sub-neg42.0%
metadata-eval42.0%
remove-double-neg42.0%
fma-def42.0%
Simplified42.0%
associate-/r/42.1%
Applied egg-rr70.5%
Taylor expanded in l around 0 82.3%
Taylor expanded in x around inf 82.3%
Final simplification79.0%
(FPCore (x l t) :precision binary64 (if (<= t -2e-310) -1.0 1.0))
double code(double x, double l, double t) {
double tmp;
if (t <= -2e-310) {
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 <= (-2d-310)) 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 <= -2e-310) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -2e-310: tmp = -1.0 else: tmp = 1.0 return tmp
function code(x, l, t) tmp = 0.0 if (t <= -2e-310) tmp = -1.0; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -2e-310) tmp = -1.0; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -2e-310], -1.0, 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{-310}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -1.999999999999994e-310Initial program 32.0%
associate-/l*32.0%
fma-neg32.0%
remove-double-neg32.0%
fma-neg32.0%
sub-neg32.0%
metadata-eval32.0%
remove-double-neg32.0%
fma-def32.0%
Simplified32.0%
associate-/r/32.0%
Applied egg-rr68.4%
Taylor expanded in l around 0 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt74.5%
Simplified74.5%
if -1.999999999999994e-310 < t Initial program 41.6%
associate-/l*41.6%
fma-neg41.6%
remove-double-neg41.6%
fma-neg41.6%
sub-neg41.6%
metadata-eval41.6%
remove-double-neg41.6%
fma-def41.6%
Simplified41.6%
associate-/r/41.7%
Applied egg-rr70.3%
Taylor expanded in l around 0 82.9%
Taylor expanded in x around inf 82.4%
Final simplification78.5%
(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 36.8%
associate-/l*36.8%
fma-neg36.8%
remove-double-neg36.8%
fma-neg36.8%
sub-neg36.8%
metadata-eval36.8%
remove-double-neg36.8%
fma-def36.8%
Simplified36.8%
associate-/r/36.9%
Applied egg-rr69.3%
Taylor expanded in l around 0 42.4%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt38.1%
Simplified38.1%
Final simplification38.1%
herbie shell --seed 2023187
(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)))))