
(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
(*
t
(/
(sqrt 2.0)
(sqrt
(+
(/ (* l l) x)
(+
(* 2.0 (+ (* t t) (/ (* t t) x)))
(/ (fma (* 2.0 t) t (* l l)) x))))))))
(if (<= t -4.5e+53)
(+ -1.0 (/ 1.0 x))
(if (<= t -4.1e-227)
t_1
(if (<= t -6e-281)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t 2e+57) t_1 (+ 1.0 (+ (/ 0.5 (* x x)) (/ -1.0 x)))))))))
double code(double x, double l, double t) {
double t_1 = t * (sqrt(2.0) / sqrt((((l * l) / x) + ((2.0 * ((t * t) + ((t * t) / x))) + (fma((2.0 * t), t, (l * l)) / x)))));
double tmp;
if (t <= -4.5e+53) {
tmp = -1.0 + (1.0 / x);
} else if (t <= -4.1e-227) {
tmp = t_1;
} else if (t <= -6e-281) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 2e+57) {
tmp = t_1;
} else {
tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
}
return tmp;
}
function code(x, l, t) t_1 = 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(2.0 * t), t, Float64(l * l)) / x)))))) tmp = 0.0 if (t <= -4.5e+53) tmp = Float64(-1.0 + Float64(1.0 / x)); elseif (t <= -4.1e-227) tmp = t_1; elseif (t <= -6e-281) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= 2e+57) tmp = t_1; else tmp = Float64(1.0 + Float64(Float64(0.5 / Float64(x * x)) + Float64(-1.0 / x))); end return tmp end
code[x_, l_, t_] := Block[{t$95$1 = 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[(2.0 * t), $MachinePrecision] * t + N[(l * l), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.5e+53], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.1e-227], t$95$1, If[LessEqual[t, -6e-281], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 2e+57], t$95$1, N[(1.0 + N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 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(2 \cdot t, t, \ell \cdot \ell\right)}{x}\right)}}\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{+53}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{elif}\;t \leq -4.1 \cdot 10^{-227}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -6 \cdot 10^{-281}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+57}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -4.5000000000000002e53Initial program 34.6%
associate-/l*34.6%
fma-neg34.6%
remove-double-neg34.6%
fma-neg34.6%
sub-neg34.6%
metadata-eval34.6%
remove-double-neg34.6%
fma-def34.6%
Simplified34.6%
Applied egg-rr85.1%
Taylor expanded in t around inf 1.6%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt93.5%
Simplified93.5%
if -4.5000000000000002e53 < t < -4.10000000000000009e-227 or -5.9999999999999995e-281 < t < 2.0000000000000001e57Initial program 34.2%
associate-*l/34.3%
Simplified34.3%
Taylor expanded in x around inf 69.6%
associate--l+69.6%
unpow269.6%
distribute-lft-out69.6%
unpow269.6%
unpow269.6%
associate-*r/69.6%
mul-1-neg69.6%
+-commutative69.6%
unpow269.6%
associate-*l*69.6%
unpow269.6%
fma-udef69.6%
Simplified69.6%
if -4.10000000000000009e-227 < t < -5.9999999999999995e-281Initial program 2.9%
associate-/l*2.9%
fma-neg2.9%
remove-double-neg2.9%
fma-neg2.9%
sub-neg2.9%
metadata-eval2.9%
remove-double-neg2.9%
fma-def2.9%
Simplified2.9%
Applied egg-rr35.0%
Taylor expanded in t around -inf 69.3%
mul-1-neg69.3%
sub-neg69.3%
metadata-eval69.3%
Simplified69.3%
if 2.0000000000000001e57 < t Initial program 32.7%
associate-/l*32.8%
fma-neg32.8%
remove-double-neg32.8%
fma-neg32.8%
sub-neg32.8%
metadata-eval32.8%
remove-double-neg32.8%
fma-def32.8%
Simplified32.8%
Applied egg-rr86.3%
Taylor expanded in t around inf 97.8%
Taylor expanded in x around inf 97.8%
associate--l+97.8%
associate-*r/97.8%
metadata-eval97.8%
unpow297.8%
Simplified97.8%
Final simplification82.2%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* (sqrt 2.0) t))
(t_2 (sqrt (/ (+ x -1.0) (+ x 1.0))))
(t_3 (/ (+ x 1.0) (+ x -1.0)))
(t_4 (/ t_1 (sqrt (- (* t_3 (+ (* l l) (* 2.0 (* t t)))) (* l l))))))
(if (<= t_4 -1.0)
(- t_2)
(if (<= t_4 5e-79)
(* (sqrt 2.0) (/ t (hypot (* (hypot l t_1) (sqrt t_3)) l)))
(if (<= t_4 INFINITY)
t_2
(*
t
(*
(/ (sqrt 2.0) l)
(-
(sqrt
(/
1.0
(+
(+ (/ 2.0 x) (+ (/ 2.0 (* x x)) (/ 2.0 (pow x 3.0))))
(/ 2.0 (pow x 4.0)))))))))))))
double code(double x, double l, double t) {
double t_1 = sqrt(2.0) * t;
double t_2 = sqrt(((x + -1.0) / (x + 1.0)));
double t_3 = (x + 1.0) / (x + -1.0);
double t_4 = t_1 / sqrt(((t_3 * ((l * l) + (2.0 * (t * t)))) - (l * l)));
double tmp;
if (t_4 <= -1.0) {
tmp = -t_2;
} else if (t_4 <= 5e-79) {
tmp = sqrt(2.0) * (t / hypot((hypot(l, t_1) * sqrt(t_3)), l));
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = t * ((sqrt(2.0) / l) * -sqrt((1.0 / (((2.0 / x) + ((2.0 / (x * x)) + (2.0 / pow(x, 3.0)))) + (2.0 / pow(x, 4.0))))));
}
return tmp;
}
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt(2.0) * t;
double t_2 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double t_3 = (x + 1.0) / (x + -1.0);
double t_4 = t_1 / Math.sqrt(((t_3 * ((l * l) + (2.0 * (t * t)))) - (l * l)));
double tmp;
if (t_4 <= -1.0) {
tmp = -t_2;
} else if (t_4 <= 5e-79) {
tmp = Math.sqrt(2.0) * (t / Math.hypot((Math.hypot(l, t_1) * Math.sqrt(t_3)), l));
} else if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = t * ((Math.sqrt(2.0) / l) * -Math.sqrt((1.0 / (((2.0 / x) + ((2.0 / (x * x)) + (2.0 / Math.pow(x, 3.0)))) + (2.0 / Math.pow(x, 4.0))))));
}
return tmp;
}
def code(x, l, t): t_1 = math.sqrt(2.0) * t t_2 = math.sqrt(((x + -1.0) / (x + 1.0))) t_3 = (x + 1.0) / (x + -1.0) t_4 = t_1 / math.sqrt(((t_3 * ((l * l) + (2.0 * (t * t)))) - (l * l))) tmp = 0 if t_4 <= -1.0: tmp = -t_2 elif t_4 <= 5e-79: tmp = math.sqrt(2.0) * (t / math.hypot((math.hypot(l, t_1) * math.sqrt(t_3)), l)) elif t_4 <= math.inf: tmp = t_2 else: tmp = t * ((math.sqrt(2.0) / l) * -math.sqrt((1.0 / (((2.0 / x) + ((2.0 / (x * x)) + (2.0 / math.pow(x, 3.0)))) + (2.0 / math.pow(x, 4.0)))))) return tmp
function code(x, l, t) t_1 = Float64(sqrt(2.0) * t) t_2 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) t_3 = Float64(Float64(x + 1.0) / Float64(x + -1.0)) t_4 = Float64(t_1 / sqrt(Float64(Float64(t_3 * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) tmp = 0.0 if (t_4 <= -1.0) tmp = Float64(-t_2); elseif (t_4 <= 5e-79) tmp = Float64(sqrt(2.0) * Float64(t / hypot(Float64(hypot(l, t_1) * sqrt(t_3)), l))); elseif (t_4 <= Inf) tmp = t_2; else tmp = Float64(t * Float64(Float64(sqrt(2.0) / l) * Float64(-sqrt(Float64(1.0 / Float64(Float64(Float64(2.0 / x) + Float64(Float64(2.0 / Float64(x * x)) + Float64(2.0 / (x ^ 3.0)))) + Float64(2.0 / (x ^ 4.0)))))))); end return tmp end
function tmp_2 = code(x, l, t) t_1 = sqrt(2.0) * t; t_2 = sqrt(((x + -1.0) / (x + 1.0))); t_3 = (x + 1.0) / (x + -1.0); t_4 = t_1 / sqrt(((t_3 * ((l * l) + (2.0 * (t * t)))) - (l * l))); tmp = 0.0; if (t_4 <= -1.0) tmp = -t_2; elseif (t_4 <= 5e-79) tmp = sqrt(2.0) * (t / hypot((hypot(l, t_1) * sqrt(t_3)), l)); elseif (t_4 <= Inf) tmp = t_2; else tmp = t * ((sqrt(2.0) / l) * -sqrt((1.0 / (((2.0 / x) + ((2.0 / (x * x)) + (2.0 / (x ^ 3.0)))) + (2.0 / (x ^ 4.0)))))); end tmp_2 = tmp; end
code[x_, l_, t_] := Block[{t$95$1 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 / N[Sqrt[N[(N[(t$95$3 * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -1.0], (-t$95$2), If[LessEqual[t$95$4, 5e-79], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$1 ^ 2], $MachinePrecision] * N[Sqrt[t$95$3], $MachinePrecision]), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$2, N[(t * N[(N[(N[Sqrt[2.0], $MachinePrecision] / l), $MachinePrecision] * (-N[Sqrt[N[(1.0 / N[(N[(N[(2.0 / x), $MachinePrecision] + N[(N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(2.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 / N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{2} \cdot t\\
t_2 := \sqrt{\frac{x + -1}{x + 1}}\\
t_3 := \frac{x + 1}{x + -1}\\
t_4 := \frac{t_1}{\sqrt{t_3 \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}\\
\mathbf{if}\;t_4 \leq -1:\\
\;\;\;\;-t_2\\
\mathbf{elif}\;t_4 \leq 5 \cdot 10^{-79}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_1\right) \cdot \sqrt{t_3}, \ell\right)}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{\sqrt{2}}{\ell} \cdot \left(-\sqrt{\frac{1}{\left(\frac{2}{x} + \left(\frac{2}{x \cdot x} + \frac{2}{{x}^{3}}\right)\right) + \frac{2}{{x}^{4}}}}\right)\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -1Initial program 57.2%
associate-/l*57.1%
fma-neg57.1%
remove-double-neg57.1%
fma-neg57.1%
sub-neg57.1%
metadata-eval57.1%
remove-double-neg57.1%
fma-def57.1%
Simplified57.1%
Applied egg-rr66.8%
Taylor expanded in t around -inf 81.6%
mul-1-neg81.6%
sub-neg81.6%
metadata-eval81.6%
Simplified81.6%
if -1 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 4.99999999999999999e-79Initial program 5.9%
associate-/l*5.9%
fma-neg5.9%
remove-double-neg5.9%
fma-neg5.9%
sub-neg5.9%
metadata-eval5.9%
remove-double-neg5.9%
fma-def5.9%
Simplified5.9%
Applied egg-rr98.2%
if 4.99999999999999999e-79 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0Initial program 56.8%
associate-/l*56.8%
fma-neg56.8%
remove-double-neg56.8%
fma-neg56.8%
sub-neg56.8%
metadata-eval56.8%
remove-double-neg56.8%
fma-def56.8%
Simplified56.8%
Applied egg-rr65.8%
Taylor expanded in t around inf 84.4%
if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) Initial program 0.0%
associate-*l/0.0%
Simplified0.0%
Taylor expanded in l around -inf 4.9%
associate-*r*4.9%
mul-1-neg4.9%
associate--l+4.9%
sub-neg4.9%
metadata-eval4.9%
+-commutative4.9%
sub-neg4.9%
sub-neg4.9%
metadata-eval4.9%
+-commutative4.9%
metadata-eval4.9%
Simplified4.9%
Taylor expanded in x around inf 55.1%
+-commutative55.1%
associate-*r/55.1%
metadata-eval55.1%
+-commutative55.1%
associate-*r/55.1%
metadata-eval55.1%
unpow255.1%
associate-*r/55.1%
metadata-eval55.1%
associate-*r/55.1%
metadata-eval55.1%
Simplified55.1%
Final simplification80.0%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* (sqrt 2.0) t))
(t_2 (sqrt (/ (+ x -1.0) (+ x 1.0))))
(t_3 (/ (+ x 1.0) (+ x -1.0)))
(t_4 (/ t_1 (sqrt (- (* t_3 (+ (* l l) (* 2.0 (* t t)))) (* l l))))))
(if (<= t_4 -1.0)
(- t_2)
(if (<= t_4 5e-79)
(* t_1 (/ 1.0 (hypot (* t_1 (sqrt t_3)) l)))
(if (<= t_4 INFINITY)
t_2
(*
t
(*
(/ (sqrt 2.0) l)
(-
(sqrt
(/
1.0
(+
(+ (/ 2.0 x) (+ (/ 2.0 (* x x)) (/ 2.0 (pow x 3.0))))
(/ 2.0 (pow x 4.0)))))))))))))
double code(double x, double l, double t) {
double t_1 = sqrt(2.0) * t;
double t_2 = sqrt(((x + -1.0) / (x + 1.0)));
double t_3 = (x + 1.0) / (x + -1.0);
double t_4 = t_1 / sqrt(((t_3 * ((l * l) + (2.0 * (t * t)))) - (l * l)));
double tmp;
if (t_4 <= -1.0) {
tmp = -t_2;
} else if (t_4 <= 5e-79) {
tmp = t_1 * (1.0 / hypot((t_1 * sqrt(t_3)), l));
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = t * ((sqrt(2.0) / l) * -sqrt((1.0 / (((2.0 / x) + ((2.0 / (x * x)) + (2.0 / pow(x, 3.0)))) + (2.0 / pow(x, 4.0))))));
}
return tmp;
}
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt(2.0) * t;
double t_2 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double t_3 = (x + 1.0) / (x + -1.0);
double t_4 = t_1 / Math.sqrt(((t_3 * ((l * l) + (2.0 * (t * t)))) - (l * l)));
double tmp;
if (t_4 <= -1.0) {
tmp = -t_2;
} else if (t_4 <= 5e-79) {
tmp = t_1 * (1.0 / Math.hypot((t_1 * Math.sqrt(t_3)), l));
} else if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = t * ((Math.sqrt(2.0) / l) * -Math.sqrt((1.0 / (((2.0 / x) + ((2.0 / (x * x)) + (2.0 / Math.pow(x, 3.0)))) + (2.0 / Math.pow(x, 4.0))))));
}
return tmp;
}
def code(x, l, t): t_1 = math.sqrt(2.0) * t t_2 = math.sqrt(((x + -1.0) / (x + 1.0))) t_3 = (x + 1.0) / (x + -1.0) t_4 = t_1 / math.sqrt(((t_3 * ((l * l) + (2.0 * (t * t)))) - (l * l))) tmp = 0 if t_4 <= -1.0: tmp = -t_2 elif t_4 <= 5e-79: tmp = t_1 * (1.0 / math.hypot((t_1 * math.sqrt(t_3)), l)) elif t_4 <= math.inf: tmp = t_2 else: tmp = t * ((math.sqrt(2.0) / l) * -math.sqrt((1.0 / (((2.0 / x) + ((2.0 / (x * x)) + (2.0 / math.pow(x, 3.0)))) + (2.0 / math.pow(x, 4.0)))))) return tmp
function code(x, l, t) t_1 = Float64(sqrt(2.0) * t) t_2 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) t_3 = Float64(Float64(x + 1.0) / Float64(x + -1.0)) t_4 = Float64(t_1 / sqrt(Float64(Float64(t_3 * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) tmp = 0.0 if (t_4 <= -1.0) tmp = Float64(-t_2); elseif (t_4 <= 5e-79) tmp = Float64(t_1 * Float64(1.0 / hypot(Float64(t_1 * sqrt(t_3)), l))); elseif (t_4 <= Inf) tmp = t_2; else tmp = Float64(t * Float64(Float64(sqrt(2.0) / l) * Float64(-sqrt(Float64(1.0 / Float64(Float64(Float64(2.0 / x) + Float64(Float64(2.0 / Float64(x * x)) + Float64(2.0 / (x ^ 3.0)))) + Float64(2.0 / (x ^ 4.0)))))))); end return tmp end
function tmp_2 = code(x, l, t) t_1 = sqrt(2.0) * t; t_2 = sqrt(((x + -1.0) / (x + 1.0))); t_3 = (x + 1.0) / (x + -1.0); t_4 = t_1 / sqrt(((t_3 * ((l * l) + (2.0 * (t * t)))) - (l * l))); tmp = 0.0; if (t_4 <= -1.0) tmp = -t_2; elseif (t_4 <= 5e-79) tmp = t_1 * (1.0 / hypot((t_1 * sqrt(t_3)), l)); elseif (t_4 <= Inf) tmp = t_2; else tmp = t * ((sqrt(2.0) / l) * -sqrt((1.0 / (((2.0 / x) + ((2.0 / (x * x)) + (2.0 / (x ^ 3.0)))) + (2.0 / (x ^ 4.0)))))); end tmp_2 = tmp; end
code[x_, l_, t_] := Block[{t$95$1 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 / N[Sqrt[N[(N[(t$95$3 * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -1.0], (-t$95$2), If[LessEqual[t$95$4, 5e-79], N[(t$95$1 * N[(1.0 / N[Sqrt[N[(t$95$1 * N[Sqrt[t$95$3], $MachinePrecision]), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$2, N[(t * N[(N[(N[Sqrt[2.0], $MachinePrecision] / l), $MachinePrecision] * (-N[Sqrt[N[(1.0 / N[(N[(N[(2.0 / x), $MachinePrecision] + N[(N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(2.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 / N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{2} \cdot t\\
t_2 := \sqrt{\frac{x + -1}{x + 1}}\\
t_3 := \frac{x + 1}{x + -1}\\
t_4 := \frac{t_1}{\sqrt{t_3 \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}\\
\mathbf{if}\;t_4 \leq -1:\\
\;\;\;\;-t_2\\
\mathbf{elif}\;t_4 \leq 5 \cdot 10^{-79}:\\
\;\;\;\;t_1 \cdot \frac{1}{\mathsf{hypot}\left(t_1 \cdot \sqrt{t_3}, \ell\right)}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{\sqrt{2}}{\ell} \cdot \left(-\sqrt{\frac{1}{\left(\frac{2}{x} + \left(\frac{2}{x \cdot x} + \frac{2}{{x}^{3}}\right)\right) + \frac{2}{{x}^{4}}}}\right)\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -1Initial program 57.2%
associate-/l*57.1%
fma-neg57.1%
remove-double-neg57.1%
fma-neg57.1%
sub-neg57.1%
metadata-eval57.1%
remove-double-neg57.1%
fma-def57.1%
Simplified57.1%
Applied egg-rr66.8%
Taylor expanded in t around -inf 81.6%
mul-1-neg81.6%
sub-neg81.6%
metadata-eval81.6%
Simplified81.6%
if -1 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 4.99999999999999999e-79Initial program 5.9%
associate-/l*5.9%
fma-neg5.9%
remove-double-neg5.9%
fma-neg5.9%
sub-neg5.9%
metadata-eval5.9%
remove-double-neg5.9%
fma-def5.9%
Simplified5.9%
Applied egg-rr98.1%
Taylor expanded in l around 0 98.1%
if 4.99999999999999999e-79 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0Initial program 56.8%
associate-/l*56.8%
fma-neg56.8%
remove-double-neg56.8%
fma-neg56.8%
sub-neg56.8%
metadata-eval56.8%
remove-double-neg56.8%
fma-def56.8%
Simplified56.8%
Applied egg-rr65.8%
Taylor expanded in t around inf 84.4%
if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) Initial program 0.0%
associate-*l/0.0%
Simplified0.0%
Taylor expanded in l around -inf 4.9%
associate-*r*4.9%
mul-1-neg4.9%
associate--l+4.9%
sub-neg4.9%
metadata-eval4.9%
+-commutative4.9%
sub-neg4.9%
sub-neg4.9%
metadata-eval4.9%
+-commutative4.9%
metadata-eval4.9%
Simplified4.9%
Taylor expanded in x around inf 55.1%
+-commutative55.1%
associate-*r/55.1%
metadata-eval55.1%
+-commutative55.1%
associate-*r/55.1%
metadata-eval55.1%
unpow255.1%
associate-*r/55.1%
metadata-eval55.1%
associate-*r/55.1%
metadata-eval55.1%
Simplified55.1%
Final simplification79.9%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* (sqrt 2.0) t))
(t_2 (sqrt (/ (+ x -1.0) (+ x 1.0))))
(t_3 (/ (+ x 1.0) (+ x -1.0)))
(t_4 (/ t_1 (sqrt (- (* t_3 (+ (* l l) (* 2.0 (* t t)))) (* l l))))))
(if (<= t_4 -1.0)
(- t_2)
(if (<= t_4 5e-79)
(* t_1 (/ 1.0 (hypot (* t_1 (sqrt t_3)) l)))
(if (<= t_4 INFINITY)
t_2
(*
t
(*
(/ (sqrt 2.0) l)
(- (sqrt (/ 1.0 (+ (/ 2.0 x) (/ 2.0 (* x x)))))))))))))
double code(double x, double l, double t) {
double t_1 = sqrt(2.0) * t;
double t_2 = sqrt(((x + -1.0) / (x + 1.0)));
double t_3 = (x + 1.0) / (x + -1.0);
double t_4 = t_1 / sqrt(((t_3 * ((l * l) + (2.0 * (t * t)))) - (l * l)));
double tmp;
if (t_4 <= -1.0) {
tmp = -t_2;
} else if (t_4 <= 5e-79) {
tmp = t_1 * (1.0 / hypot((t_1 * sqrt(t_3)), l));
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = t * ((sqrt(2.0) / l) * -sqrt((1.0 / ((2.0 / x) + (2.0 / (x * x))))));
}
return tmp;
}
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt(2.0) * t;
double t_2 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double t_3 = (x + 1.0) / (x + -1.0);
double t_4 = t_1 / Math.sqrt(((t_3 * ((l * l) + (2.0 * (t * t)))) - (l * l)));
double tmp;
if (t_4 <= -1.0) {
tmp = -t_2;
} else if (t_4 <= 5e-79) {
tmp = t_1 * (1.0 / Math.hypot((t_1 * Math.sqrt(t_3)), l));
} else if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = t * ((Math.sqrt(2.0) / l) * -Math.sqrt((1.0 / ((2.0 / x) + (2.0 / (x * x))))));
}
return tmp;
}
def code(x, l, t): t_1 = math.sqrt(2.0) * t t_2 = math.sqrt(((x + -1.0) / (x + 1.0))) t_3 = (x + 1.0) / (x + -1.0) t_4 = t_1 / math.sqrt(((t_3 * ((l * l) + (2.0 * (t * t)))) - (l * l))) tmp = 0 if t_4 <= -1.0: tmp = -t_2 elif t_4 <= 5e-79: tmp = t_1 * (1.0 / math.hypot((t_1 * math.sqrt(t_3)), l)) elif t_4 <= math.inf: tmp = t_2 else: tmp = t * ((math.sqrt(2.0) / l) * -math.sqrt((1.0 / ((2.0 / x) + (2.0 / (x * x)))))) return tmp
function code(x, l, t) t_1 = Float64(sqrt(2.0) * t) t_2 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) t_3 = Float64(Float64(x + 1.0) / Float64(x + -1.0)) t_4 = Float64(t_1 / sqrt(Float64(Float64(t_3 * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) tmp = 0.0 if (t_4 <= -1.0) tmp = Float64(-t_2); elseif (t_4 <= 5e-79) tmp = Float64(t_1 * Float64(1.0 / hypot(Float64(t_1 * sqrt(t_3)), l))); elseif (t_4 <= Inf) tmp = t_2; else tmp = Float64(t * Float64(Float64(sqrt(2.0) / l) * Float64(-sqrt(Float64(1.0 / Float64(Float64(2.0 / x) + Float64(2.0 / Float64(x * x)))))))); end return tmp end
function tmp_2 = code(x, l, t) t_1 = sqrt(2.0) * t; t_2 = sqrt(((x + -1.0) / (x + 1.0))); t_3 = (x + 1.0) / (x + -1.0); t_4 = t_1 / sqrt(((t_3 * ((l * l) + (2.0 * (t * t)))) - (l * l))); tmp = 0.0; if (t_4 <= -1.0) tmp = -t_2; elseif (t_4 <= 5e-79) tmp = t_1 * (1.0 / hypot((t_1 * sqrt(t_3)), l)); elseif (t_4 <= Inf) tmp = t_2; else tmp = t * ((sqrt(2.0) / l) * -sqrt((1.0 / ((2.0 / x) + (2.0 / (x * x)))))); end tmp_2 = tmp; end
code[x_, l_, t_] := Block[{t$95$1 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 / N[Sqrt[N[(N[(t$95$3 * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -1.0], (-t$95$2), If[LessEqual[t$95$4, 5e-79], N[(t$95$1 * N[(1.0 / N[Sqrt[N[(t$95$1 * N[Sqrt[t$95$3], $MachinePrecision]), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$2, N[(t * N[(N[(N[Sqrt[2.0], $MachinePrecision] / l), $MachinePrecision] * (-N[Sqrt[N[(1.0 / N[(N[(2.0 / x), $MachinePrecision] + N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{2} \cdot t\\
t_2 := \sqrt{\frac{x + -1}{x + 1}}\\
t_3 := \frac{x + 1}{x + -1}\\
t_4 := \frac{t_1}{\sqrt{t_3 \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}\\
\mathbf{if}\;t_4 \leq -1:\\
\;\;\;\;-t_2\\
\mathbf{elif}\;t_4 \leq 5 \cdot 10^{-79}:\\
\;\;\;\;t_1 \cdot \frac{1}{\mathsf{hypot}\left(t_1 \cdot \sqrt{t_3}, \ell\right)}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{\sqrt{2}}{\ell} \cdot \left(-\sqrt{\frac{1}{\frac{2}{x} + \frac{2}{x \cdot x}}}\right)\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -1Initial program 57.2%
associate-/l*57.1%
fma-neg57.1%
remove-double-neg57.1%
fma-neg57.1%
sub-neg57.1%
metadata-eval57.1%
remove-double-neg57.1%
fma-def57.1%
Simplified57.1%
Applied egg-rr66.8%
Taylor expanded in t around -inf 81.6%
mul-1-neg81.6%
sub-neg81.6%
metadata-eval81.6%
Simplified81.6%
if -1 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 4.99999999999999999e-79Initial program 5.9%
associate-/l*5.9%
fma-neg5.9%
remove-double-neg5.9%
fma-neg5.9%
sub-neg5.9%
metadata-eval5.9%
remove-double-neg5.9%
fma-def5.9%
Simplified5.9%
Applied egg-rr98.1%
Taylor expanded in l around 0 98.1%
if 4.99999999999999999e-79 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0Initial program 56.8%
associate-/l*56.8%
fma-neg56.8%
remove-double-neg56.8%
fma-neg56.8%
sub-neg56.8%
metadata-eval56.8%
remove-double-neg56.8%
fma-def56.8%
Simplified56.8%
Applied egg-rr65.8%
Taylor expanded in t around inf 84.4%
if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) Initial program 0.0%
associate-*l/0.0%
Simplified0.0%
Taylor expanded in l around -inf 4.9%
associate-*r*4.9%
mul-1-neg4.9%
associate--l+4.9%
sub-neg4.9%
metadata-eval4.9%
+-commutative4.9%
sub-neg4.9%
sub-neg4.9%
metadata-eval4.9%
+-commutative4.9%
metadata-eval4.9%
Simplified4.9%
Taylor expanded in x around inf 54.5%
associate-*r/54.5%
metadata-eval54.5%
unpow254.5%
associate-*r/54.5%
metadata-eval54.5%
Simplified54.5%
Final simplification79.8%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -1.25e-146)
(/ (sqrt 2.0) (* (- (sqrt 2.0)) (sqrt (/ (+ x 1.0) (+ x -1.0)))))
(if (<= t -1.6e-219)
(/ (sqrt 2.0) (/ (sqrt (/ (+ (* l l) (* l l)) x)) t))
(if (<= t -5e-310) (- t_1) t_1)))))
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -1.25e-146) {
tmp = sqrt(2.0) / (-sqrt(2.0) * sqrt(((x + 1.0) / (x + -1.0))));
} else if (t <= -1.6e-219) {
tmp = sqrt(2.0) / (sqrt((((l * l) + (l * l)) / x)) / t);
} else if (t <= -5e-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(((x + (-1.0d0)) / (x + 1.0d0)))
if (t <= (-1.25d-146)) then
tmp = sqrt(2.0d0) / (-sqrt(2.0d0) * sqrt(((x + 1.0d0) / (x + (-1.0d0)))))
else if (t <= (-1.6d-219)) then
tmp = sqrt(2.0d0) / (sqrt((((l * l) + (l * l)) / x)) / t)
else if (t <= (-5d-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(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -1.25e-146) {
tmp = Math.sqrt(2.0) / (-Math.sqrt(2.0) * Math.sqrt(((x + 1.0) / (x + -1.0))));
} else if (t <= -1.6e-219) {
tmp = Math.sqrt(2.0) / (Math.sqrt((((l * l) + (l * l)) / x)) / t);
} else if (t <= -5e-310) {
tmp = -t_1;
} 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 <= -1.25e-146: tmp = math.sqrt(2.0) / (-math.sqrt(2.0) * math.sqrt(((x + 1.0) / (x + -1.0)))) elif t <= -1.6e-219: tmp = math.sqrt(2.0) / (math.sqrt((((l * l) + (l * l)) / x)) / t) elif t <= -5e-310: tmp = -t_1 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 <= -1.25e-146) tmp = Float64(sqrt(2.0) / Float64(Float64(-sqrt(2.0)) * sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0))))); elseif (t <= -1.6e-219) tmp = Float64(sqrt(2.0) / Float64(sqrt(Float64(Float64(Float64(l * l) + Float64(l * l)) / x)) / t)); elseif (t <= -5e-310) tmp = Float64(-t_1); 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 <= -1.25e-146) tmp = sqrt(2.0) / (-sqrt(2.0) * sqrt(((x + 1.0) / (x + -1.0)))); elseif (t <= -1.6e-219) tmp = sqrt(2.0) / (sqrt((((l * l) + (l * l)) / x)) / t); elseif (t <= -5e-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[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -1.25e-146], N[(N[Sqrt[2.0], $MachinePrecision] / N[((-N[Sqrt[2.0], $MachinePrecision]) * N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.6e-219], N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[Sqrt[N[(N[(N[(l * l), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -5e-310], (-t$95$1), t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -1.25 \cdot 10^{-146}:\\
\;\;\;\;\frac{\sqrt{2}}{\left(-\sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\
\mathbf{elif}\;t \leq -1.6 \cdot 10^{-219}:\\
\;\;\;\;\frac{\sqrt{2}}{\frac{\sqrt{\frac{\ell \cdot \ell + \ell \cdot \ell}{x}}}{t}}\\
\mathbf{elif}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-t_1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.24999999999999989e-146Initial program 42.2%
associate-/l*42.2%
fma-neg42.2%
remove-double-neg42.2%
fma-neg42.2%
sub-neg42.2%
metadata-eval42.2%
remove-double-neg42.2%
fma-def42.2%
Simplified42.2%
Taylor expanded in t around -inf 80.9%
associate-*r*80.9%
neg-mul-180.9%
+-commutative80.9%
sub-neg80.9%
metadata-eval80.9%
+-commutative80.9%
Simplified80.9%
if -1.24999999999999989e-146 < t < -1.59999999999999999e-219Initial program 1.5%
associate-/l*1.5%
fma-neg1.5%
remove-double-neg1.5%
fma-neg1.5%
sub-neg1.5%
metadata-eval1.5%
remove-double-neg1.5%
fma-def1.5%
Simplified1.5%
Taylor expanded in t around 0 1.6%
associate-*l/1.6%
*-lft-identity1.6%
*-commutative1.6%
unpow21.6%
+-commutative1.6%
sub-neg1.6%
metadata-eval1.6%
+-commutative1.6%
unpow21.6%
Simplified1.6%
Taylor expanded in x around inf 65.8%
unpow265.8%
neg-mul-165.8%
unpow265.8%
distribute-rgt-neg-in65.8%
Simplified65.8%
if -1.59999999999999999e-219 < t < -4.999999999999985e-310Initial program 2.5%
associate-/l*2.5%
fma-neg2.5%
remove-double-neg2.5%
fma-neg2.5%
sub-neg2.5%
metadata-eval2.5%
remove-double-neg2.5%
fma-def2.5%
Simplified2.5%
Applied egg-rr41.7%
Taylor expanded in t around -inf 56.2%
mul-1-neg56.2%
sub-neg56.2%
metadata-eval56.2%
Simplified56.2%
if -4.999999999999985e-310 < t Initial program 31.8%
associate-/l*31.8%
fma-neg31.8%
remove-double-neg31.8%
fma-neg31.8%
sub-neg31.8%
metadata-eval31.8%
remove-double-neg31.8%
fma-def31.8%
Simplified31.8%
Applied egg-rr67.3%
Taylor expanded in t around inf 80.0%
Final simplification78.2%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))) (t_2 (- t_1)))
(if (<= t -9.1e-147)
t_2
(if (<= t -3.1e-228)
(/ (sqrt 2.0) (/ (sqrt (/ (+ (* l l) (* l l)) x)) t))
(if (<= t -5e-310) t_2 t_1)))))
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
double t_2 = -t_1;
double tmp;
if (t <= -9.1e-147) {
tmp = t_2;
} else if (t <= -3.1e-228) {
tmp = sqrt(2.0) / (sqrt((((l * l) + (l * l)) / x)) / t);
} else if (t <= -5e-310) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
t_2 = -t_1
if (t <= (-9.1d-147)) then
tmp = t_2
else if (t <= (-3.1d-228)) then
tmp = sqrt(2.0d0) / (sqrt((((l * l) + (l * l)) / x)) / t)
else if (t <= (-5d-310)) then
tmp = t_2
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 t_2 = -t_1;
double tmp;
if (t <= -9.1e-147) {
tmp = t_2;
} else if (t <= -3.1e-228) {
tmp = Math.sqrt(2.0) / (Math.sqrt((((l * l) + (l * l)) / x)) / t);
} else if (t <= -5e-310) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, l, t): t_1 = math.sqrt(((x + -1.0) / (x + 1.0))) t_2 = -t_1 tmp = 0 if t <= -9.1e-147: tmp = t_2 elif t <= -3.1e-228: tmp = math.sqrt(2.0) / (math.sqrt((((l * l) + (l * l)) / x)) / t) elif t <= -5e-310: tmp = t_2 else: tmp = t_1 return tmp
function code(x, l, t) t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) t_2 = Float64(-t_1) tmp = 0.0 if (t <= -9.1e-147) tmp = t_2; elseif (t <= -3.1e-228) tmp = Float64(sqrt(2.0) / Float64(sqrt(Float64(Float64(Float64(l * l) + Float64(l * l)) / x)) / t)); elseif (t <= -5e-310) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, l, t) t_1 = sqrt(((x + -1.0) / (x + 1.0))); t_2 = -t_1; tmp = 0.0; if (t <= -9.1e-147) tmp = t_2; elseif (t <= -3.1e-228) tmp = sqrt(2.0) / (sqrt((((l * l) + (l * l)) / x)) / t); elseif (t <= -5e-310) tmp = t_2; 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]}, Block[{t$95$2 = (-t$95$1)}, If[LessEqual[t, -9.1e-147], t$95$2, If[LessEqual[t, -3.1e-228], N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[Sqrt[N[(N[(N[(l * l), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -5e-310], t$95$2, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
t_2 := -t_1\\
\mathbf{if}\;t \leq -9.1 \cdot 10^{-147}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -3.1 \cdot 10^{-228}:\\
\;\;\;\;\frac{\sqrt{2}}{\frac{\sqrt{\frac{\ell \cdot \ell + \ell \cdot \ell}{x}}}{t}}\\
\mathbf{elif}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -9.09999999999999954e-147 or -3.0999999999999998e-228 < t < -4.999999999999985e-310Initial program 37.0%
associate-/l*37.0%
fma-neg37.0%
remove-double-neg37.0%
fma-neg37.0%
sub-neg37.0%
metadata-eval37.0%
remove-double-neg37.0%
fma-def37.0%
Simplified37.0%
Applied egg-rr69.2%
Taylor expanded in t around -inf 77.6%
mul-1-neg77.6%
sub-neg77.6%
metadata-eval77.6%
Simplified77.6%
if -9.09999999999999954e-147 < t < -3.0999999999999998e-228Initial program 1.5%
associate-/l*1.5%
fma-neg1.5%
remove-double-neg1.5%
fma-neg1.5%
sub-neg1.5%
metadata-eval1.5%
remove-double-neg1.5%
fma-def1.5%
Simplified1.5%
Taylor expanded in t around 0 1.6%
associate-*l/1.6%
*-lft-identity1.6%
*-commutative1.6%
unpow21.6%
+-commutative1.6%
sub-neg1.6%
metadata-eval1.6%
+-commutative1.6%
unpow21.6%
Simplified1.6%
Taylor expanded in x around inf 65.8%
unpow265.8%
neg-mul-165.8%
unpow265.8%
distribute-rgt-neg-in65.8%
Simplified65.8%
if -4.999999999999985e-310 < t Initial program 31.8%
associate-/l*31.8%
fma-neg31.8%
remove-double-neg31.8%
fma-neg31.8%
sub-neg31.8%
metadata-eval31.8%
remove-double-neg31.8%
fma-def31.8%
Simplified31.8%
Applied egg-rr67.3%
Taylor expanded in t around inf 80.0%
Final simplification78.2%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -9.2e-147)
(- t_1)
(if (<= t -3.6e-242)
(* t (* (/ (sqrt 2.0) l) (- (sqrt (/ 1.0 (/ 2.0 x))))))
(if (<= t -5e-310) -1.0 t_1)))))
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -9.2e-147) {
tmp = -t_1;
} else if (t <= -3.6e-242) {
tmp = t * ((sqrt(2.0) / l) * -sqrt((1.0 / (2.0 / x))));
} else if (t <= -5e-310) {
tmp = -1.0;
} 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 <= (-9.2d-147)) then
tmp = -t_1
else if (t <= (-3.6d-242)) then
tmp = t * ((sqrt(2.0d0) / l) * -sqrt((1.0d0 / (2.0d0 / x))))
else if (t <= (-5d-310)) then
tmp = -1.0d0
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 <= -9.2e-147) {
tmp = -t_1;
} else if (t <= -3.6e-242) {
tmp = t * ((Math.sqrt(2.0) / l) * -Math.sqrt((1.0 / (2.0 / x))));
} else if (t <= -5e-310) {
tmp = -1.0;
} 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 <= -9.2e-147: tmp = -t_1 elif t <= -3.6e-242: tmp = t * ((math.sqrt(2.0) / l) * -math.sqrt((1.0 / (2.0 / x)))) elif t <= -5e-310: tmp = -1.0 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 <= -9.2e-147) tmp = Float64(-t_1); elseif (t <= -3.6e-242) tmp = Float64(t * Float64(Float64(sqrt(2.0) / l) * Float64(-sqrt(Float64(1.0 / Float64(2.0 / x)))))); elseif (t <= -5e-310) tmp = -1.0; 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 <= -9.2e-147) tmp = -t_1; elseif (t <= -3.6e-242) tmp = t * ((sqrt(2.0) / l) * -sqrt((1.0 / (2.0 / x)))); elseif (t <= -5e-310) tmp = -1.0; 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, -9.2e-147], (-t$95$1), If[LessEqual[t, -3.6e-242], N[(t * N[(N[(N[Sqrt[2.0], $MachinePrecision] / l), $MachinePrecision] * (-N[Sqrt[N[(1.0 / N[(2.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -5e-310], -1.0, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -9.2 \cdot 10^{-147}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq -3.6 \cdot 10^{-242}:\\
\;\;\;\;t \cdot \left(\frac{\sqrt{2}}{\ell} \cdot \left(-\sqrt{\frac{1}{\frac{2}{x}}}\right)\right)\\
\mathbf{elif}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -9.19999999999999962e-147Initial program 42.2%
associate-/l*42.2%
fma-neg42.2%
remove-double-neg42.2%
fma-neg42.2%
sub-neg42.2%
metadata-eval42.2%
remove-double-neg42.2%
fma-def42.2%
Simplified42.2%
Applied egg-rr73.4%
Taylor expanded in t around -inf 80.9%
mul-1-neg80.9%
sub-neg80.9%
metadata-eval80.9%
Simplified80.9%
if -9.19999999999999962e-147 < t < -3.60000000000000014e-242Initial program 1.8%
associate-*l/1.8%
Simplified1.8%
Taylor expanded in l around -inf 1.6%
associate-*r*1.6%
mul-1-neg1.6%
associate--l+1.6%
sub-neg1.6%
metadata-eval1.6%
+-commutative1.6%
sub-neg1.6%
sub-neg1.6%
metadata-eval1.6%
+-commutative1.6%
metadata-eval1.6%
Simplified1.6%
Taylor expanded in x around inf 56.8%
if -3.60000000000000014e-242 < t < -4.999999999999985e-310Initial program 2.4%
associate-/l*2.4%
fma-neg2.4%
remove-double-neg2.4%
fma-neg2.4%
sub-neg2.4%
metadata-eval2.4%
remove-double-neg2.4%
fma-def2.4%
Simplified2.4%
Applied egg-rr46.0%
Taylor expanded in t around inf 1.9%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt65.2%
Simplified65.2%
if -4.999999999999985e-310 < t Initial program 31.8%
associate-/l*31.8%
fma-neg31.8%
remove-double-neg31.8%
fma-neg31.8%
sub-neg31.8%
metadata-eval31.8%
remove-double-neg31.8%
fma-def31.8%
Simplified31.8%
Applied egg-rr67.3%
Taylor expanded in t around inf 80.0%
Final simplification78.1%
(FPCore (x l t) :precision binary64 (let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0))))) (if (<= t -5e-310) (- t_1) t_1)))
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -5e-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(((x + (-1.0d0)) / (x + 1.0d0)))
if (t <= (-5d-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(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -5e-310) {
tmp = -t_1;
} 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 <= -5e-310: tmp = -t_1 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 <= -5e-310) tmp = Float64(-t_1); 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 <= -5e-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[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -5e-310], (-t$95$1), t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-t_1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 33.1%
associate-/l*33.1%
fma-neg33.1%
remove-double-neg33.1%
fma-neg33.1%
sub-neg33.1%
metadata-eval33.1%
remove-double-neg33.1%
fma-def33.1%
Simplified33.1%
Applied egg-rr68.3%
Taylor expanded in t around -inf 72.6%
mul-1-neg72.6%
sub-neg72.6%
metadata-eval72.6%
Simplified72.6%
if -4.999999999999985e-310 < t Initial program 31.8%
associate-/l*31.8%
fma-neg31.8%
remove-double-neg31.8%
fma-neg31.8%
sub-neg31.8%
metadata-eval31.8%
remove-double-neg31.8%
fma-def31.8%
Simplified31.8%
Applied egg-rr67.3%
Taylor expanded in t around inf 80.0%
Final simplification76.3%
(FPCore (x l t) :precision binary64 (if (<= t -5e-310) (+ -1.0 (/ 1.0 x)) (sqrt (/ (+ x -1.0) (+ x 1.0)))))
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0 + (1.0 / 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 <= (-5d-310)) then
tmp = (-1.0d0) + (1.0d0 / 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 <= -5e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = -1.0 + (1.0 / x) else: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -5e-310) tmp = Float64(-1.0 + Float64(1.0 / 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 <= -5e-310) tmp = -1.0 + (1.0 / x); else tmp = sqrt(((x + -1.0) / (x + 1.0))); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -5e-310], N[(-1.0 + N[(1.0 / 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 -5 \cdot 10^{-310}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 33.1%
associate-/l*33.1%
fma-neg33.1%
remove-double-neg33.1%
fma-neg33.1%
sub-neg33.1%
metadata-eval33.1%
remove-double-neg33.1%
fma-def33.1%
Simplified33.1%
Applied egg-rr68.3%
Taylor expanded in t around inf 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt72.1%
Simplified72.1%
if -4.999999999999985e-310 < t Initial program 31.8%
associate-/l*31.8%
fma-neg31.8%
remove-double-neg31.8%
fma-neg31.8%
sub-neg31.8%
metadata-eval31.8%
remove-double-neg31.8%
fma-def31.8%
Simplified31.8%
Applied egg-rr67.3%
Taylor expanded in t around inf 80.0%
Final simplification76.0%
(FPCore (x l t) :precision binary64 (if (<= t -5e-310) (+ -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 <= -5e-310) {
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 <= (-5d-310)) 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 <= -5e-310) {
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 <= -5e-310: 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 <= -5e-310) tmp = Float64(-1.0 + Float64(1.0 / x)); else tmp = Float64(1.0 + Float64(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 <= -5e-310) 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, -5e-310], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 33.1%
associate-/l*33.1%
fma-neg33.1%
remove-double-neg33.1%
fma-neg33.1%
sub-neg33.1%
metadata-eval33.1%
remove-double-neg33.1%
fma-def33.1%
Simplified33.1%
Applied egg-rr68.3%
Taylor expanded in t around inf 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt72.1%
Simplified72.1%
if -4.999999999999985e-310 < t Initial program 31.8%
associate-/l*31.8%
fma-neg31.8%
remove-double-neg31.8%
fma-neg31.8%
sub-neg31.8%
metadata-eval31.8%
remove-double-neg31.8%
fma-def31.8%
Simplified31.8%
Applied egg-rr67.3%
Taylor expanded in t around inf 80.0%
Taylor expanded in x around inf 79.6%
associate--l+79.6%
associate-*r/79.6%
metadata-eval79.6%
unpow279.6%
Simplified79.6%
Final simplification75.8%
(FPCore (x l t) :precision binary64 (if (<= t -5e-310) (+ -1.0 (/ 1.0 x)) 1.0))
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
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 <= (-5d-310)) 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 <= -5e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = -1.0 + (1.0 / x) else: tmp = 1.0 return tmp
function code(x, l, t) tmp = 0.0 if (t <= -5e-310) 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 <= -5e-310) tmp = -1.0 + (1.0 / x); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -5e-310], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 33.1%
associate-/l*33.1%
fma-neg33.1%
remove-double-neg33.1%
fma-neg33.1%
sub-neg33.1%
metadata-eval33.1%
remove-double-neg33.1%
fma-def33.1%
Simplified33.1%
Applied egg-rr68.3%
Taylor expanded in t around inf 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt72.1%
Simplified72.1%
if -4.999999999999985e-310 < t Initial program 31.8%
associate-/l*31.8%
fma-neg31.8%
remove-double-neg31.8%
fma-neg31.8%
sub-neg31.8%
metadata-eval31.8%
remove-double-neg31.8%
fma-def31.8%
Simplified31.8%
Applied egg-rr67.3%
Taylor expanded in t around inf 80.0%
Taylor expanded in x around inf 78.9%
Final simplification75.5%
(FPCore (x l t) :precision binary64 (if (<= t -5e-310) (+ -1.0 (/ 1.0 x)) (+ 1.0 (/ -1.0 x))))
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
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 <= (-5d-310)) 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 <= -5e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -5e-310: 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 <= -5e-310) 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 <= -5e-310) 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, -5e-310], 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 -5 \cdot 10^{-310}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 33.1%
associate-/l*33.1%
fma-neg33.1%
remove-double-neg33.1%
fma-neg33.1%
sub-neg33.1%
metadata-eval33.1%
remove-double-neg33.1%
fma-def33.1%
Simplified33.1%
Applied egg-rr68.3%
Taylor expanded in t around inf 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt72.1%
Simplified72.1%
if -4.999999999999985e-310 < t Initial program 31.8%
associate-/l*31.8%
fma-neg31.8%
remove-double-neg31.8%
fma-neg31.8%
sub-neg31.8%
metadata-eval31.8%
remove-double-neg31.8%
fma-def31.8%
Simplified31.8%
Applied egg-rr67.3%
Taylor expanded in t around inf 80.0%
Taylor expanded in x around inf 79.4%
Final simplification75.7%
(FPCore (x l t) :precision binary64 (if (<= t -5e-310) -1.0 1.0))
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-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 <= (-5d-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 <= -5e-310) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = -1.0 else: tmp = 1.0 return tmp
function code(x, l, t) tmp = 0.0 if (t <= -5e-310) tmp = -1.0; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-310) tmp = -1.0; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -5e-310], -1.0, 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 33.1%
associate-/l*33.1%
fma-neg33.1%
remove-double-neg33.1%
fma-neg33.1%
sub-neg33.1%
metadata-eval33.1%
remove-double-neg33.1%
fma-def33.1%
Simplified33.1%
Applied egg-rr68.3%
Taylor expanded in t around inf 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt71.0%
Simplified71.0%
if -4.999999999999985e-310 < t Initial program 31.8%
associate-/l*31.8%
fma-neg31.8%
remove-double-neg31.8%
fma-neg31.8%
sub-neg31.8%
metadata-eval31.8%
remove-double-neg31.8%
fma-def31.8%
Simplified31.8%
Applied egg-rr67.3%
Taylor expanded in t around inf 80.0%
Taylor expanded in x around inf 78.9%
Final simplification74.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 32.5%
associate-/l*32.5%
fma-neg32.5%
remove-double-neg32.5%
fma-neg32.5%
sub-neg32.5%
metadata-eval32.5%
remove-double-neg32.5%
fma-def32.5%
Simplified32.5%
Applied egg-rr67.8%
Taylor expanded in t around inf 40.9%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt36.3%
Simplified36.3%
Final simplification36.3%
herbie shell --seed 2023189
(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)))))