
(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 13 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}
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (* l l) x)) (t_2 (* 2.0 (+ (* t t) (/ (* t t) x)))))
(if (<= t -2.16e+49)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t -2.4e-160)
(*
t
(/ (sqrt 2.0) (sqrt (+ t_1 (+ t_2 (/ (fma (* 2.0 t) t (* l l)) x))))))
(if (<= t 1.36e-203)
(* t (/ (sqrt x) l))
(if (<= t 3.1e+46)
(* t (/ (sqrt 2.0) (sqrt (+ t_1 (+ t_1 t_2)))))
(- 1.0 (/ 1.0 x))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = (l * l) / x;
double t_2 = 2.0 * ((t * t) + ((t * t) / x));
double tmp;
if (t <= -2.16e+49) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= -2.4e-160) {
tmp = t * (sqrt(2.0) / sqrt((t_1 + (t_2 + (fma((2.0 * t), t, (l * l)) / x)))));
} else if (t <= 1.36e-203) {
tmp = t * (sqrt(x) / l);
} else if (t <= 3.1e+46) {
tmp = t * (sqrt(2.0) / sqrt((t_1 + (t_1 + t_2))));
} else {
tmp = 1.0 - (1.0 / x);
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(Float64(l * l) / x) t_2 = Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x))) tmp = 0.0 if (t <= -2.16e+49) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= -2.4e-160) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(t_1 + Float64(t_2 + Float64(fma(Float64(2.0 * t), t, Float64(l * l)) / x)))))); elseif (t <= 1.36e-203) tmp = Float64(t * Float64(sqrt(x) / l)); elseif (t <= 3.1e+46) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(t_1 + Float64(t_1 + t_2))))); else tmp = Float64(1.0 - Float64(1.0 / x)); end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.16e+49], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, -2.4e-160], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(t$95$1 + N[(t$95$2 + N[(N[(N[(2.0 * t), $MachinePrecision] * t + N[(l * l), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.36e-203], N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.1e+46], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(t$95$1 + N[(t$95$1 + t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{x}\\
t_2 := 2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right)\\
\mathbf{if}\;t \leq -2.16 \cdot 10^{+49}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq -2.4 \cdot 10^{-160}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{t_1 + \left(t_2 + \frac{\mathsf{fma}\left(2 \cdot t, t, \ell \cdot \ell\right)}{x}\right)}}\\
\mathbf{elif}\;t \leq 1.36 \cdot 10^{-203}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{+46}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{t_1 + \left(t_1 + t_2\right)}}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{1}{x}\\
\end{array}
\end{array}
if t < -2.16000000000000003e49Initial program 32.3%
associate-*r/32.2%
fma-neg32.2%
sub-neg32.2%
metadata-eval32.2%
+-commutative32.2%
fma-def32.2%
distribute-rgt-neg-in32.2%
Simplified32.2%
Applied egg-rr88.3%
Taylor expanded in t around -inf 100.0%
mul-1-neg100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
if -2.16000000000000003e49 < t < -2.39999999999999991e-160Initial program 54.3%
associate-*l/54.4%
Simplified54.4%
Taylor expanded in x around inf 84.6%
associate--l+84.6%
unpow284.6%
distribute-lft-out84.6%
unpow284.6%
unpow284.6%
associate-*r/84.6%
mul-1-neg84.6%
+-commutative84.6%
unpow284.6%
associate-*l*84.6%
unpow284.6%
fma-udef84.6%
Simplified84.6%
if -2.39999999999999991e-160 < t < 1.3600000000000001e-203Initial program 5.5%
associate-*l/5.5%
Simplified5.5%
Taylor expanded in x around inf 61.6%
associate--l+61.6%
unpow261.6%
distribute-lft-out61.6%
unpow261.6%
unpow261.6%
associate-*r/61.6%
mul-1-neg61.6%
+-commutative61.6%
unpow261.6%
associate-*l*61.6%
unpow261.6%
fma-udef61.6%
Simplified61.6%
Taylor expanded in l around inf 55.5%
associate-*l*55.5%
Simplified55.5%
Taylor expanded in l around 0 55.6%
associate-*l/55.6%
*-lft-identity55.6%
Simplified55.6%
if 1.3600000000000001e-203 < t < 3.09999999999999975e46Initial program 53.1%
associate-*l/53.3%
Simplified53.3%
Taylor expanded in x around inf 82.5%
associate--l+82.5%
unpow282.5%
distribute-lft-out82.5%
unpow282.5%
unpow282.5%
associate-*r/82.5%
mul-1-neg82.5%
+-commutative82.5%
unpow282.5%
associate-*l*82.5%
unpow282.5%
fma-udef82.5%
Simplified82.5%
Taylor expanded in t around 0 82.9%
associate-*r/82.9%
mul-1-neg82.9%
unpow282.9%
distribute-rgt-neg-in82.9%
Simplified82.9%
if 3.09999999999999975e46 < t Initial program 27.8%
associate-*r/27.8%
fma-neg27.8%
sub-neg27.8%
metadata-eval27.8%
+-commutative27.8%
fma-def27.8%
distribute-rgt-neg-in27.8%
Simplified27.8%
Applied egg-rr86.6%
Taylor expanded in l around 0 95.5%
Taylor expanded in x around inf 95.5%
Final simplification85.5%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* (sqrt 2.0) t))
(t_2 (fma (* 2.0 t) t (* l l)))
(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 -2e-229)
(*
t
(/
(sqrt 2.0)
(sqrt
(+
(/ (* l l) x)
(+
(fma
2.0
(/ (* t t) (pow x 3.0))
(+
(+ (* 2.0 (+ (* t t) (/ (* t t) x))) (/ (* l l) (pow x 3.0)))
(/ (+ t_2 t_2) (* x x))))
(+ (/ t_2 (pow x 3.0)) (/ t_2 x)))))))
(if (<= t_4 5.0)
(/ (sqrt 2.0) (/ (hypot (* t_1 (sqrt t_3)) l) t))
(* t (/ (sqrt x) l))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(2.0) * t;
double t_2 = fma((2.0 * t), t, (l * l));
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 <= -2e-229) {
tmp = t * (sqrt(2.0) / sqrt((((l * l) / x) + (fma(2.0, ((t * t) / pow(x, 3.0)), (((2.0 * ((t * t) + ((t * t) / x))) + ((l * l) / pow(x, 3.0))) + ((t_2 + t_2) / (x * x)))) + ((t_2 / pow(x, 3.0)) + (t_2 / x))))));
} else if (t_4 <= 5.0) {
tmp = sqrt(2.0) / (hypot((t_1 * sqrt(t_3)), l) / t);
} else {
tmp = t * (sqrt(x) / l);
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(sqrt(2.0) * t) t_2 = fma(Float64(2.0 * t), t, Float64(l * l)) 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 <= -2e-229) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(Float64(l * l) / x) + Float64(fma(2.0, Float64(Float64(t * t) / (x ^ 3.0)), Float64(Float64(Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x))) + Float64(Float64(l * l) / (x ^ 3.0))) + Float64(Float64(t_2 + t_2) / Float64(x * x)))) + Float64(Float64(t_2 / (x ^ 3.0)) + Float64(t_2 / x))))))); elseif (t_4 <= 5.0) tmp = Float64(sqrt(2.0) / Float64(hypot(Float64(t_1 * sqrt(t_3)), l) / t)); else tmp = Float64(t * Float64(sqrt(x) / l)); end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * t), $MachinePrecision] * t + N[(l * l), $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, -2e-229], 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[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(l * l), $MachinePrecision] / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 + t$95$2), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 5.0], N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[Sqrt[N[(t$95$1 * N[Sqrt[t$95$3], $MachinePrecision]), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{2} \cdot t\\
t_2 := \mathsf{fma}\left(2 \cdot t, t, \ell \cdot \ell\right)\\
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 -2 \cdot 10^{-229}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(\mathsf{fma}\left(2, \frac{t \cdot t}{{x}^{3}}, \left(2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right) + \frac{\ell \cdot \ell}{{x}^{3}}\right) + \frac{t_2 + t_2}{x \cdot x}\right) + \left(\frac{t_2}{{x}^{3}} + \frac{t_2}{x}\right)\right)}}\\
\mathbf{elif}\;t_4 \leq 5:\\
\;\;\;\;\frac{\sqrt{2}}{\frac{\mathsf{hypot}\left(t_1 \cdot \sqrt{t_3}, \ell\right)}{t}}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\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)))) < -2.00000000000000014e-229Initial program 58.5%
associate-*l/58.6%
Simplified58.6%
Taylor expanded in x around -inf 92.6%
Simplified92.6%
if -2.00000000000000014e-229 < (/.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)))) < 5Initial program 42.7%
associate-*r/42.6%
fma-neg42.6%
sub-neg42.6%
metadata-eval42.6%
+-commutative42.6%
fma-def42.6%
distribute-rgt-neg-in42.6%
Simplified42.6%
Applied egg-rr98.9%
Taylor expanded in l around 0 98.9%
+-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
Simplified98.9%
if 5 < (/.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 1.0%
associate-*l/1.0%
Simplified1.0%
Taylor expanded in x around inf 43.8%
associate--l+43.8%
unpow243.8%
distribute-lft-out43.8%
unpow243.8%
unpow243.8%
associate-*r/43.8%
mul-1-neg43.8%
+-commutative43.8%
unpow243.8%
associate-*l*43.8%
unpow243.8%
fma-udef43.8%
Simplified43.8%
Taylor expanded in l around inf 43.7%
associate-*l*43.7%
Simplified43.7%
Taylor expanded in l around 0 43.8%
associate-*l/43.8%
*-lft-identity43.8%
Simplified43.8%
Final simplification80.8%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (* l l) x))
(t_2
(*
t
(/
(sqrt 2.0)
(sqrt (+ t_1 (+ t_1 (* 2.0 (+ (* t t) (/ (* t t) x))))))))))
(if (<= t -8.8e+50)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t -5.7e-161)
t_2
(if (<= t 1.05e-200)
(* t (/ (sqrt x) l))
(if (<= t 3.8e+43) t_2 (- 1.0 (/ 1.0 x))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = (l * l) / x;
double t_2 = t * (sqrt(2.0) / sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x)))))));
double tmp;
if (t <= -8.8e+50) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= -5.7e-161) {
tmp = t_2;
} else if (t <= 1.05e-200) {
tmp = t * (sqrt(x) / l);
} else if (t <= 3.8e+43) {
tmp = t_2;
} else {
tmp = 1.0 - (1.0 / x);
}
return tmp;
}
NOTE: l should be positive before calling this function
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 = (l * l) / x
t_2 = t * (sqrt(2.0d0) / sqrt((t_1 + (t_1 + (2.0d0 * ((t * t) + ((t * t) / x)))))))
if (t <= (-8.8d+50)) then
tmp = -sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else if (t <= (-5.7d-161)) then
tmp = t_2
else if (t <= 1.05d-200) then
tmp = t * (sqrt(x) / l)
else if (t <= 3.8d+43) then
tmp = t_2
else
tmp = 1.0d0 - (1.0d0 / x)
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = (l * l) / x;
double t_2 = t * (Math.sqrt(2.0) / Math.sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x)))))));
double tmp;
if (t <= -8.8e+50) {
tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= -5.7e-161) {
tmp = t_2;
} else if (t <= 1.05e-200) {
tmp = t * (Math.sqrt(x) / l);
} else if (t <= 3.8e+43) {
tmp = t_2;
} else {
tmp = 1.0 - (1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = (l * l) / x t_2 = t * (math.sqrt(2.0) / math.sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x))))))) tmp = 0 if t <= -8.8e+50: tmp = -math.sqrt(((x + -1.0) / (x + 1.0))) elif t <= -5.7e-161: tmp = t_2 elif t <= 1.05e-200: tmp = t * (math.sqrt(x) / l) elif t <= 3.8e+43: tmp = t_2 else: tmp = 1.0 - (1.0 / x) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(Float64(l * l) / x) t_2 = 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)))))))) tmp = 0.0 if (t <= -8.8e+50) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= -5.7e-161) tmp = t_2; elseif (t <= 1.05e-200) tmp = Float64(t * Float64(sqrt(x) / l)); elseif (t <= 3.8e+43) tmp = t_2; else tmp = Float64(1.0 - Float64(1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = (l * l) / x; t_2 = t * (sqrt(2.0) / sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x))))))); tmp = 0.0; if (t <= -8.8e+50) tmp = -sqrt(((x + -1.0) / (x + 1.0))); elseif (t <= -5.7e-161) tmp = t_2; elseif (t <= 1.05e-200) tmp = t * (sqrt(x) / l); elseif (t <= 3.8e+43) tmp = t_2; else tmp = 1.0 - (1.0 / x); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$2 = 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, -8.8e+50], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, -5.7e-161], t$95$2, If[LessEqual[t, 1.05e-200], N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.8e+43], t$95$2, N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{x}\\
t_2 := 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{if}\;t \leq -8.8 \cdot 10^{+50}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq -5.7 \cdot 10^{-161}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-200}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+43}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{1}{x}\\
\end{array}
\end{array}
if t < -8.80000000000000067e50Initial program 32.3%
associate-*r/32.2%
fma-neg32.2%
sub-neg32.2%
metadata-eval32.2%
+-commutative32.2%
fma-def32.2%
distribute-rgt-neg-in32.2%
Simplified32.2%
Applied egg-rr88.3%
Taylor expanded in t around -inf 100.0%
mul-1-neg100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
if -8.80000000000000067e50 < t < -5.70000000000000022e-161 or 1.05e-200 < t < 3.80000000000000008e43Initial program 53.7%
associate-*l/53.9%
Simplified53.9%
Taylor expanded in x around inf 83.6%
associate--l+83.6%
unpow283.6%
distribute-lft-out83.6%
unpow283.6%
unpow283.6%
associate-*r/83.6%
mul-1-neg83.6%
+-commutative83.6%
unpow283.6%
associate-*l*83.6%
unpow283.6%
fma-udef83.6%
Simplified83.6%
Taylor expanded in t around 0 83.7%
associate-*r/83.7%
mul-1-neg83.7%
unpow283.7%
distribute-rgt-neg-in83.7%
Simplified83.7%
if -5.70000000000000022e-161 < t < 1.05e-200Initial program 5.5%
associate-*l/5.5%
Simplified5.5%
Taylor expanded in x around inf 61.6%
associate--l+61.6%
unpow261.6%
distribute-lft-out61.6%
unpow261.6%
unpow261.6%
associate-*r/61.6%
mul-1-neg61.6%
+-commutative61.6%
unpow261.6%
associate-*l*61.6%
unpow261.6%
fma-udef61.6%
Simplified61.6%
Taylor expanded in l around inf 55.5%
associate-*l*55.5%
Simplified55.5%
Taylor expanded in l around 0 55.6%
associate-*l/55.6%
*-lft-identity55.6%
Simplified55.6%
if 3.80000000000000008e43 < t Initial program 27.8%
associate-*r/27.8%
fma-neg27.8%
sub-neg27.8%
metadata-eval27.8%
+-commutative27.8%
fma-def27.8%
distribute-rgt-neg-in27.8%
Simplified27.8%
Applied egg-rr86.6%
Taylor expanded in l around 0 95.5%
Taylor expanded in x around inf 95.5%
Final simplification85.4%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -9.5e-159) (- (+ -1.0 (/ 1.0 x)) (/ 0.5 (* x x))) (if (<= t 4.4e-169) (* t (/ (sqrt x) l)) (sqrt (/ (+ x -1.0) (+ x 1.0))))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -9.5e-159) {
tmp = (-1.0 + (1.0 / x)) - (0.5 / (x * x));
} else if (t <= 4.4e-169) {
tmp = t * (sqrt(x) / l);
} else {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
NOTE: l should be positive before calling this function
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 <= (-9.5d-159)) then
tmp = ((-1.0d0) + (1.0d0 / x)) - (0.5d0 / (x * x))
else if (t <= 4.4d-169) then
tmp = t * (sqrt(x) / l)
else
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -9.5e-159) {
tmp = (-1.0 + (1.0 / x)) - (0.5 / (x * x));
} else if (t <= 4.4e-169) {
tmp = t * (Math.sqrt(x) / l);
} else {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -9.5e-159: tmp = (-1.0 + (1.0 / x)) - (0.5 / (x * x)) elif t <= 4.4e-169: tmp = t * (math.sqrt(x) / l) else: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -9.5e-159) tmp = Float64(Float64(-1.0 + Float64(1.0 / x)) - Float64(0.5 / Float64(x * x))); elseif (t <= 4.4e-169) tmp = Float64(t * Float64(sqrt(x) / l)); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -9.5e-159) tmp = (-1.0 + (1.0 / x)) - (0.5 / (x * x)); elseif (t <= 4.4e-169) tmp = t * (sqrt(x) / l); else tmp = sqrt(((x + -1.0) / (x + 1.0))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -9.5e-159], N[(N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision] - N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.4e-169], N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{-159}:\\
\;\;\;\;\left(-1 + \frac{1}{x}\right) - \frac{0.5}{x \cdot x}\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-169}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -9.4999999999999997e-159Initial program 42.0%
associate-/l*42.0%
fma-neg42.0%
remove-double-neg42.0%
fma-neg42.0%
sub-neg42.0%
metadata-eval42.0%
remove-double-neg42.0%
fma-def42.0%
Simplified42.0%
Taylor expanded in t around -inf 86.1%
associate-*r*86.1%
neg-mul-186.1%
+-commutative86.1%
sub-neg86.1%
metadata-eval86.1%
+-commutative86.1%
Simplified86.1%
Taylor expanded in x around inf 85.5%
associate--r+85.5%
sub-neg85.5%
metadata-eval85.5%
associate-*r/85.5%
metadata-eval85.5%
unpow285.5%
Simplified85.5%
if -9.4999999999999997e-159 < t < 4.40000000000000015e-169Initial program 5.2%
associate-*l/5.2%
Simplified5.2%
Taylor expanded in x around inf 63.6%
associate--l+63.6%
unpow263.6%
distribute-lft-out63.6%
unpow263.6%
unpow263.6%
associate-*r/63.6%
mul-1-neg63.6%
+-commutative63.6%
unpow263.6%
associate-*l*63.6%
unpow263.6%
fma-udef63.6%
Simplified63.6%
Taylor expanded in l around inf 53.9%
associate-*l*53.8%
Simplified53.8%
Taylor expanded in l around 0 54.0%
associate-*l/54.0%
*-lft-identity54.0%
Simplified54.0%
if 4.40000000000000015e-169 < t Initial program 43.9%
associate-*r/43.9%
fma-neg43.9%
sub-neg43.9%
metadata-eval43.9%
+-commutative43.9%
fma-def43.9%
distribute-rgt-neg-in43.9%
Simplified43.9%
Applied egg-rr76.6%
Taylor expanded in l around 0 84.4%
Final simplification79.5%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -2.55e-158)
(- t_1)
(if (<= t 6.5e-165) (* t (/ (sqrt x) l)) t_1))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -2.55e-158) {
tmp = -t_1;
} else if (t <= 6.5e-165) {
tmp = t * (sqrt(x) / l);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: l should be positive before calling this function
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 <= (-2.55d-158)) then
tmp = -t_1
else if (t <= 6.5d-165) then
tmp = t * (sqrt(x) / l)
else
tmp = t_1
end if
code = tmp
end function
l = Math.abs(l);
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 <= -2.55e-158) {
tmp = -t_1;
} else if (t <= 6.5e-165) {
tmp = t * (Math.sqrt(x) / l);
} else {
tmp = t_1;
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(((x + -1.0) / (x + 1.0))) tmp = 0 if t <= -2.55e-158: tmp = -t_1 elif t <= 6.5e-165: tmp = t * (math.sqrt(x) / l) else: tmp = t_1 return tmp
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -2.55e-158) tmp = Float64(-t_1); elseif (t <= 6.5e-165) tmp = Float64(t * Float64(sqrt(x) / l)); else tmp = t_1; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = sqrt(((x + -1.0) / (x + 1.0))); tmp = 0.0; if (t <= -2.55e-158) tmp = -t_1; elseif (t <= 6.5e-165) tmp = t * (sqrt(x) / l); else tmp = t_1; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
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, -2.55e-158], (-t$95$1), If[LessEqual[t, 6.5e-165], N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -2.55 \cdot 10^{-158}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-165}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -2.5500000000000002e-158Initial program 42.0%
associate-*r/41.9%
fma-neg41.9%
sub-neg41.9%
metadata-eval41.9%
+-commutative41.9%
fma-def41.9%
distribute-rgt-neg-in41.9%
Simplified41.9%
Applied egg-rr73.4%
Taylor expanded in t around -inf 86.1%
mul-1-neg86.1%
sub-neg86.1%
metadata-eval86.1%
+-commutative86.1%
Simplified86.1%
if -2.5500000000000002e-158 < t < 6.5000000000000004e-165Initial program 5.2%
associate-*l/5.2%
Simplified5.2%
Taylor expanded in x around inf 63.6%
associate--l+63.6%
unpow263.6%
distribute-lft-out63.6%
unpow263.6%
unpow263.6%
associate-*r/63.6%
mul-1-neg63.6%
+-commutative63.6%
unpow263.6%
associate-*l*63.6%
unpow263.6%
fma-udef63.6%
Simplified63.6%
Taylor expanded in l around inf 53.9%
associate-*l*53.8%
Simplified53.8%
Taylor expanded in l around 0 54.0%
associate-*l/54.0%
*-lft-identity54.0%
Simplified54.0%
if 6.5000000000000004e-165 < t Initial program 43.9%
associate-*r/43.9%
fma-neg43.9%
sub-neg43.9%
metadata-eval43.9%
+-commutative43.9%
fma-def43.9%
distribute-rgt-neg-in43.9%
Simplified43.9%
Applied egg-rr76.6%
Taylor expanded in l around 0 84.4%
Final simplification79.7%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ 0.5 (* x x))))
(if (<= t -3.1e-157)
(- (+ -1.0 (/ 1.0 x)) t_1)
(if (<= t 2.25e-169) (* (sqrt x) (/ t l)) (+ 1.0 (+ t_1 (/ -1.0 x)))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = 0.5 / (x * x);
double tmp;
if (t <= -3.1e-157) {
tmp = (-1.0 + (1.0 / x)) - t_1;
} else if (t <= 2.25e-169) {
tmp = sqrt(x) * (t / l);
} else {
tmp = 1.0 + (t_1 + (-1.0 / x));
}
return tmp;
}
NOTE: l should be positive before calling this function
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 = 0.5d0 / (x * x)
if (t <= (-3.1d-157)) then
tmp = ((-1.0d0) + (1.0d0 / x)) - t_1
else if (t <= 2.25d-169) then
tmp = sqrt(x) * (t / l)
else
tmp = 1.0d0 + (t_1 + ((-1.0d0) / x))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = 0.5 / (x * x);
double tmp;
if (t <= -3.1e-157) {
tmp = (-1.0 + (1.0 / x)) - t_1;
} else if (t <= 2.25e-169) {
tmp = Math.sqrt(x) * (t / l);
} else {
tmp = 1.0 + (t_1 + (-1.0 / x));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = 0.5 / (x * x) tmp = 0 if t <= -3.1e-157: tmp = (-1.0 + (1.0 / x)) - t_1 elif t <= 2.25e-169: tmp = math.sqrt(x) * (t / l) else: tmp = 1.0 + (t_1 + (-1.0 / x)) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(0.5 / Float64(x * x)) tmp = 0.0 if (t <= -3.1e-157) tmp = Float64(Float64(-1.0 + Float64(1.0 / x)) - t_1); elseif (t <= 2.25e-169) tmp = Float64(sqrt(x) * Float64(t / l)); else tmp = Float64(1.0 + Float64(t_1 + Float64(-1.0 / x))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = 0.5 / (x * x); tmp = 0.0; if (t <= -3.1e-157) tmp = (-1.0 + (1.0 / x)) - t_1; elseif (t <= 2.25e-169) tmp = sqrt(x) * (t / l); else tmp = 1.0 + (t_1 + (-1.0 / x)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.1e-157], N[(N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t, 2.25e-169], N[(N[Sqrt[x], $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(t$95$1 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{0.5}{x \cdot x}\\
\mathbf{if}\;t \leq -3.1 \cdot 10^{-157}:\\
\;\;\;\;\left(-1 + \frac{1}{x}\right) - t_1\\
\mathbf{elif}\;t \leq 2.25 \cdot 10^{-169}:\\
\;\;\;\;\sqrt{x} \cdot \frac{t}{\ell}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(t_1 + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -3.0999999999999998e-157Initial program 42.0%
associate-/l*42.0%
fma-neg42.0%
remove-double-neg42.0%
fma-neg42.0%
sub-neg42.0%
metadata-eval42.0%
remove-double-neg42.0%
fma-def42.0%
Simplified42.0%
Taylor expanded in t around -inf 86.1%
associate-*r*86.1%
neg-mul-186.1%
+-commutative86.1%
sub-neg86.1%
metadata-eval86.1%
+-commutative86.1%
Simplified86.1%
Taylor expanded in x around inf 85.5%
associate--r+85.5%
sub-neg85.5%
metadata-eval85.5%
associate-*r/85.5%
metadata-eval85.5%
unpow285.5%
Simplified85.5%
if -3.0999999999999998e-157 < t < 2.2499999999999999e-169Initial program 5.2%
associate-*l/5.2%
Simplified5.2%
Taylor expanded in x around inf 63.6%
associate--l+63.6%
unpow263.6%
distribute-lft-out63.6%
unpow263.6%
unpow263.6%
associate-*r/63.6%
mul-1-neg63.6%
+-commutative63.6%
unpow263.6%
associate-*l*63.6%
unpow263.6%
fma-udef63.6%
Simplified63.6%
Taylor expanded in l around inf 53.9%
associate-*l*53.8%
Simplified53.8%
Taylor expanded in l around 0 45.0%
if 2.2499999999999999e-169 < t Initial program 43.9%
associate-*r/43.9%
fma-neg43.9%
sub-neg43.9%
metadata-eval43.9%
+-commutative43.9%
fma-def43.9%
distribute-rgt-neg-in43.9%
Simplified43.9%
Applied egg-rr76.6%
Taylor expanded in l around 0 84.4%
Taylor expanded in x around inf 83.5%
associate--l+83.5%
associate-*r/83.5%
metadata-eval83.5%
unpow283.5%
Simplified83.5%
Final simplification77.6%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ 0.5 (* x x))))
(if (<= t -7.5e-158)
(- (+ -1.0 (/ 1.0 x)) t_1)
(if (<= t 7.5e-167) (* t (/ (sqrt x) l)) (+ 1.0 (+ t_1 (/ -1.0 x)))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = 0.5 / (x * x);
double tmp;
if (t <= -7.5e-158) {
tmp = (-1.0 + (1.0 / x)) - t_1;
} else if (t <= 7.5e-167) {
tmp = t * (sqrt(x) / l);
} else {
tmp = 1.0 + (t_1 + (-1.0 / x));
}
return tmp;
}
NOTE: l should be positive before calling this function
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 = 0.5d0 / (x * x)
if (t <= (-7.5d-158)) then
tmp = ((-1.0d0) + (1.0d0 / x)) - t_1
else if (t <= 7.5d-167) then
tmp = t * (sqrt(x) / l)
else
tmp = 1.0d0 + (t_1 + ((-1.0d0) / x))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = 0.5 / (x * x);
double tmp;
if (t <= -7.5e-158) {
tmp = (-1.0 + (1.0 / x)) - t_1;
} else if (t <= 7.5e-167) {
tmp = t * (Math.sqrt(x) / l);
} else {
tmp = 1.0 + (t_1 + (-1.0 / x));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = 0.5 / (x * x) tmp = 0 if t <= -7.5e-158: tmp = (-1.0 + (1.0 / x)) - t_1 elif t <= 7.5e-167: tmp = t * (math.sqrt(x) / l) else: tmp = 1.0 + (t_1 + (-1.0 / x)) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(0.5 / Float64(x * x)) tmp = 0.0 if (t <= -7.5e-158) tmp = Float64(Float64(-1.0 + Float64(1.0 / x)) - t_1); elseif (t <= 7.5e-167) tmp = Float64(t * Float64(sqrt(x) / l)); else tmp = Float64(1.0 + Float64(t_1 + Float64(-1.0 / x))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = 0.5 / (x * x); tmp = 0.0; if (t <= -7.5e-158) tmp = (-1.0 + (1.0 / x)) - t_1; elseif (t <= 7.5e-167) tmp = t * (sqrt(x) / l); else tmp = 1.0 + (t_1 + (-1.0 / x)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.5e-158], N[(N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t, 7.5e-167], N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(t$95$1 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{0.5}{x \cdot x}\\
\mathbf{if}\;t \leq -7.5 \cdot 10^{-158}:\\
\;\;\;\;\left(-1 + \frac{1}{x}\right) - t_1\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-167}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(t_1 + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -7.5e-158Initial program 42.0%
associate-/l*42.0%
fma-neg42.0%
remove-double-neg42.0%
fma-neg42.0%
sub-neg42.0%
metadata-eval42.0%
remove-double-neg42.0%
fma-def42.0%
Simplified42.0%
Taylor expanded in t around -inf 86.1%
associate-*r*86.1%
neg-mul-186.1%
+-commutative86.1%
sub-neg86.1%
metadata-eval86.1%
+-commutative86.1%
Simplified86.1%
Taylor expanded in x around inf 85.5%
associate--r+85.5%
sub-neg85.5%
metadata-eval85.5%
associate-*r/85.5%
metadata-eval85.5%
unpow285.5%
Simplified85.5%
if -7.5e-158 < t < 7.5000000000000007e-167Initial program 5.2%
associate-*l/5.2%
Simplified5.2%
Taylor expanded in x around inf 63.6%
associate--l+63.6%
unpow263.6%
distribute-lft-out63.6%
unpow263.6%
unpow263.6%
associate-*r/63.6%
mul-1-neg63.6%
+-commutative63.6%
unpow263.6%
associate-*l*63.6%
unpow263.6%
fma-udef63.6%
Simplified63.6%
Taylor expanded in l around inf 53.9%
associate-*l*53.8%
Simplified53.8%
Taylor expanded in l around 0 54.0%
associate-*l/54.0%
*-lft-identity54.0%
Simplified54.0%
if 7.5000000000000007e-167 < t Initial program 43.9%
associate-*r/43.9%
fma-neg43.9%
sub-neg43.9%
metadata-eval43.9%
+-commutative43.9%
fma-def43.9%
distribute-rgt-neg-in43.9%
Simplified43.9%
Applied egg-rr76.6%
Taylor expanded in l around 0 84.4%
Taylor expanded in x around inf 83.5%
associate--l+83.5%
associate-*r/83.5%
metadata-eval83.5%
unpow283.5%
Simplified83.5%
Final simplification79.2%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -1e-310) (+ -1.0 (/ 1.0 x)) (+ 1.0 (+ (/ 0.5 (* x x)) (/ -1.0 x)))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -1e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1d-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
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -1e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -1e-310: tmp = -1.0 + (1.0 / x) else: tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x)) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -1e-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
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -1e-310) tmp = -1.0 + (1.0 / x); else tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -1e-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}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \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 < -9.999999999999969e-311Initial program 35.9%
associate-/l*35.9%
fma-neg35.9%
remove-double-neg35.9%
fma-neg35.9%
sub-neg35.9%
metadata-eval35.9%
remove-double-neg35.9%
fma-def35.9%
Simplified35.9%
Taylor expanded in t around -inf 75.7%
associate-*r*75.7%
neg-mul-175.7%
+-commutative75.7%
sub-neg75.7%
metadata-eval75.7%
+-commutative75.7%
Simplified75.7%
Taylor expanded in x around inf 74.9%
if -9.999999999999969e-311 < t Initial program 36.3%
associate-*r/36.2%
fma-neg36.2%
sub-neg36.2%
metadata-eval36.2%
+-commutative36.2%
fma-def36.2%
distribute-rgt-neg-in36.2%
Simplified36.2%
Applied egg-rr69.2%
Taylor expanded in l around 0 72.9%
Taylor expanded in x around inf 72.2%
associate--l+72.2%
associate-*r/72.2%
metadata-eval72.2%
unpow272.2%
Simplified72.2%
Final simplification73.7%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (let* ((t_1 (/ 0.5 (* x x)))) (if (<= t -1e-310) (- (+ -1.0 (/ 1.0 x)) t_1) (+ 1.0 (+ t_1 (/ -1.0 x))))))
l = abs(l);
double code(double x, double l, double t) {
double t_1 = 0.5 / (x * x);
double tmp;
if (t <= -1e-310) {
tmp = (-1.0 + (1.0 / x)) - t_1;
} else {
tmp = 1.0 + (t_1 + (-1.0 / x));
}
return tmp;
}
NOTE: l should be positive before calling this function
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 = 0.5d0 / (x * x)
if (t <= (-1d-310)) then
tmp = ((-1.0d0) + (1.0d0 / x)) - t_1
else
tmp = 1.0d0 + (t_1 + ((-1.0d0) / x))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = 0.5 / (x * x);
double tmp;
if (t <= -1e-310) {
tmp = (-1.0 + (1.0 / x)) - t_1;
} else {
tmp = 1.0 + (t_1 + (-1.0 / x));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = 0.5 / (x * x) tmp = 0 if t <= -1e-310: tmp = (-1.0 + (1.0 / x)) - t_1 else: tmp = 1.0 + (t_1 + (-1.0 / x)) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(0.5 / Float64(x * x)) tmp = 0.0 if (t <= -1e-310) tmp = Float64(Float64(-1.0 + Float64(1.0 / x)) - t_1); else tmp = Float64(1.0 + Float64(t_1 + Float64(-1.0 / x))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = 0.5 / (x * x); tmp = 0.0; if (t <= -1e-310) tmp = (-1.0 + (1.0 / x)) - t_1; else tmp = 1.0 + (t_1 + (-1.0 / x)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1e-310], N[(N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(1.0 + N[(t$95$1 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{0.5}{x \cdot x}\\
\mathbf{if}\;t \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\left(-1 + \frac{1}{x}\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;1 + \left(t_1 + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -9.999999999999969e-311Initial program 35.9%
associate-/l*35.9%
fma-neg35.9%
remove-double-neg35.9%
fma-neg35.9%
sub-neg35.9%
metadata-eval35.9%
remove-double-neg35.9%
fma-def35.9%
Simplified35.9%
Taylor expanded in t around -inf 75.7%
associate-*r*75.7%
neg-mul-175.7%
+-commutative75.7%
sub-neg75.7%
metadata-eval75.7%
+-commutative75.7%
Simplified75.7%
Taylor expanded in x around inf 75.3%
associate--r+75.3%
sub-neg75.3%
metadata-eval75.3%
associate-*r/75.3%
metadata-eval75.3%
unpow275.3%
Simplified75.3%
if -9.999999999999969e-311 < t Initial program 36.3%
associate-*r/36.2%
fma-neg36.2%
sub-neg36.2%
metadata-eval36.2%
+-commutative36.2%
fma-def36.2%
distribute-rgt-neg-in36.2%
Simplified36.2%
Applied egg-rr69.2%
Taylor expanded in l around 0 72.9%
Taylor expanded in x around inf 72.2%
associate--l+72.2%
associate-*r/72.2%
metadata-eval72.2%
unpow272.2%
Simplified72.2%
Final simplification73.9%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -1e-310) -1.0 (- 1.0 (/ 1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -1e-310) {
tmp = -1.0;
} else {
tmp = 1.0 - (1.0 / x);
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1d-310)) then
tmp = -1.0d0
else
tmp = 1.0d0 - (1.0d0 / x)
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -1e-310) {
tmp = -1.0;
} else {
tmp = 1.0 - (1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -1e-310: tmp = -1.0 else: tmp = 1.0 - (1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -1e-310) tmp = -1.0; else tmp = Float64(1.0 - Float64(1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -1e-310) tmp = -1.0; else tmp = 1.0 - (1.0 / x); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -1e-310], -1.0, N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{-310}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{1}{x}\\
\end{array}
\end{array}
if t < -9.999999999999969e-311Initial program 35.9%
associate-/l*35.9%
fma-neg35.9%
remove-double-neg35.9%
fma-neg35.9%
sub-neg35.9%
metadata-eval35.9%
remove-double-neg35.9%
fma-def35.9%
Simplified35.9%
Taylor expanded in t around -inf 75.7%
associate-*r*75.7%
neg-mul-175.7%
+-commutative75.7%
sub-neg75.7%
metadata-eval75.7%
+-commutative75.7%
Simplified75.7%
Taylor expanded in x around inf 74.2%
if -9.999999999999969e-311 < t Initial program 36.3%
associate-*r/36.2%
fma-neg36.2%
sub-neg36.2%
metadata-eval36.2%
+-commutative36.2%
fma-def36.2%
distribute-rgt-neg-in36.2%
Simplified36.2%
Applied egg-rr69.2%
Taylor expanded in l around 0 72.9%
Taylor expanded in x around inf 72.2%
Final simplification73.3%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -1e-310) (+ -1.0 (/ 1.0 x)) (- 1.0 (/ 1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -1e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0 - (1.0 / x);
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1d-310)) then
tmp = (-1.0d0) + (1.0d0 / x)
else
tmp = 1.0d0 - (1.0d0 / x)
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -1e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0 - (1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -1e-310: tmp = -1.0 + (1.0 / x) else: tmp = 1.0 - (1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -1e-310) tmp = Float64(-1.0 + Float64(1.0 / x)); else tmp = Float64(1.0 - Float64(1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -1e-310) tmp = -1.0 + (1.0 / x); else tmp = 1.0 - (1.0 / x); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -1e-310], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{-310}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{1}{x}\\
\end{array}
\end{array}
if t < -9.999999999999969e-311Initial program 35.9%
associate-/l*35.9%
fma-neg35.9%
remove-double-neg35.9%
fma-neg35.9%
sub-neg35.9%
metadata-eval35.9%
remove-double-neg35.9%
fma-def35.9%
Simplified35.9%
Taylor expanded in t around -inf 75.7%
associate-*r*75.7%
neg-mul-175.7%
+-commutative75.7%
sub-neg75.7%
metadata-eval75.7%
+-commutative75.7%
Simplified75.7%
Taylor expanded in x around inf 74.9%
if -9.999999999999969e-311 < t Initial program 36.3%
associate-*r/36.2%
fma-neg36.2%
sub-neg36.2%
metadata-eval36.2%
+-commutative36.2%
fma-def36.2%
distribute-rgt-neg-in36.2%
Simplified36.2%
Applied egg-rr69.2%
Taylor expanded in l around 0 72.9%
Taylor expanded in x around inf 72.2%
Final simplification73.7%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -1e-310) -1.0 1.0))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -1e-310) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1d-310)) then
tmp = -1.0d0
else
tmp = 1.0d0
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -1e-310) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -1e-310: tmp = -1.0 else: tmp = 1.0 return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -1e-310) tmp = -1.0; else tmp = 1.0; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -1e-310) tmp = -1.0; else tmp = 1.0; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -1e-310], -1.0, 1.0]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{-310}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -9.999999999999969e-311Initial program 35.9%
associate-/l*35.9%
fma-neg35.9%
remove-double-neg35.9%
fma-neg35.9%
sub-neg35.9%
metadata-eval35.9%
remove-double-neg35.9%
fma-def35.9%
Simplified35.9%
Taylor expanded in t around -inf 75.7%
associate-*r*75.7%
neg-mul-175.7%
+-commutative75.7%
sub-neg75.7%
metadata-eval75.7%
+-commutative75.7%
Simplified75.7%
Taylor expanded in x around inf 74.2%
if -9.999999999999969e-311 < t Initial program 36.3%
associate-*l/36.3%
Simplified36.3%
Taylor expanded in x around inf 71.2%
Taylor expanded in t around 0 71.4%
Final simplification73.0%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 -1.0)
l = abs(l);
double code(double x, double l, double t) {
return -1.0;
}
NOTE: l should be positive before calling this function
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
l = Math.abs(l);
public static double code(double x, double l, double t) {
return -1.0;
}
l = abs(l) def code(x, l, t): return -1.0
l = abs(l) function code(x, l, t) return -1.0 end
l = abs(l) function tmp = code(x, l, t) tmp = -1.0; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := -1.0
\begin{array}{l}
l = |l|\\
\\
-1
\end{array}
Initial program 36.1%
associate-/l*36.0%
fma-neg36.0%
remove-double-neg36.0%
fma-neg36.0%
sub-neg36.0%
metadata-eval36.0%
remove-double-neg36.0%
fma-def36.0%
Simplified36.0%
Taylor expanded in t around -inf 44.0%
associate-*r*44.0%
neg-mul-144.0%
+-commutative44.0%
sub-neg44.0%
metadata-eval44.0%
+-commutative44.0%
Simplified44.0%
Taylor expanded in x around inf 43.1%
Final simplification43.1%
herbie shell --seed 2023255
(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)))))