
(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 12 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
(if (<= t -2.25e+14)
(/ (sqrt 2.0) (* (sqrt (/ (+ x 1.0) (+ x -1.0))) (- (sqrt 2.0))))
(if (<= t 1.8e+106)
(*
t
(/
(sqrt 2.0)
(sqrt
(+
(* l (/ l x))
(- (* 2.0 (fma t t (/ t (/ x t)))) (/ l (/ x (- l))))))))
(exp (+ (/ -1.0 x) (/ -0.3333333333333333 (pow x 3.0)))))))
double code(double x, double l, double t) {
double tmp;
if (t <= -2.25e+14) {
tmp = sqrt(2.0) / (sqrt(((x + 1.0) / (x + -1.0))) * -sqrt(2.0));
} else if (t <= 1.8e+106) {
tmp = t * (sqrt(2.0) / sqrt(((l * (l / x)) + ((2.0 * fma(t, t, (t / (x / t)))) - (l / (x / -l))))));
} else {
tmp = exp(((-1.0 / x) + (-0.3333333333333333 / pow(x, 3.0))));
}
return tmp;
}
function code(x, l, t) tmp = 0.0 if (t <= -2.25e+14) tmp = Float64(sqrt(2.0) / Float64(sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0))) * Float64(-sqrt(2.0)))); elseif (t <= 1.8e+106) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(l * Float64(l / x)) + Float64(Float64(2.0 * fma(t, t, Float64(t / Float64(x / t)))) - Float64(l / Float64(x / Float64(-l)))))))); else tmp = exp(Float64(Float64(-1.0 / x) + Float64(-0.3333333333333333 / (x ^ 3.0)))); end return tmp end
code[x_, l_, t_] := If[LessEqual[t, -2.25e+14], N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.8e+106], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(t * t + N[(t / N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l / N[(x / (-l)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[(-1.0 / x), $MachinePrecision] + N[(-0.3333333333333333 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.25 \cdot 10^{+14}:\\
\;\;\;\;\frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x + -1}} \cdot \left(-\sqrt{2}\right)}\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{+106}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\ell \cdot \frac{\ell}{x} + \left(2 \cdot \mathsf{fma}\left(t, t, \frac{t}{\frac{x}{t}}\right) - \frac{\ell}{\frac{x}{-\ell}}\right)}}\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{-1}{x} + \frac{-0.3333333333333333}{{x}^{3}}}\\
\end{array}
\end{array}
if t < -2.25e14Initial program 39.0%
associate-/l*39.0%
fma-neg39.0%
remove-double-neg39.0%
fma-neg39.0%
sub-neg39.0%
metadata-eval39.0%
remove-double-neg39.0%
fma-def39.0%
Simplified39.0%
Taylor expanded in t around -inf 96.5%
mul-1-neg96.5%
distribute-rgt-neg-in96.5%
+-commutative96.5%
sub-neg96.5%
metadata-eval96.5%
+-commutative96.5%
Simplified96.5%
if -2.25e14 < t < 1.8e106Initial program 38.5%
associate-*l/38.4%
Simplified38.4%
Taylor expanded in x around inf 75.9%
associate--l+75.9%
unpow275.9%
distribute-lft-out75.9%
unpow275.9%
unpow275.9%
associate-*r/75.9%
mul-1-neg75.9%
unpow275.9%
+-commutative75.9%
unpow275.9%
fma-udef75.9%
Simplified75.9%
Taylor expanded in t around 0 75.4%
associate-*r/75.4%
neg-mul-175.4%
unpow275.4%
distribute-rgt-neg-in75.4%
Simplified75.4%
*-un-lft-identity75.4%
associate-/l*75.4%
+-commutative75.4%
Applied egg-rr75.4%
*-lft-identity75.4%
associate-/r/75.4%
fma-def75.4%
associate-/l*75.4%
associate-/l*80.6%
Simplified80.6%
if 1.8e106 < t Initial program 21.7%
associate-*l/21.7%
Simplified21.7%
Applied egg-rr5.9%
Taylor expanded in t around inf 98.4%
Taylor expanded in x around inf 98.4%
+-commutative98.4%
distribute-neg-in98.4%
distribute-neg-frac98.4%
metadata-eval98.4%
associate-*r/98.4%
metadata-eval98.4%
distribute-neg-frac98.4%
metadata-eval98.4%
Simplified98.4%
Final simplification89.5%
(FPCore (x l t)
:precision binary64
(if (<= t -660000000000.0)
(/ (sqrt 2.0) (* (sqrt (/ (+ x 1.0) (+ x -1.0))) (- (sqrt 2.0))))
(if (<= t 1e+106)
(*
t
(sqrt
(/ 2.0 (fma (/ l x) l (fma 2.0 (* t (+ t (/ t x))) (* l (/ l x)))))))
(exp (+ (/ -1.0 x) (/ -0.3333333333333333 (pow x 3.0)))))))
double code(double x, double l, double t) {
double tmp;
if (t <= -660000000000.0) {
tmp = sqrt(2.0) / (sqrt(((x + 1.0) / (x + -1.0))) * -sqrt(2.0));
} else if (t <= 1e+106) {
tmp = t * sqrt((2.0 / fma((l / x), l, fma(2.0, (t * (t + (t / x))), (l * (l / x))))));
} else {
tmp = exp(((-1.0 / x) + (-0.3333333333333333 / pow(x, 3.0))));
}
return tmp;
}
function code(x, l, t) tmp = 0.0 if (t <= -660000000000.0) tmp = Float64(sqrt(2.0) / Float64(sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0))) * Float64(-sqrt(2.0)))); elseif (t <= 1e+106) tmp = Float64(t * sqrt(Float64(2.0 / fma(Float64(l / x), l, fma(2.0, Float64(t * Float64(t + Float64(t / x))), Float64(l * Float64(l / x))))))); else tmp = exp(Float64(Float64(-1.0 / x) + Float64(-0.3333333333333333 / (x ^ 3.0)))); end return tmp end
code[x_, l_, t_] := If[LessEqual[t, -660000000000.0], N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e+106], N[(t * N[Sqrt[N[(2.0 / N[(N[(l / x), $MachinePrecision] * l + N[(2.0 * N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[(-1.0 / x), $MachinePrecision] + N[(-0.3333333333333333 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -660000000000:\\
\;\;\;\;\frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x + -1}} \cdot \left(-\sqrt{2}\right)}\\
\mathbf{elif}\;t \leq 10^{+106}:\\
\;\;\;\;t \cdot \sqrt{\frac{2}{\mathsf{fma}\left(\frac{\ell}{x}, \ell, \mathsf{fma}\left(2, t \cdot \left(t + \frac{t}{x}\right), \ell \cdot \frac{\ell}{x}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{-1}{x} + \frac{-0.3333333333333333}{{x}^{3}}}\\
\end{array}
\end{array}
if t < -6.6e11Initial program 39.0%
associate-/l*39.0%
fma-neg39.0%
remove-double-neg39.0%
fma-neg39.0%
sub-neg39.0%
metadata-eval39.0%
remove-double-neg39.0%
fma-def39.0%
Simplified39.0%
Taylor expanded in t around -inf 96.5%
mul-1-neg96.5%
distribute-rgt-neg-in96.5%
+-commutative96.5%
sub-neg96.5%
metadata-eval96.5%
+-commutative96.5%
Simplified96.5%
if -6.6e11 < t < 1.00000000000000009e106Initial program 38.5%
associate-*l/38.4%
Simplified38.4%
Taylor expanded in x around inf 75.9%
associate--l+75.9%
unpow275.9%
distribute-lft-out75.9%
unpow275.9%
unpow275.9%
associate-*r/75.9%
mul-1-neg75.9%
unpow275.9%
+-commutative75.9%
unpow275.9%
fma-udef75.9%
Simplified75.9%
Taylor expanded in t around 0 75.4%
associate-*r/75.4%
neg-mul-175.4%
unpow275.4%
distribute-rgt-neg-in75.4%
Simplified75.4%
*-un-lft-identity75.4%
associate-/l*75.4%
+-commutative75.4%
Applied egg-rr75.4%
*-lft-identity75.4%
associate-/r/75.4%
fma-def75.4%
associate-/l*75.4%
associate-/l*80.6%
Simplified80.6%
*-un-lft-identity80.6%
sqrt-undiv79.2%
fma-def79.1%
associate-/r/79.1%
associate-/r/79.1%
Applied egg-rr79.1%
*-lft-identity79.1%
fma-neg79.1%
fma-udef79.1%
distribute-rgt-out79.1%
distribute-rgt-neg-out79.1%
remove-double-neg79.1%
Simplified79.1%
if 1.00000000000000009e106 < t Initial program 21.7%
associate-*l/21.7%
Simplified21.7%
Applied egg-rr5.9%
Taylor expanded in t around inf 98.4%
Taylor expanded in x around inf 98.4%
+-commutative98.4%
distribute-neg-in98.4%
distribute-neg-frac98.4%
metadata-eval98.4%
associate-*r/98.4%
metadata-eval98.4%
distribute-neg-frac98.4%
metadata-eval98.4%
Simplified98.4%
Final simplification88.8%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (* l l) x)))
(if (<= t -1e-10)
(/ (sqrt 2.0) (* (sqrt (/ (+ x 1.0) (+ x -1.0))) (- (sqrt 2.0))))
(if (<= t -3.9e-156)
(*
t
(/
(sqrt 2.0)
(sqrt (+ t_1 (+ t_1 (* 2.0 (+ (* t t) (/ (* t t) x))))))))
(if (<= t -2.6e-195)
(* t (/ (sqrt 2.0) (* t (- (sqrt (+ (/ 2.0 x) (+ 2.0 (/ 2.0 x))))))))
(if (<= t 9e-176)
(* t (/ (sqrt x) l))
(exp (+ (/ -1.0 x) (/ -0.3333333333333333 (pow x 3.0))))))))))
double code(double x, double l, double t) {
double t_1 = (l * l) / x;
double tmp;
if (t <= -1e-10) {
tmp = sqrt(2.0) / (sqrt(((x + 1.0) / (x + -1.0))) * -sqrt(2.0));
} else if (t <= -3.9e-156) {
tmp = t * (sqrt(2.0) / sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else if (t <= -2.6e-195) {
tmp = t * (sqrt(2.0) / (t * -sqrt(((2.0 / x) + (2.0 + (2.0 / x))))));
} else if (t <= 9e-176) {
tmp = t * (sqrt(x) / l);
} else {
tmp = exp(((-1.0 / x) + (-0.3333333333333333 / pow(x, 3.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) :: t_1
real(8) :: tmp
t_1 = (l * l) / x
if (t <= (-1d-10)) then
tmp = sqrt(2.0d0) / (sqrt(((x + 1.0d0) / (x + (-1.0d0)))) * -sqrt(2.0d0))
else if (t <= (-3.9d-156)) then
tmp = t * (sqrt(2.0d0) / sqrt((t_1 + (t_1 + (2.0d0 * ((t * t) + ((t * t) / x)))))))
else if (t <= (-2.6d-195)) then
tmp = t * (sqrt(2.0d0) / (t * -sqrt(((2.0d0 / x) + (2.0d0 + (2.0d0 / x))))))
else if (t <= 9d-176) then
tmp = t * (sqrt(x) / l)
else
tmp = exp((((-1.0d0) / x) + ((-0.3333333333333333d0) / (x ** 3.0d0))))
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 <= -1e-10) {
tmp = Math.sqrt(2.0) / (Math.sqrt(((x + 1.0) / (x + -1.0))) * -Math.sqrt(2.0));
} else if (t <= -3.9e-156) {
tmp = t * (Math.sqrt(2.0) / Math.sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else if (t <= -2.6e-195) {
tmp = t * (Math.sqrt(2.0) / (t * -Math.sqrt(((2.0 / x) + (2.0 + (2.0 / x))))));
} else if (t <= 9e-176) {
tmp = t * (Math.sqrt(x) / l);
} else {
tmp = Math.exp(((-1.0 / x) + (-0.3333333333333333 / Math.pow(x, 3.0))));
}
return tmp;
}
def code(x, l, t): t_1 = (l * l) / x tmp = 0 if t <= -1e-10: tmp = math.sqrt(2.0) / (math.sqrt(((x + 1.0) / (x + -1.0))) * -math.sqrt(2.0)) elif t <= -3.9e-156: tmp = t * (math.sqrt(2.0) / math.sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x))))))) elif t <= -2.6e-195: tmp = t * (math.sqrt(2.0) / (t * -math.sqrt(((2.0 / x) + (2.0 + (2.0 / x)))))) elif t <= 9e-176: tmp = t * (math.sqrt(x) / l) else: tmp = math.exp(((-1.0 / x) + (-0.3333333333333333 / math.pow(x, 3.0)))) return tmp
function code(x, l, t) t_1 = Float64(Float64(l * l) / x) tmp = 0.0 if (t <= -1e-10) tmp = Float64(sqrt(2.0) / Float64(sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0))) * Float64(-sqrt(2.0)))); elseif (t <= -3.9e-156) 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 <= -2.6e-195) tmp = Float64(t * Float64(sqrt(2.0) / Float64(t * Float64(-sqrt(Float64(Float64(2.0 / x) + Float64(2.0 + Float64(2.0 / x)))))))); elseif (t <= 9e-176) tmp = Float64(t * Float64(sqrt(x) / l)); else tmp = exp(Float64(Float64(-1.0 / x) + Float64(-0.3333333333333333 / (x ^ 3.0)))); end return tmp end
function tmp_2 = code(x, l, t) t_1 = (l * l) / x; tmp = 0.0; if (t <= -1e-10) tmp = sqrt(2.0) / (sqrt(((x + 1.0) / (x + -1.0))) * -sqrt(2.0)); elseif (t <= -3.9e-156) tmp = t * (sqrt(2.0) / sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x))))))); elseif (t <= -2.6e-195) tmp = t * (sqrt(2.0) / (t * -sqrt(((2.0 / x) + (2.0 + (2.0 / x)))))); elseif (t <= 9e-176) tmp = t * (sqrt(x) / l); else tmp = exp(((-1.0 / x) + (-0.3333333333333333 / (x ^ 3.0)))); end tmp_2 = tmp; end
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t, -1e-10], N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.9e-156], 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, -2.6e-195], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(t * (-N[Sqrt[N[(N[(2.0 / x), $MachinePrecision] + N[(2.0 + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9e-176], N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[(-1.0 / x), $MachinePrecision] + N[(-0.3333333333333333 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{x}\\
\mathbf{if}\;t \leq -1 \cdot 10^{-10}:\\
\;\;\;\;\frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x + -1}} \cdot \left(-\sqrt{2}\right)}\\
\mathbf{elif}\;t \leq -3.9 \cdot 10^{-156}:\\
\;\;\;\;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 -2.6 \cdot 10^{-195}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{t \cdot \left(-\sqrt{\frac{2}{x} + \left(2 + \frac{2}{x}\right)}\right)}\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-176}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{-1}{x} + \frac{-0.3333333333333333}{{x}^{3}}}\\
\end{array}
\end{array}
if t < -1.00000000000000004e-10Initial program 41.3%
associate-/l*41.3%
fma-neg41.3%
remove-double-neg41.3%
fma-neg41.3%
sub-neg41.3%
metadata-eval41.3%
remove-double-neg41.3%
fma-def41.3%
Simplified41.3%
Taylor expanded in t around -inf 95.6%
mul-1-neg95.6%
distribute-rgt-neg-in95.6%
+-commutative95.6%
sub-neg95.6%
metadata-eval95.6%
+-commutative95.6%
Simplified95.6%
if -1.00000000000000004e-10 < t < -3.9000000000000001e-156Initial program 46.8%
associate-*l/46.7%
Simplified46.7%
Taylor expanded in x around inf 84.5%
associate--l+84.5%
unpow284.5%
distribute-lft-out84.5%
unpow284.5%
unpow284.5%
associate-*r/84.5%
mul-1-neg84.5%
unpow284.5%
+-commutative84.5%
unpow284.5%
fma-udef84.5%
Simplified84.5%
Taylor expanded in t around 0 84.5%
associate-*r/84.5%
neg-mul-184.5%
unpow284.5%
distribute-rgt-neg-in84.5%
Simplified84.5%
if -3.9000000000000001e-156 < t < -2.6000000000000002e-195Initial program 12.0%
associate-*l/12.0%
Simplified12.0%
Taylor expanded in x around inf 33.8%
associate--l+33.8%
unpow233.8%
distribute-lft-out33.8%
unpow233.8%
unpow233.8%
associate-*r/33.8%
mul-1-neg33.8%
unpow233.8%
+-commutative33.8%
unpow233.8%
fma-udef33.8%
Simplified33.8%
Taylor expanded in t around -inf 65.1%
mul-1-neg65.1%
*-commutative65.1%
distribute-rgt-neg-in65.1%
distribute-lft-in65.1%
metadata-eval65.1%
associate-*r/65.1%
metadata-eval65.1%
associate-*r/65.1%
metadata-eval65.1%
Simplified65.1%
if -2.6000000000000002e-195 < t < 9e-176Initial program 1.6%
associate-*l/1.6%
Simplified1.6%
Taylor expanded in x around inf 63.8%
associate--l+63.8%
unpow263.8%
distribute-lft-out63.8%
unpow263.8%
unpow263.8%
associate-*r/63.8%
mul-1-neg63.8%
unpow263.8%
+-commutative63.8%
unpow263.8%
fma-udef63.8%
Simplified63.8%
Taylor expanded in l around inf 60.3%
Taylor expanded in l around 0 60.3%
associate-*l/60.3%
*-lft-identity60.3%
Simplified60.3%
if 9e-176 < t Initial program 40.5%
associate-*l/40.5%
Simplified40.5%
Applied egg-rr25.2%
Taylor expanded in t around inf 91.5%
Taylor expanded in x around inf 91.5%
+-commutative91.5%
distribute-neg-in91.5%
distribute-neg-frac91.5%
metadata-eval91.5%
associate-*r/91.5%
metadata-eval91.5%
distribute-neg-frac91.5%
metadata-eval91.5%
Simplified91.5%
Final simplification86.9%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (* l l) x)))
(if (<= t -1350000000.0)
(* (sqrt (* 0.5 (/ (+ x -1.0) (+ x 1.0)))) (- (sqrt 2.0)))
(if (<= t -3.9e-156)
(*
t
(/
(sqrt 2.0)
(sqrt (+ t_1 (+ t_1 (* 2.0 (+ (* t t) (/ (* t t) x))))))))
(if (<= t -9.2e-194)
(* t (/ (sqrt 2.0) (* t (- (sqrt (+ (/ 2.0 x) (+ 2.0 (/ 2.0 x))))))))
(if (<= t 1.2e-176)
(* t (/ (sqrt x) l))
(exp (+ (/ -1.0 x) (/ -0.3333333333333333 (pow x 3.0))))))))))
double code(double x, double l, double t) {
double t_1 = (l * l) / x;
double tmp;
if (t <= -1350000000.0) {
tmp = sqrt((0.5 * ((x + -1.0) / (x + 1.0)))) * -sqrt(2.0);
} else if (t <= -3.9e-156) {
tmp = t * (sqrt(2.0) / sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else if (t <= -9.2e-194) {
tmp = t * (sqrt(2.0) / (t * -sqrt(((2.0 / x) + (2.0 + (2.0 / x))))));
} else if (t <= 1.2e-176) {
tmp = t * (sqrt(x) / l);
} else {
tmp = exp(((-1.0 / x) + (-0.3333333333333333 / pow(x, 3.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) :: t_1
real(8) :: tmp
t_1 = (l * l) / x
if (t <= (-1350000000.0d0)) then
tmp = sqrt((0.5d0 * ((x + (-1.0d0)) / (x + 1.0d0)))) * -sqrt(2.0d0)
else if (t <= (-3.9d-156)) then
tmp = t * (sqrt(2.0d0) / sqrt((t_1 + (t_1 + (2.0d0 * ((t * t) + ((t * t) / x)))))))
else if (t <= (-9.2d-194)) then
tmp = t * (sqrt(2.0d0) / (t * -sqrt(((2.0d0 / x) + (2.0d0 + (2.0d0 / x))))))
else if (t <= 1.2d-176) then
tmp = t * (sqrt(x) / l)
else
tmp = exp((((-1.0d0) / x) + ((-0.3333333333333333d0) / (x ** 3.0d0))))
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 <= -1350000000.0) {
tmp = Math.sqrt((0.5 * ((x + -1.0) / (x + 1.0)))) * -Math.sqrt(2.0);
} else if (t <= -3.9e-156) {
tmp = t * (Math.sqrt(2.0) / Math.sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else if (t <= -9.2e-194) {
tmp = t * (Math.sqrt(2.0) / (t * -Math.sqrt(((2.0 / x) + (2.0 + (2.0 / x))))));
} else if (t <= 1.2e-176) {
tmp = t * (Math.sqrt(x) / l);
} else {
tmp = Math.exp(((-1.0 / x) + (-0.3333333333333333 / Math.pow(x, 3.0))));
}
return tmp;
}
def code(x, l, t): t_1 = (l * l) / x tmp = 0 if t <= -1350000000.0: tmp = math.sqrt((0.5 * ((x + -1.0) / (x + 1.0)))) * -math.sqrt(2.0) elif t <= -3.9e-156: tmp = t * (math.sqrt(2.0) / math.sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x))))))) elif t <= -9.2e-194: tmp = t * (math.sqrt(2.0) / (t * -math.sqrt(((2.0 / x) + (2.0 + (2.0 / x)))))) elif t <= 1.2e-176: tmp = t * (math.sqrt(x) / l) else: tmp = math.exp(((-1.0 / x) + (-0.3333333333333333 / math.pow(x, 3.0)))) return tmp
function code(x, l, t) t_1 = Float64(Float64(l * l) / x) tmp = 0.0 if (t <= -1350000000.0) tmp = Float64(sqrt(Float64(0.5 * Float64(Float64(x + -1.0) / Float64(x + 1.0)))) * Float64(-sqrt(2.0))); elseif (t <= -3.9e-156) 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 <= -9.2e-194) tmp = Float64(t * Float64(sqrt(2.0) / Float64(t * Float64(-sqrt(Float64(Float64(2.0 / x) + Float64(2.0 + Float64(2.0 / x)))))))); elseif (t <= 1.2e-176) tmp = Float64(t * Float64(sqrt(x) / l)); else tmp = exp(Float64(Float64(-1.0 / x) + Float64(-0.3333333333333333 / (x ^ 3.0)))); end return tmp end
function tmp_2 = code(x, l, t) t_1 = (l * l) / x; tmp = 0.0; if (t <= -1350000000.0) tmp = sqrt((0.5 * ((x + -1.0) / (x + 1.0)))) * -sqrt(2.0); elseif (t <= -3.9e-156) tmp = t * (sqrt(2.0) / sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x))))))); elseif (t <= -9.2e-194) tmp = t * (sqrt(2.0) / (t * -sqrt(((2.0 / x) + (2.0 + (2.0 / x)))))); elseif (t <= 1.2e-176) tmp = t * (sqrt(x) / l); else tmp = exp(((-1.0 / x) + (-0.3333333333333333 / (x ^ 3.0)))); end tmp_2 = tmp; end
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t, -1350000000.0], N[(N[Sqrt[N[(0.5 * N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision], If[LessEqual[t, -3.9e-156], 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, -9.2e-194], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(t * (-N[Sqrt[N[(N[(2.0 / x), $MachinePrecision] + N[(2.0 + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e-176], N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[(-1.0 / x), $MachinePrecision] + N[(-0.3333333333333333 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{x}\\
\mathbf{if}\;t \leq -1350000000:\\
\;\;\;\;\sqrt{0.5 \cdot \frac{x + -1}{x + 1}} \cdot \left(-\sqrt{2}\right)\\
\mathbf{elif}\;t \leq -3.9 \cdot 10^{-156}:\\
\;\;\;\;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 -9.2 \cdot 10^{-194}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{t \cdot \left(-\sqrt{\frac{2}{x} + \left(2 + \frac{2}{x}\right)}\right)}\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-176}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{-1}{x} + \frac{-0.3333333333333333}{{x}^{3}}}\\
\end{array}
\end{array}
if t < -1.35e9Initial program 38.5%
associate-*l/38.6%
Simplified38.6%
Taylor expanded in t around -inf 93.9%
mul-1-neg93.9%
associate-*l*93.9%
distribute-rgt-neg-in93.9%
sub-neg93.9%
metadata-eval93.9%
+-commutative93.9%
+-commutative93.9%
Simplified93.9%
pow193.9%
sqrt-unprod94.0%
+-commutative94.0%
Applied egg-rr94.0%
unpow194.0%
Simplified94.0%
if -1.35e9 < t < -3.9000000000000001e-156Initial program 54.1%
associate-*l/54.0%
Simplified54.0%
Taylor expanded in x around inf 86.6%
associate--l+86.6%
unpow286.6%
distribute-lft-out86.6%
unpow286.6%
unpow286.6%
associate-*r/86.6%
mul-1-neg86.6%
unpow286.6%
+-commutative86.6%
unpow286.6%
fma-udef86.6%
Simplified86.6%
Taylor expanded in t around 0 86.6%
associate-*r/86.6%
neg-mul-186.6%
unpow286.6%
distribute-rgt-neg-in86.6%
Simplified86.6%
if -3.9000000000000001e-156 < t < -9.2000000000000001e-194Initial program 12.0%
associate-*l/12.0%
Simplified12.0%
Taylor expanded in x around inf 33.8%
associate--l+33.8%
unpow233.8%
distribute-lft-out33.8%
unpow233.8%
unpow233.8%
associate-*r/33.8%
mul-1-neg33.8%
unpow233.8%
+-commutative33.8%
unpow233.8%
fma-udef33.8%
Simplified33.8%
Taylor expanded in t around -inf 65.1%
mul-1-neg65.1%
*-commutative65.1%
distribute-rgt-neg-in65.1%
distribute-lft-in65.1%
metadata-eval65.1%
associate-*r/65.1%
metadata-eval65.1%
associate-*r/65.1%
metadata-eval65.1%
Simplified65.1%
if -9.2000000000000001e-194 < t < 1.20000000000000003e-176Initial program 1.6%
associate-*l/1.6%
Simplified1.6%
Taylor expanded in x around inf 63.8%
associate--l+63.8%
unpow263.8%
distribute-lft-out63.8%
unpow263.8%
unpow263.8%
associate-*r/63.8%
mul-1-neg63.8%
unpow263.8%
+-commutative63.8%
unpow263.8%
fma-udef63.8%
Simplified63.8%
Taylor expanded in l around inf 60.3%
Taylor expanded in l around 0 60.3%
associate-*l/60.3%
*-lft-identity60.3%
Simplified60.3%
if 1.20000000000000003e-176 < t Initial program 40.5%
associate-*l/40.5%
Simplified40.5%
Applied egg-rr25.2%
Taylor expanded in t around inf 91.5%
Taylor expanded in x around inf 91.5%
+-commutative91.5%
distribute-neg-in91.5%
distribute-neg-frac91.5%
metadata-eval91.5%
associate-*r/91.5%
metadata-eval91.5%
distribute-neg-frac91.5%
metadata-eval91.5%
Simplified91.5%
Final simplification86.4%
(FPCore (x l t)
:precision binary64
(if (<= t -4.2e-198)
(* t (/ (sqrt 2.0) (* t (- (sqrt (+ (/ 2.0 x) (+ 2.0 (/ 2.0 x))))))))
(if (<= t 9e-176)
(* t (/ (sqrt x) l))
(exp (+ (/ -1.0 x) (/ -0.3333333333333333 (pow x 3.0)))))))
double code(double x, double l, double t) {
double tmp;
if (t <= -4.2e-198) {
tmp = t * (sqrt(2.0) / (t * -sqrt(((2.0 / x) + (2.0 + (2.0 / x))))));
} else if (t <= 9e-176) {
tmp = t * (sqrt(x) / l);
} else {
tmp = exp(((-1.0 / x) + (-0.3333333333333333 / pow(x, 3.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 <= (-4.2d-198)) then
tmp = t * (sqrt(2.0d0) / (t * -sqrt(((2.0d0 / x) + (2.0d0 + (2.0d0 / x))))))
else if (t <= 9d-176) then
tmp = t * (sqrt(x) / l)
else
tmp = exp((((-1.0d0) / x) + ((-0.3333333333333333d0) / (x ** 3.0d0))))
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= -4.2e-198) {
tmp = t * (Math.sqrt(2.0) / (t * -Math.sqrt(((2.0 / x) + (2.0 + (2.0 / x))))));
} else if (t <= 9e-176) {
tmp = t * (Math.sqrt(x) / l);
} else {
tmp = Math.exp(((-1.0 / x) + (-0.3333333333333333 / Math.pow(x, 3.0))));
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -4.2e-198: tmp = t * (math.sqrt(2.0) / (t * -math.sqrt(((2.0 / x) + (2.0 + (2.0 / x)))))) elif t <= 9e-176: tmp = t * (math.sqrt(x) / l) else: tmp = math.exp(((-1.0 / x) + (-0.3333333333333333 / math.pow(x, 3.0)))) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -4.2e-198) tmp = Float64(t * Float64(sqrt(2.0) / Float64(t * Float64(-sqrt(Float64(Float64(2.0 / x) + Float64(2.0 + Float64(2.0 / x)))))))); elseif (t <= 9e-176) tmp = Float64(t * Float64(sqrt(x) / l)); else tmp = exp(Float64(Float64(-1.0 / x) + Float64(-0.3333333333333333 / (x ^ 3.0)))); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -4.2e-198) tmp = t * (sqrt(2.0) / (t * -sqrt(((2.0 / x) + (2.0 + (2.0 / x)))))); elseif (t <= 9e-176) tmp = t * (sqrt(x) / l); else tmp = exp(((-1.0 / x) + (-0.3333333333333333 / (x ^ 3.0)))); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -4.2e-198], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(t * (-N[Sqrt[N[(N[(2.0 / x), $MachinePrecision] + N[(2.0 + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9e-176], N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[(-1.0 / x), $MachinePrecision] + N[(-0.3333333333333333 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{-198}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{t \cdot \left(-\sqrt{\frac{2}{x} + \left(2 + \frac{2}{x}\right)}\right)}\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-176}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{-1}{x} + \frac{-0.3333333333333333}{{x}^{3}}}\\
\end{array}
\end{array}
if t < -4.19999999999999986e-198Initial program 40.2%
associate-*l/40.2%
Simplified40.2%
Taylor expanded in x around inf 49.2%
associate--l+49.2%
unpow249.2%
distribute-lft-out49.2%
unpow249.2%
unpow249.2%
associate-*r/49.2%
mul-1-neg49.2%
unpow249.2%
+-commutative49.2%
unpow249.2%
fma-udef49.2%
Simplified49.2%
Taylor expanded in t around -inf 85.2%
mul-1-neg85.2%
*-commutative85.2%
distribute-rgt-neg-in85.2%
distribute-lft-in85.2%
metadata-eval85.2%
associate-*r/85.2%
metadata-eval85.2%
associate-*r/85.2%
metadata-eval85.2%
Simplified85.2%
if -4.19999999999999986e-198 < t < 9e-176Initial program 1.6%
associate-*l/1.6%
Simplified1.6%
Taylor expanded in x around inf 63.8%
associate--l+63.8%
unpow263.8%
distribute-lft-out63.8%
unpow263.8%
unpow263.8%
associate-*r/63.8%
mul-1-neg63.8%
unpow263.8%
+-commutative63.8%
unpow263.8%
fma-udef63.8%
Simplified63.8%
Taylor expanded in l around inf 60.3%
Taylor expanded in l around 0 60.3%
associate-*l/60.3%
*-lft-identity60.3%
Simplified60.3%
if 9e-176 < t Initial program 40.5%
associate-*l/40.5%
Simplified40.5%
Applied egg-rr25.2%
Taylor expanded in t around inf 91.5%
Taylor expanded in x around inf 91.5%
+-commutative91.5%
distribute-neg-in91.5%
distribute-neg-frac91.5%
metadata-eval91.5%
associate-*r/91.5%
metadata-eval91.5%
distribute-neg-frac91.5%
metadata-eval91.5%
Simplified91.5%
Final simplification84.2%
(FPCore (x l t)
:precision binary64
(if (<= t -6e-199)
(* (sqrt (* 0.5 (/ (+ x -1.0) (+ x 1.0)))) (- (sqrt 2.0)))
(if (<= t 5.4e-176)
(* t (/ (sqrt x) l))
(exp (+ (/ -1.0 x) (/ -0.3333333333333333 (pow x 3.0)))))))
double code(double x, double l, double t) {
double tmp;
if (t <= -6e-199) {
tmp = sqrt((0.5 * ((x + -1.0) / (x + 1.0)))) * -sqrt(2.0);
} else if (t <= 5.4e-176) {
tmp = t * (sqrt(x) / l);
} else {
tmp = exp(((-1.0 / x) + (-0.3333333333333333 / pow(x, 3.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 <= (-6d-199)) then
tmp = sqrt((0.5d0 * ((x + (-1.0d0)) / (x + 1.0d0)))) * -sqrt(2.0d0)
else if (t <= 5.4d-176) then
tmp = t * (sqrt(x) / l)
else
tmp = exp((((-1.0d0) / x) + ((-0.3333333333333333d0) / (x ** 3.0d0))))
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= -6e-199) {
tmp = Math.sqrt((0.5 * ((x + -1.0) / (x + 1.0)))) * -Math.sqrt(2.0);
} else if (t <= 5.4e-176) {
tmp = t * (Math.sqrt(x) / l);
} else {
tmp = Math.exp(((-1.0 / x) + (-0.3333333333333333 / Math.pow(x, 3.0))));
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -6e-199: tmp = math.sqrt((0.5 * ((x + -1.0) / (x + 1.0)))) * -math.sqrt(2.0) elif t <= 5.4e-176: tmp = t * (math.sqrt(x) / l) else: tmp = math.exp(((-1.0 / x) + (-0.3333333333333333 / math.pow(x, 3.0)))) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -6e-199) tmp = Float64(sqrt(Float64(0.5 * Float64(Float64(x + -1.0) / Float64(x + 1.0)))) * Float64(-sqrt(2.0))); elseif (t <= 5.4e-176) tmp = Float64(t * Float64(sqrt(x) / l)); else tmp = exp(Float64(Float64(-1.0 / x) + Float64(-0.3333333333333333 / (x ^ 3.0)))); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -6e-199) tmp = sqrt((0.5 * ((x + -1.0) / (x + 1.0)))) * -sqrt(2.0); elseif (t <= 5.4e-176) tmp = t * (sqrt(x) / l); else tmp = exp(((-1.0 / x) + (-0.3333333333333333 / (x ^ 3.0)))); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -6e-199], N[(N[Sqrt[N[(0.5 * N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision], If[LessEqual[t, 5.4e-176], N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[(-1.0 / x), $MachinePrecision] + N[(-0.3333333333333333 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{-199}:\\
\;\;\;\;\sqrt{0.5 \cdot \frac{x + -1}{x + 1}} \cdot \left(-\sqrt{2}\right)\\
\mathbf{elif}\;t \leq 5.4 \cdot 10^{-176}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{-1}{x} + \frac{-0.3333333333333333}{{x}^{3}}}\\
\end{array}
\end{array}
if t < -5.99999999999999966e-199Initial program 40.2%
associate-*l/40.2%
Simplified40.2%
Taylor expanded in t around -inf 85.0%
mul-1-neg85.0%
associate-*l*85.0%
distribute-rgt-neg-in85.0%
sub-neg85.0%
metadata-eval85.0%
+-commutative85.0%
+-commutative85.0%
Simplified85.0%
pow185.0%
sqrt-unprod85.1%
+-commutative85.1%
Applied egg-rr85.1%
unpow185.1%
Simplified85.1%
if -5.99999999999999966e-199 < t < 5.3999999999999997e-176Initial program 1.6%
associate-*l/1.6%
Simplified1.6%
Taylor expanded in x around inf 63.8%
associate--l+63.8%
unpow263.8%
distribute-lft-out63.8%
unpow263.8%
unpow263.8%
associate-*r/63.8%
mul-1-neg63.8%
unpow263.8%
+-commutative63.8%
unpow263.8%
fma-udef63.8%
Simplified63.8%
Taylor expanded in l around inf 60.3%
Taylor expanded in l around 0 60.3%
associate-*l/60.3%
*-lft-identity60.3%
Simplified60.3%
if 5.3999999999999997e-176 < t Initial program 40.5%
associate-*l/40.5%
Simplified40.5%
Applied egg-rr25.2%
Taylor expanded in t around inf 91.5%
Taylor expanded in x around inf 91.5%
+-commutative91.5%
distribute-neg-in91.5%
distribute-neg-frac91.5%
metadata-eval91.5%
associate-*r/91.5%
metadata-eval91.5%
distribute-neg-frac91.5%
metadata-eval91.5%
Simplified91.5%
Final simplification84.2%
(FPCore (x l t)
:precision binary64
(if (<= t -5e-194)
(- (* (sqrt 2.0) (sqrt 0.5)))
(if (<= t 2.4e-175)
(* t (/ (sqrt x) l))
(exp (+ (/ -1.0 x) (/ -0.3333333333333333 (pow x 3.0)))))))
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-194) {
tmp = -(sqrt(2.0) * sqrt(0.5));
} else if (t <= 2.4e-175) {
tmp = t * (sqrt(x) / l);
} else {
tmp = exp(((-1.0 / x) + (-0.3333333333333333 / pow(x, 3.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 <= (-5d-194)) then
tmp = -(sqrt(2.0d0) * sqrt(0.5d0))
else if (t <= 2.4d-175) then
tmp = t * (sqrt(x) / l)
else
tmp = exp((((-1.0d0) / x) + ((-0.3333333333333333d0) / (x ** 3.0d0))))
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-194) {
tmp = -(Math.sqrt(2.0) * Math.sqrt(0.5));
} else if (t <= 2.4e-175) {
tmp = t * (Math.sqrt(x) / l);
} else {
tmp = Math.exp(((-1.0 / x) + (-0.3333333333333333 / Math.pow(x, 3.0))));
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -5e-194: tmp = -(math.sqrt(2.0) * math.sqrt(0.5)) elif t <= 2.4e-175: tmp = t * (math.sqrt(x) / l) else: tmp = math.exp(((-1.0 / x) + (-0.3333333333333333 / math.pow(x, 3.0)))) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -5e-194) tmp = Float64(-Float64(sqrt(2.0) * sqrt(0.5))); elseif (t <= 2.4e-175) tmp = Float64(t * Float64(sqrt(x) / l)); else tmp = exp(Float64(Float64(-1.0 / x) + Float64(-0.3333333333333333 / (x ^ 3.0)))); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-194) tmp = -(sqrt(2.0) * sqrt(0.5)); elseif (t <= 2.4e-175) tmp = t * (sqrt(x) / l); else tmp = exp(((-1.0 / x) + (-0.3333333333333333 / (x ^ 3.0)))); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -5e-194], (-N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), If[LessEqual[t, 2.4e-175], N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[(-1.0 / x), $MachinePrecision] + N[(-0.3333333333333333 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-194}:\\
\;\;\;\;-\sqrt{2} \cdot \sqrt{0.5}\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-175}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{-1}{x} + \frac{-0.3333333333333333}{{x}^{3}}}\\
\end{array}
\end{array}
if t < -5.0000000000000002e-194Initial program 40.2%
associate-*l/40.2%
Simplified40.2%
Taylor expanded in t around -inf 85.0%
mul-1-neg85.0%
associate-*l*85.0%
distribute-rgt-neg-in85.0%
sub-neg85.0%
metadata-eval85.0%
+-commutative85.0%
+-commutative85.0%
Simplified85.0%
Taylor expanded in x around inf 82.4%
mul-1-neg82.4%
distribute-rgt-neg-in82.4%
Simplified82.4%
if -5.0000000000000002e-194 < t < 2.4e-175Initial program 1.6%
associate-*l/1.6%
Simplified1.6%
Taylor expanded in x around inf 63.8%
associate--l+63.8%
unpow263.8%
distribute-lft-out63.8%
unpow263.8%
unpow263.8%
associate-*r/63.8%
mul-1-neg63.8%
unpow263.8%
+-commutative63.8%
unpow263.8%
fma-udef63.8%
Simplified63.8%
Taylor expanded in l around inf 60.3%
Taylor expanded in l around 0 60.3%
associate-*l/60.3%
*-lft-identity60.3%
Simplified60.3%
if 2.4e-175 < t Initial program 40.5%
associate-*l/40.5%
Simplified40.5%
Applied egg-rr25.2%
Taylor expanded in t around inf 91.5%
Taylor expanded in x around inf 91.5%
+-commutative91.5%
distribute-neg-in91.5%
distribute-neg-frac91.5%
metadata-eval91.5%
associate-*r/91.5%
metadata-eval91.5%
distribute-neg-frac91.5%
metadata-eval91.5%
Simplified91.5%
Final simplification82.9%
(FPCore (x l t) :precision binary64 (if (<= t -2.2e-194) (- (* (sqrt 2.0) (sqrt 0.5))) (if (<= t 4.8e-175) (* t (/ (sqrt x) l)) (exp (/ -1.0 x)))))
double code(double x, double l, double t) {
double tmp;
if (t <= -2.2e-194) {
tmp = -(sqrt(2.0) * sqrt(0.5));
} else if (t <= 4.8e-175) {
tmp = t * (sqrt(x) / l);
} else {
tmp = exp((-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 <= (-2.2d-194)) then
tmp = -(sqrt(2.0d0) * sqrt(0.5d0))
else if (t <= 4.8d-175) then
tmp = t * (sqrt(x) / l)
else
tmp = exp(((-1.0d0) / x))
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= -2.2e-194) {
tmp = -(Math.sqrt(2.0) * Math.sqrt(0.5));
} else if (t <= 4.8e-175) {
tmp = t * (Math.sqrt(x) / l);
} else {
tmp = Math.exp((-1.0 / x));
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -2.2e-194: tmp = -(math.sqrt(2.0) * math.sqrt(0.5)) elif t <= 4.8e-175: tmp = t * (math.sqrt(x) / l) else: tmp = math.exp((-1.0 / x)) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -2.2e-194) tmp = Float64(-Float64(sqrt(2.0) * sqrt(0.5))); elseif (t <= 4.8e-175) tmp = Float64(t * Float64(sqrt(x) / l)); else tmp = exp(Float64(-1.0 / x)); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -2.2e-194) tmp = -(sqrt(2.0) * sqrt(0.5)); elseif (t <= 4.8e-175) tmp = t * (sqrt(x) / l); else tmp = exp((-1.0 / x)); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -2.2e-194], (-N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), If[LessEqual[t, 4.8e-175], N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[Exp[N[(-1.0 / x), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{-194}:\\
\;\;\;\;-\sqrt{2} \cdot \sqrt{0.5}\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-175}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{-1}{x}}\\
\end{array}
\end{array}
if t < -2.2000000000000001e-194Initial program 40.2%
associate-*l/40.2%
Simplified40.2%
Taylor expanded in t around -inf 85.0%
mul-1-neg85.0%
associate-*l*85.0%
distribute-rgt-neg-in85.0%
sub-neg85.0%
metadata-eval85.0%
+-commutative85.0%
+-commutative85.0%
Simplified85.0%
Taylor expanded in x around inf 82.4%
mul-1-neg82.4%
distribute-rgt-neg-in82.4%
Simplified82.4%
if -2.2000000000000001e-194 < t < 4.8e-175Initial program 1.6%
associate-*l/1.6%
Simplified1.6%
Taylor expanded in x around inf 63.8%
associate--l+63.8%
unpow263.8%
distribute-lft-out63.8%
unpow263.8%
unpow263.8%
associate-*r/63.8%
mul-1-neg63.8%
unpow263.8%
+-commutative63.8%
unpow263.8%
fma-udef63.8%
Simplified63.8%
Taylor expanded in l around inf 60.3%
Taylor expanded in l around 0 60.3%
associate-*l/60.3%
*-lft-identity60.3%
Simplified60.3%
if 4.8e-175 < t Initial program 40.5%
associate-*l/40.5%
Simplified40.5%
Applied egg-rr25.2%
Taylor expanded in t around inf 91.5%
Taylor expanded in x around inf 91.2%
Final simplification82.8%
(FPCore (x l t) :precision binary64 (if (<= t 4.2e-177) (* (sqrt x) (/ t l)) (exp (/ -1.0 x))))
double code(double x, double l, double t) {
double tmp;
if (t <= 4.2e-177) {
tmp = sqrt(x) * (t / l);
} else {
tmp = exp((-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 <= 4.2d-177) then
tmp = sqrt(x) * (t / l)
else
tmp = exp(((-1.0d0) / x))
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= 4.2e-177) {
tmp = Math.sqrt(x) * (t / l);
} else {
tmp = Math.exp((-1.0 / x));
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= 4.2e-177: tmp = math.sqrt(x) * (t / l) else: tmp = math.exp((-1.0 / x)) return tmp
function code(x, l, t) tmp = 0.0 if (t <= 4.2e-177) tmp = Float64(sqrt(x) * Float64(t / l)); else tmp = exp(Float64(-1.0 / x)); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= 4.2e-177) tmp = sqrt(x) * (t / l); else tmp = exp((-1.0 / x)); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, 4.2e-177], N[(N[Sqrt[x], $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision], N[Exp[N[(-1.0 / x), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.2 \cdot 10^{-177}:\\
\;\;\;\;\sqrt{x} \cdot \frac{t}{\ell}\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{-1}{x}}\\
\end{array}
\end{array}
if t < 4.20000000000000002e-177Initial program 31.2%
associate-*l/31.2%
Simplified31.2%
Taylor expanded in x around inf 52.6%
associate--l+52.6%
unpow252.6%
distribute-lft-out52.6%
unpow252.6%
unpow252.6%
associate-*r/52.6%
mul-1-neg52.6%
unpow252.6%
+-commutative52.6%
unpow252.6%
fma-udef52.6%
Simplified52.6%
Taylor expanded in l around inf 21.6%
Taylor expanded in l around 0 19.4%
if 4.20000000000000002e-177 < t Initial program 40.5%
associate-*l/40.5%
Simplified40.5%
Applied egg-rr25.2%
Taylor expanded in t around inf 91.5%
Taylor expanded in x around inf 91.2%
Final simplification48.0%
(FPCore (x l t) :precision binary64 (if (<= t 4e-177) (* t (/ (sqrt x) l)) (exp (/ -1.0 x))))
double code(double x, double l, double t) {
double tmp;
if (t <= 4e-177) {
tmp = t * (sqrt(x) / l);
} else {
tmp = exp((-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 <= 4d-177) then
tmp = t * (sqrt(x) / l)
else
tmp = exp(((-1.0d0) / x))
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= 4e-177) {
tmp = t * (Math.sqrt(x) / l);
} else {
tmp = Math.exp((-1.0 / x));
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= 4e-177: tmp = t * (math.sqrt(x) / l) else: tmp = math.exp((-1.0 / x)) return tmp
function code(x, l, t) tmp = 0.0 if (t <= 4e-177) tmp = Float64(t * Float64(sqrt(x) / l)); else tmp = exp(Float64(-1.0 / x)); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= 4e-177) tmp = t * (sqrt(x) / l); else tmp = exp((-1.0 / x)); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, 4e-177], N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[Exp[N[(-1.0 / x), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4 \cdot 10^{-177}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{-1}{x}}\\
\end{array}
\end{array}
if t < 3.99999999999999981e-177Initial program 31.2%
associate-*l/31.2%
Simplified31.2%
Taylor expanded in x around inf 52.6%
associate--l+52.6%
unpow252.6%
distribute-lft-out52.6%
unpow252.6%
unpow252.6%
associate-*r/52.6%
mul-1-neg52.6%
unpow252.6%
+-commutative52.6%
unpow252.6%
fma-udef52.6%
Simplified52.6%
Taylor expanded in l around inf 21.6%
Taylor expanded in l around 0 21.6%
associate-*l/21.6%
*-lft-identity21.6%
Simplified21.6%
if 3.99999999999999981e-177 < t Initial program 40.5%
associate-*l/40.5%
Simplified40.5%
Applied egg-rr25.2%
Taylor expanded in t around inf 91.5%
Taylor expanded in x around inf 91.2%
Final simplification49.4%
(FPCore (x l t) :precision binary64 (exp (/ -1.0 x)))
double code(double x, double l, double t) {
return exp((-1.0 / x));
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = exp(((-1.0d0) / x))
end function
public static double code(double x, double l, double t) {
return Math.exp((-1.0 / x));
}
def code(x, l, t): return math.exp((-1.0 / x))
function code(x, l, t) return exp(Float64(-1.0 / x)) end
function tmp = code(x, l, t) tmp = exp((-1.0 / x)); end
code[x_, l_, t_] := N[Exp[N[(-1.0 / x), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\frac{-1}{x}}
\end{array}
Initial program 34.9%
associate-*l/34.9%
Simplified34.9%
Applied egg-rr11.2%
Taylor expanded in t around inf 40.0%
Taylor expanded in x around inf 39.9%
Final simplification39.9%
(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 34.9%
associate-*l/34.9%
Simplified34.9%
Taylor expanded in x around inf 38.5%
sqrt-unprod39.1%
metadata-eval39.1%
metadata-eval39.1%
Applied egg-rr39.1%
Final simplification39.1%
herbie shell --seed 2023217
(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)))))