
(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}
(FPCore (x l t)
:precision binary64
(let* ((t_1
(*
t
(/
(sqrt 2.0)
(sqrt (+ (* 2.0 (* t (+ t (/ t x)))) (* 2.0 (* l (/ l x)))))))))
(if (<= t -2e+151)
(+ (/ 1.0 x) (- -1.0 (/ 0.5 (* x x))))
(if (<= t 1.15e-249)
t_1
(if (<= t 1.7e-150)
(*
t
(/
(sqrt 2.0)
(fma
0.5
(/
(+ (* l l) (fma 2.0 (* t t) (fma (* t 2.0) t (* l l))))
(* (sqrt 2.0) (* t x)))
(* t (sqrt 2.0)))))
(if (<= t 6.6e+62)
t_1
(sqrt (/ 2.0 (/ (+ 2.0 (* x 2.0)) (+ x -1.0))))))))))
double code(double x, double l, double t) {
double t_1 = t * (sqrt(2.0) / sqrt(((2.0 * (t * (t + (t / x)))) + (2.0 * (l * (l / x))))));
double tmp;
if (t <= -2e+151) {
tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x)));
} else if (t <= 1.15e-249) {
tmp = t_1;
} else if (t <= 1.7e-150) {
tmp = t * (sqrt(2.0) / fma(0.5, (((l * l) + fma(2.0, (t * t), fma((t * 2.0), t, (l * l)))) / (sqrt(2.0) * (t * x))), (t * sqrt(2.0))));
} else if (t <= 6.6e+62) {
tmp = t_1;
} else {
tmp = sqrt((2.0 / ((2.0 + (x * 2.0)) / (x + -1.0))));
}
return tmp;
}
function code(x, l, t) t_1 = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(2.0 * Float64(t * Float64(t + Float64(t / x)))) + Float64(2.0 * Float64(l * Float64(l / x))))))) tmp = 0.0 if (t <= -2e+151) tmp = Float64(Float64(1.0 / x) + Float64(-1.0 - Float64(0.5 / Float64(x * x)))); elseif (t <= 1.15e-249) tmp = t_1; elseif (t <= 1.7e-150) tmp = Float64(t * Float64(sqrt(2.0) / fma(0.5, Float64(Float64(Float64(l * l) + fma(2.0, Float64(t * t), fma(Float64(t * 2.0), t, Float64(l * l)))) / Float64(sqrt(2.0) * Float64(t * x))), Float64(t * sqrt(2.0))))); elseif (t <= 6.6e+62) tmp = t_1; else tmp = sqrt(Float64(2.0 / Float64(Float64(2.0 + Float64(x * 2.0)) / Float64(x + -1.0)))); end return tmp end
code[x_, l_, t_] := Block[{t$95$1 = N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(2.0 * N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2e+151], N[(N[(1.0 / x), $MachinePrecision] + N[(-1.0 - N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.15e-249], t$95$1, If[LessEqual[t, 1.7e-150], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(0.5 * N[(N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision] + N[(N[(t * 2.0), $MachinePrecision] * t + N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.6e+62], t$95$1, N[Sqrt[N[(2.0 / N[(N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + 2 \cdot \left(\ell \cdot \frac{\ell}{x}\right)}}\\
\mathbf{if}\;t \leq -2 \cdot 10^{+151}:\\
\;\;\;\;\frac{1}{x} + \left(-1 - \frac{0.5}{x \cdot x}\right)\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-249}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{-150}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(0.5, \frac{\ell \cdot \ell + \mathsf{fma}\left(2, t \cdot t, \mathsf{fma}\left(t \cdot 2, t, \ell \cdot \ell\right)\right)}{\sqrt{2} \cdot \left(t \cdot x\right)}, t \cdot \sqrt{2}\right)}\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{+62}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{2}{\frac{2 + x \cdot 2}{x + -1}}}\\
\end{array}
\end{array}
if t < -2.00000000000000003e151Initial 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%
Taylor expanded in t around -inf 100.0%
associate-*r*100.0%
neg-mul-1100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
associate-*r/100.0%
metadata-eval100.0%
unpow2100.0%
Simplified100.0%
if -2.00000000000000003e151 < t < 1.1499999999999999e-249 or 1.7e-150 < t < 6.6e62Initial program 46.0%
associate-*l/46.1%
Simplified46.1%
Taylor expanded in x around inf 75.3%
associate--l+75.3%
unpow275.3%
distribute-lft-out75.3%
unpow275.3%
unpow275.3%
associate-*r/75.3%
mul-1-neg75.3%
+-commutative75.3%
unpow275.3%
associate-*l*75.3%
unpow275.3%
fma-udef75.3%
Simplified75.3%
Taylor expanded in t around 0 74.9%
associate-*r/74.9%
mul-1-neg74.9%
unpow274.9%
distribute-rgt-neg-in74.9%
Simplified74.9%
expm1-log1p-u72.5%
expm1-udef47.1%
Applied egg-rr56.7%
expm1-def82.1%
expm1-log1p85.1%
+-commutative85.1%
sub-neg85.1%
associate-+l+85.2%
fma-udef85.2%
associate-/r/85.2%
distribute-rgt-out85.2%
associate-/r/85.2%
distribute-rgt-neg-in85.2%
remove-double-neg85.2%
associate-*l/74.9%
unpow274.9%
associate-/l*74.9%
Simplified85.2%
if 1.1499999999999999e-249 < t < 1.7e-150Initial program 13.4%
associate-*l/13.4%
Simplified13.4%
Taylor expanded in x around inf 85.3%
fma-def85.3%
Simplified85.3%
if 6.6e62 < t Initial program 30.3%
associate-/l*30.2%
fma-neg30.2%
remove-double-neg30.2%
fma-neg30.2%
sub-neg30.2%
metadata-eval30.2%
remove-double-neg30.2%
fma-def30.2%
Simplified30.2%
Taylor expanded in t around -inf 1.6%
associate-*r*1.6%
neg-mul-11.6%
+-commutative1.6%
sub-neg1.6%
metadata-eval1.6%
+-commutative1.6%
Simplified1.6%
add-sqr-sqrt0.0%
sqrt-unprod95.5%
frac-times95.5%
add-sqr-sqrt94.1%
pow294.1%
Applied egg-rr94.1%
unpow294.1%
rem-square-sqrt95.5%
metadata-eval95.5%
sub-neg95.5%
associate-*r/95.5%
rem-square-sqrt94.1%
unpow294.1%
+-commutative94.1%
distribute-rgt-in94.1%
unpow294.1%
rem-square-sqrt94.1%
metadata-eval94.1%
unpow294.1%
rem-square-sqrt95.5%
sub-neg95.5%
metadata-eval95.5%
Simplified95.5%
Final simplification90.2%
(FPCore (x l t)
:precision binary64
(let* ((t_1
(*
t
(/
(sqrt 2.0)
(sqrt (+ (* 2.0 (* t (+ t (/ t x)))) (* 2.0 (* l (/ l x)))))))))
(if (<= t -2e+151)
(+ (/ 1.0 x) (- -1.0 (/ 0.5 (* x x))))
(if (<= t 3.2e-238)
t_1
(if (<= t 6.5e-114)
(+ 1.0 (/ -1.0 x))
(if (<= t 7e+62)
t_1
(sqrt (/ 2.0 (/ (+ 2.0 (* x 2.0)) (+ x -1.0))))))))))
double code(double x, double l, double t) {
double t_1 = t * (sqrt(2.0) / sqrt(((2.0 * (t * (t + (t / x)))) + (2.0 * (l * (l / x))))));
double tmp;
if (t <= -2e+151) {
tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x)));
} else if (t <= 3.2e-238) {
tmp = t_1;
} else if (t <= 6.5e-114) {
tmp = 1.0 + (-1.0 / x);
} else if (t <= 7e+62) {
tmp = t_1;
} else {
tmp = sqrt((2.0 / ((2.0 + (x * 2.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) :: t_1
real(8) :: tmp
t_1 = t * (sqrt(2.0d0) / sqrt(((2.0d0 * (t * (t + (t / x)))) + (2.0d0 * (l * (l / x))))))
if (t <= (-2d+151)) then
tmp = (1.0d0 / x) + ((-1.0d0) - (0.5d0 / (x * x)))
else if (t <= 3.2d-238) then
tmp = t_1
else if (t <= 6.5d-114) then
tmp = 1.0d0 + ((-1.0d0) / x)
else if (t <= 7d+62) then
tmp = t_1
else
tmp = sqrt((2.0d0 / ((2.0d0 + (x * 2.0d0)) / (x + (-1.0d0)))))
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double t_1 = t * (Math.sqrt(2.0) / Math.sqrt(((2.0 * (t * (t + (t / x)))) + (2.0 * (l * (l / x))))));
double tmp;
if (t <= -2e+151) {
tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x)));
} else if (t <= 3.2e-238) {
tmp = t_1;
} else if (t <= 6.5e-114) {
tmp = 1.0 + (-1.0 / x);
} else if (t <= 7e+62) {
tmp = t_1;
} else {
tmp = Math.sqrt((2.0 / ((2.0 + (x * 2.0)) / (x + -1.0))));
}
return tmp;
}
def code(x, l, t): t_1 = t * (math.sqrt(2.0) / math.sqrt(((2.0 * (t * (t + (t / x)))) + (2.0 * (l * (l / x)))))) tmp = 0 if t <= -2e+151: tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x))) elif t <= 3.2e-238: tmp = t_1 elif t <= 6.5e-114: tmp = 1.0 + (-1.0 / x) elif t <= 7e+62: tmp = t_1 else: tmp = math.sqrt((2.0 / ((2.0 + (x * 2.0)) / (x + -1.0)))) return tmp
function code(x, l, t) t_1 = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(2.0 * Float64(t * Float64(t + Float64(t / x)))) + Float64(2.0 * Float64(l * Float64(l / x))))))) tmp = 0.0 if (t <= -2e+151) tmp = Float64(Float64(1.0 / x) + Float64(-1.0 - Float64(0.5 / Float64(x * x)))); elseif (t <= 3.2e-238) tmp = t_1; elseif (t <= 6.5e-114) tmp = Float64(1.0 + Float64(-1.0 / x)); elseif (t <= 7e+62) tmp = t_1; else tmp = sqrt(Float64(2.0 / Float64(Float64(2.0 + Float64(x * 2.0)) / Float64(x + -1.0)))); end return tmp end
function tmp_2 = code(x, l, t) t_1 = t * (sqrt(2.0) / sqrt(((2.0 * (t * (t + (t / x)))) + (2.0 * (l * (l / x)))))); tmp = 0.0; if (t <= -2e+151) tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x))); elseif (t <= 3.2e-238) tmp = t_1; elseif (t <= 6.5e-114) tmp = 1.0 + (-1.0 / x); elseif (t <= 7e+62) tmp = t_1; else tmp = sqrt((2.0 / ((2.0 + (x * 2.0)) / (x + -1.0)))); end tmp_2 = tmp; end
code[x_, l_, t_] := Block[{t$95$1 = N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(2.0 * N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2e+151], N[(N[(1.0 / x), $MachinePrecision] + N[(-1.0 - N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.2e-238], t$95$1, If[LessEqual[t, 6.5e-114], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7e+62], t$95$1, N[Sqrt[N[(2.0 / N[(N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + 2 \cdot \left(\ell \cdot \frac{\ell}{x}\right)}}\\
\mathbf{if}\;t \leq -2 \cdot 10^{+151}:\\
\;\;\;\;\frac{1}{x} + \left(-1 - \frac{0.5}{x \cdot x}\right)\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-238}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-114}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{elif}\;t \leq 7 \cdot 10^{+62}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{2}{\frac{2 + x \cdot 2}{x + -1}}}\\
\end{array}
\end{array}
if t < -2.00000000000000003e151Initial 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%
Taylor expanded in t around -inf 100.0%
associate-*r*100.0%
neg-mul-1100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
associate-*r/100.0%
metadata-eval100.0%
unpow2100.0%
Simplified100.0%
if -2.00000000000000003e151 < t < 3.2000000000000002e-238 or 6.4999999999999998e-114 < t < 6.99999999999999967e62Initial program 44.4%
associate-*l/44.5%
Simplified44.5%
Taylor expanded in x around inf 74.6%
associate--l+74.6%
unpow274.6%
distribute-lft-out74.6%
unpow274.6%
unpow274.6%
associate-*r/74.6%
mul-1-neg74.6%
+-commutative74.6%
unpow274.6%
associate-*l*74.6%
unpow274.6%
fma-udef74.6%
Simplified74.6%
Taylor expanded in t around 0 74.2%
associate-*r/74.2%
mul-1-neg74.2%
unpow274.2%
distribute-rgt-neg-in74.2%
Simplified74.2%
expm1-log1p-u71.7%
expm1-udef48.5%
Applied egg-rr58.3%
expm1-def81.6%
expm1-log1p84.7%
+-commutative84.7%
sub-neg84.7%
associate-+l+84.7%
fma-udef84.7%
associate-/r/84.7%
distribute-rgt-out84.7%
associate-/r/84.7%
distribute-rgt-neg-in84.7%
remove-double-neg84.7%
associate-*l/74.2%
unpow274.2%
associate-/l*74.2%
Simplified84.7%
if 3.2000000000000002e-238 < t < 6.4999999999999998e-114Initial program 32.4%
associate-/l*32.4%
fma-neg32.4%
remove-double-neg32.4%
fma-neg32.4%
sub-neg32.4%
metadata-eval32.4%
remove-double-neg32.4%
fma-def32.4%
Simplified32.4%
Taylor expanded in t around -inf 1.8%
associate-*r*1.8%
neg-mul-11.8%
+-commutative1.8%
sub-neg1.8%
metadata-eval1.8%
+-commutative1.8%
Simplified1.8%
add-sqr-sqrt0.0%
sqrt-unprod79.0%
frac-times78.9%
add-sqr-sqrt77.9%
pow277.9%
Applied egg-rr77.9%
Taylor expanded in x around inf 79.1%
if 6.99999999999999967e62 < t Initial program 30.3%
associate-/l*30.2%
fma-neg30.2%
remove-double-neg30.2%
fma-neg30.2%
sub-neg30.2%
metadata-eval30.2%
remove-double-neg30.2%
fma-def30.2%
Simplified30.2%
Taylor expanded in t around -inf 1.6%
associate-*r*1.6%
neg-mul-11.6%
+-commutative1.6%
sub-neg1.6%
metadata-eval1.6%
+-commutative1.6%
Simplified1.6%
add-sqr-sqrt0.0%
sqrt-unprod95.5%
frac-times95.5%
add-sqr-sqrt94.1%
pow294.1%
Applied egg-rr94.1%
unpow294.1%
rem-square-sqrt95.5%
metadata-eval95.5%
sub-neg95.5%
associate-*r/95.5%
rem-square-sqrt94.1%
unpow294.1%
+-commutative94.1%
distribute-rgt-in94.1%
unpow294.1%
rem-square-sqrt94.1%
metadata-eval94.1%
unpow294.1%
rem-square-sqrt95.5%
sub-neg95.5%
metadata-eval95.5%
Simplified95.5%
Final simplification89.6%
(FPCore (x l t)
:precision binary64
(if (<= t -7.5e-56)
(- (sqrt (/ (+ x -1.0) (+ 1.0 x))))
(if (<= t 1.1e-238)
(* t (/ (sqrt x) l))
(sqrt (/ 2.0 (/ (+ 2.0 (* x 2.0)) (+ x -1.0)))))))
double code(double x, double l, double t) {
double tmp;
if (t <= -7.5e-56) {
tmp = -sqrt(((x + -1.0) / (1.0 + x)));
} else if (t <= 1.1e-238) {
tmp = t * (sqrt(x) / l);
} else {
tmp = sqrt((2.0 / ((2.0 + (x * 2.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 <= (-7.5d-56)) then
tmp = -sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
else if (t <= 1.1d-238) then
tmp = t * (sqrt(x) / l)
else
tmp = sqrt((2.0d0 / ((2.0d0 + (x * 2.0d0)) / (x + (-1.0d0)))))
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= -7.5e-56) {
tmp = -Math.sqrt(((x + -1.0) / (1.0 + x)));
} else if (t <= 1.1e-238) {
tmp = t * (Math.sqrt(x) / l);
} else {
tmp = Math.sqrt((2.0 / ((2.0 + (x * 2.0)) / (x + -1.0))));
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -7.5e-56: tmp = -math.sqrt(((x + -1.0) / (1.0 + x))) elif t <= 1.1e-238: tmp = t * (math.sqrt(x) / l) else: tmp = math.sqrt((2.0 / ((2.0 + (x * 2.0)) / (x + -1.0)))) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -7.5e-56) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x)))); elseif (t <= 1.1e-238) tmp = Float64(t * Float64(sqrt(x) / l)); else tmp = sqrt(Float64(2.0 / Float64(Float64(2.0 + Float64(x * 2.0)) / Float64(x + -1.0)))); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -7.5e-56) tmp = -sqrt(((x + -1.0) / (1.0 + x))); elseif (t <= 1.1e-238) tmp = t * (sqrt(x) / l); else tmp = sqrt((2.0 / ((2.0 + (x * 2.0)) / (x + -1.0)))); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -7.5e-56], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 1.1e-238], N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(2.0 / N[(N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{-56}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{1 + x}}\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{-238}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{2}{\frac{2 + x \cdot 2}{x + -1}}}\\
\end{array}
\end{array}
if t < -7.50000000000000041e-56Initial program 38.3%
associate-*r/38.2%
fma-neg38.2%
sub-neg38.2%
metadata-eval38.2%
+-commutative38.2%
fma-def38.2%
distribute-rgt-neg-in38.2%
Simplified38.2%
Applied egg-rr81.8%
Taylor expanded in t around -inf 92.0%
mul-1-neg92.0%
sub-neg92.0%
metadata-eval92.0%
Simplified92.0%
if -7.50000000000000041e-56 < t < 1.09999999999999996e-238Initial program 13.5%
associate-*l/13.6%
Simplified13.6%
Taylor expanded in x around inf 61.3%
associate--l+61.3%
unpow261.3%
distribute-lft-out61.3%
unpow261.3%
unpow261.3%
associate-*r/61.3%
mul-1-neg61.3%
+-commutative61.3%
unpow261.3%
associate-*l*61.3%
unpow261.3%
fma-udef61.3%
Simplified61.3%
Taylor expanded in l around inf 44.2%
associate-*l*44.3%
Simplified44.3%
Taylor expanded in l around 0 44.5%
associate-*l/44.5%
*-lft-identity44.5%
Simplified44.5%
if 1.09999999999999996e-238 < t Initial program 38.0%
associate-/l*38.0%
fma-neg38.0%
remove-double-neg38.0%
fma-neg38.0%
sub-neg38.0%
metadata-eval38.0%
remove-double-neg38.0%
fma-def38.0%
Simplified38.0%
Taylor expanded in t around -inf 1.6%
associate-*r*1.6%
neg-mul-11.6%
+-commutative1.6%
sub-neg1.6%
metadata-eval1.6%
+-commutative1.6%
Simplified1.6%
add-sqr-sqrt0.0%
sqrt-unprod85.4%
frac-times85.4%
add-sqr-sqrt84.1%
pow284.1%
Applied egg-rr84.2%
unpow284.2%
rem-square-sqrt85.4%
metadata-eval85.4%
sub-neg85.4%
associate-*r/85.4%
rem-square-sqrt84.1%
unpow284.1%
+-commutative84.1%
distribute-rgt-in84.1%
unpow284.1%
rem-square-sqrt84.1%
metadata-eval84.1%
unpow284.1%
rem-square-sqrt85.4%
sub-neg85.4%
metadata-eval85.4%
Simplified85.4%
Final simplification79.1%
(FPCore (x l t) :precision binary64 (if (<= t -7.5e-56) (+ (/ 1.0 x) (- -1.0 (/ 0.5 (* x x)))) (if (<= t 3.6e-234) (* t (/ (sqrt x) l)) (sqrt (/ (+ x -1.0) (+ 1.0 x))))))
double code(double x, double l, double t) {
double tmp;
if (t <= -7.5e-56) {
tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x)));
} else if (t <= 3.6e-234) {
tmp = t * (sqrt(x) / l);
} else {
tmp = sqrt(((x + -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 <= (-7.5d-56)) then
tmp = (1.0d0 / x) + ((-1.0d0) - (0.5d0 / (x * x)))
else if (t <= 3.6d-234) then
tmp = t * (sqrt(x) / l)
else
tmp = sqrt(((x + (-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 <= -7.5e-56) {
tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x)));
} else if (t <= 3.6e-234) {
tmp = t * (Math.sqrt(x) / l);
} else {
tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -7.5e-56: tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x))) elif t <= 3.6e-234: tmp = t * (math.sqrt(x) / l) else: tmp = math.sqrt(((x + -1.0) / (1.0 + x))) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -7.5e-56) tmp = Float64(Float64(1.0 / x) + Float64(-1.0 - Float64(0.5 / Float64(x * x)))); elseif (t <= 3.6e-234) tmp = Float64(t * Float64(sqrt(x) / l)); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -7.5e-56) tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x))); elseif (t <= 3.6e-234) tmp = t * (sqrt(x) / l); else tmp = sqrt(((x + -1.0) / (1.0 + x))); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -7.5e-56], N[(N[(1.0 / x), $MachinePrecision] + N[(-1.0 - N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.6e-234], N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{-56}:\\
\;\;\;\;\frac{1}{x} + \left(-1 - \frac{0.5}{x \cdot x}\right)\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{-234}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
if t < -7.50000000000000041e-56Initial program 38.3%
associate-/l*38.3%
fma-neg38.3%
remove-double-neg38.3%
fma-neg38.3%
sub-neg38.3%
metadata-eval38.3%
remove-double-neg38.3%
fma-def38.3%
Simplified38.3%
Taylor expanded in t around -inf 92.0%
associate-*r*92.0%
neg-mul-192.0%
+-commutative92.0%
sub-neg92.0%
metadata-eval92.0%
+-commutative92.0%
Simplified92.0%
Taylor expanded in x around inf 91.2%
associate-*r/91.2%
metadata-eval91.2%
unpow291.2%
Simplified91.2%
if -7.50000000000000041e-56 < t < 3.5999999999999998e-234Initial program 13.5%
associate-*l/13.6%
Simplified13.6%
Taylor expanded in x around inf 61.3%
associate--l+61.3%
unpow261.3%
distribute-lft-out61.3%
unpow261.3%
unpow261.3%
associate-*r/61.3%
mul-1-neg61.3%
+-commutative61.3%
unpow261.3%
associate-*l*61.3%
unpow261.3%
fma-udef61.3%
Simplified61.3%
Taylor expanded in l around inf 44.2%
associate-*l*44.3%
Simplified44.3%
Taylor expanded in l around 0 44.5%
associate-*l/44.5%
*-lft-identity44.5%
Simplified44.5%
if 3.5999999999999998e-234 < t Initial program 38.0%
associate-*r/38.0%
fma-neg38.0%
sub-neg38.0%
metadata-eval38.0%
+-commutative38.0%
fma-def38.0%
distribute-rgt-neg-in38.0%
Simplified38.0%
Applied egg-rr72.9%
Taylor expanded in t around inf 85.4%
Final simplification78.8%
(FPCore (x l t) :precision binary64 (let* ((t_1 (sqrt (/ (+ x -1.0) (+ 1.0 x))))) (if (<= t -9.8e-54) (- t_1) (if (<= t 4.8e-235) (* t (/ (sqrt x) l)) t_1))))
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (1.0 + x)));
double tmp;
if (t <= -9.8e-54) {
tmp = -t_1;
} else if (t <= 4.8e-235) {
tmp = t * (sqrt(x) / l);
} 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)) / (1.0d0 + x)))
if (t <= (-9.8d-54)) then
tmp = -t_1
else if (t <= 4.8d-235) then
tmp = t * (sqrt(x) / l)
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) / (1.0 + x)));
double tmp;
if (t <= -9.8e-54) {
tmp = -t_1;
} else if (t <= 4.8e-235) {
tmp = t * (Math.sqrt(x) / l);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, l, t): t_1 = math.sqrt(((x + -1.0) / (1.0 + x))) tmp = 0 if t <= -9.8e-54: tmp = -t_1 elif t <= 4.8e-235: tmp = t * (math.sqrt(x) / l) else: tmp = t_1 return tmp
function code(x, l, t) t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))) tmp = 0.0 if (t <= -9.8e-54) tmp = Float64(-t_1); elseif (t <= 4.8e-235) tmp = Float64(t * Float64(sqrt(x) / l)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, l, t) t_1 = sqrt(((x + -1.0) / (1.0 + x))); tmp = 0.0; if (t <= -9.8e-54) tmp = -t_1; elseif (t <= 4.8e-235) tmp = t * (sqrt(x) / l); 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[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -9.8e-54], (-t$95$1), If[LessEqual[t, 4.8e-235], N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{1 + x}}\\
\mathbf{if}\;t \leq -9.8 \cdot 10^{-54}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-235}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -9.80000000000000042e-54Initial program 38.3%
associate-*r/38.2%
fma-neg38.2%
sub-neg38.2%
metadata-eval38.2%
+-commutative38.2%
fma-def38.2%
distribute-rgt-neg-in38.2%
Simplified38.2%
Applied egg-rr81.8%
Taylor expanded in t around -inf 92.0%
mul-1-neg92.0%
sub-neg92.0%
metadata-eval92.0%
Simplified92.0%
if -9.80000000000000042e-54 < t < 4.80000000000000022e-235Initial program 13.5%
associate-*l/13.6%
Simplified13.6%
Taylor expanded in x around inf 61.3%
associate--l+61.3%
unpow261.3%
distribute-lft-out61.3%
unpow261.3%
unpow261.3%
associate-*r/61.3%
mul-1-neg61.3%
+-commutative61.3%
unpow261.3%
associate-*l*61.3%
unpow261.3%
fma-udef61.3%
Simplified61.3%
Taylor expanded in l around inf 44.2%
associate-*l*44.3%
Simplified44.3%
Taylor expanded in l around 0 44.5%
associate-*l/44.5%
*-lft-identity44.5%
Simplified44.5%
if 4.80000000000000022e-235 < t Initial program 38.0%
associate-*r/38.0%
fma-neg38.0%
sub-neg38.0%
metadata-eval38.0%
+-commutative38.0%
fma-def38.0%
distribute-rgt-neg-in38.0%
Simplified38.0%
Applied egg-rr72.9%
Taylor expanded in t around inf 85.4%
Final simplification79.1%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ 0.5 (* x x))))
(if (<= t -2.8e-237)
(+ (/ 1.0 x) (- -1.0 t_1))
(if (<= t 4.5e-248) (* (sqrt x) (/ t l)) (+ 1.0 (+ t_1 (/ -1.0 x)))))))
double code(double x, double l, double t) {
double t_1 = 0.5 / (x * x);
double tmp;
if (t <= -2.8e-237) {
tmp = (1.0 / x) + (-1.0 - t_1);
} else if (t <= 4.5e-248) {
tmp = sqrt(x) * (t / l);
} else {
tmp = 1.0 + (t_1 + (-1.0 / x));
}
return tmp;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 0.5d0 / (x * x)
if (t <= (-2.8d-237)) then
tmp = (1.0d0 / x) + ((-1.0d0) - t_1)
else if (t <= 4.5d-248) then
tmp = sqrt(x) * (t / l)
else
tmp = 1.0d0 + (t_1 + ((-1.0d0) / x))
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double t_1 = 0.5 / (x * x);
double tmp;
if (t <= -2.8e-237) {
tmp = (1.0 / x) + (-1.0 - t_1);
} else if (t <= 4.5e-248) {
tmp = Math.sqrt(x) * (t / l);
} else {
tmp = 1.0 + (t_1 + (-1.0 / x));
}
return tmp;
}
def code(x, l, t): t_1 = 0.5 / (x * x) tmp = 0 if t <= -2.8e-237: tmp = (1.0 / x) + (-1.0 - t_1) elif t <= 4.5e-248: tmp = math.sqrt(x) * (t / l) else: tmp = 1.0 + (t_1 + (-1.0 / x)) return tmp
function code(x, l, t) t_1 = Float64(0.5 / Float64(x * x)) tmp = 0.0 if (t <= -2.8e-237) tmp = Float64(Float64(1.0 / x) + Float64(-1.0 - t_1)); elseif (t <= 4.5e-248) tmp = Float64(sqrt(x) * Float64(t / l)); else tmp = Float64(1.0 + Float64(t_1 + Float64(-1.0 / x))); end return tmp end
function tmp_2 = code(x, l, t) t_1 = 0.5 / (x * x); tmp = 0.0; if (t <= -2.8e-237) tmp = (1.0 / x) + (-1.0 - t_1); elseif (t <= 4.5e-248) tmp = sqrt(x) * (t / l); else tmp = 1.0 + (t_1 + (-1.0 / x)); end tmp_2 = tmp; end
code[x_, l_, t_] := Block[{t$95$1 = N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.8e-237], N[(N[(1.0 / x), $MachinePrecision] + N[(-1.0 - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.5e-248], 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}
\\
\begin{array}{l}
t_1 := \frac{0.5}{x \cdot x}\\
\mathbf{if}\;t \leq -2.8 \cdot 10^{-237}:\\
\;\;\;\;\frac{1}{x} + \left(-1 - t_1\right)\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-248}:\\
\;\;\;\;\sqrt{x} \cdot \frac{t}{\ell}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(t_1 + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -2.79999999999999997e-237Initial program 32.9%
associate-/l*32.9%
fma-neg32.9%
remove-double-neg32.9%
fma-neg32.9%
sub-neg32.9%
metadata-eval32.9%
remove-double-neg32.9%
fma-def32.9%
Simplified32.9%
Taylor expanded in t around -inf 79.2%
associate-*r*79.2%
neg-mul-179.2%
+-commutative79.2%
sub-neg79.2%
metadata-eval79.2%
+-commutative79.2%
Simplified79.2%
Taylor expanded in x around inf 78.7%
associate-*r/78.7%
metadata-eval78.7%
unpow278.7%
Simplified78.7%
if -2.79999999999999997e-237 < t < 4.4999999999999996e-248Initial program 1.5%
associate-*r/1.5%
fma-neg1.5%
sub-neg1.5%
metadata-eval1.5%
+-commutative1.5%
fma-def1.5%
distribute-rgt-neg-in1.5%
Simplified1.5%
Taylor expanded in l around inf 1.8%
*-commutative1.8%
associate--l+1.8%
sub-neg1.8%
metadata-eval1.8%
+-commutative1.8%
sub-neg1.8%
metadata-eval1.8%
+-commutative1.8%
Simplified1.8%
Taylor expanded in x around inf 72.9%
Taylor expanded in t around 0 69.6%
if 4.4999999999999996e-248 < t Initial program 38.0%
associate-/l*38.0%
fma-neg38.0%
remove-double-neg38.0%
fma-neg38.0%
sub-neg38.0%
metadata-eval38.0%
remove-double-neg38.0%
fma-def38.0%
Simplified38.0%
Taylor expanded in t around -inf 1.6%
associate-*r*1.6%
neg-mul-11.6%
+-commutative1.6%
sub-neg1.6%
metadata-eval1.6%
+-commutative1.6%
Simplified1.6%
add-sqr-sqrt0.0%
sqrt-unprod85.4%
frac-times85.4%
add-sqr-sqrt84.1%
pow284.1%
Applied egg-rr84.2%
Taylor expanded in x around inf 85.2%
associate--l+85.2%
associate-*r/85.2%
metadata-eval85.2%
unpow285.2%
Simplified85.2%
Final simplification80.9%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ 0.5 (* x x))))
(if (<= t -7.5e-56)
(+ (/ 1.0 x) (- -1.0 t_1))
(if (<= t 1.8e-235) (* t (/ (sqrt x) l)) (+ 1.0 (+ t_1 (/ -1.0 x)))))))
double code(double x, double l, double t) {
double t_1 = 0.5 / (x * x);
double tmp;
if (t <= -7.5e-56) {
tmp = (1.0 / x) + (-1.0 - t_1);
} else if (t <= 1.8e-235) {
tmp = t * (sqrt(x) / l);
} else {
tmp = 1.0 + (t_1 + (-1.0 / x));
}
return tmp;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 0.5d0 / (x * x)
if (t <= (-7.5d-56)) then
tmp = (1.0d0 / x) + ((-1.0d0) - t_1)
else if (t <= 1.8d-235) then
tmp = t * (sqrt(x) / l)
else
tmp = 1.0d0 + (t_1 + ((-1.0d0) / x))
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double t_1 = 0.5 / (x * x);
double tmp;
if (t <= -7.5e-56) {
tmp = (1.0 / x) + (-1.0 - t_1);
} else if (t <= 1.8e-235) {
tmp = t * (Math.sqrt(x) / l);
} else {
tmp = 1.0 + (t_1 + (-1.0 / x));
}
return tmp;
}
def code(x, l, t): t_1 = 0.5 / (x * x) tmp = 0 if t <= -7.5e-56: tmp = (1.0 / x) + (-1.0 - t_1) elif t <= 1.8e-235: tmp = t * (math.sqrt(x) / l) else: tmp = 1.0 + (t_1 + (-1.0 / x)) return tmp
function code(x, l, t) t_1 = Float64(0.5 / Float64(x * x)) tmp = 0.0 if (t <= -7.5e-56) tmp = Float64(Float64(1.0 / x) + Float64(-1.0 - t_1)); elseif (t <= 1.8e-235) tmp = Float64(t * Float64(sqrt(x) / l)); else tmp = Float64(1.0 + Float64(t_1 + Float64(-1.0 / x))); end return tmp end
function tmp_2 = code(x, l, t) t_1 = 0.5 / (x * x); tmp = 0.0; if (t <= -7.5e-56) tmp = (1.0 / x) + (-1.0 - t_1); elseif (t <= 1.8e-235) tmp = t * (sqrt(x) / l); else tmp = 1.0 + (t_1 + (-1.0 / x)); end tmp_2 = tmp; end
code[x_, l_, t_] := Block[{t$95$1 = N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.5e-56], N[(N[(1.0 / x), $MachinePrecision] + N[(-1.0 - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.8e-235], 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}
\\
\begin{array}{l}
t_1 := \frac{0.5}{x \cdot x}\\
\mathbf{if}\;t \leq -7.5 \cdot 10^{-56}:\\
\;\;\;\;\frac{1}{x} + \left(-1 - t_1\right)\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{-235}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(t_1 + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -7.50000000000000041e-56Initial program 38.3%
associate-/l*38.3%
fma-neg38.3%
remove-double-neg38.3%
fma-neg38.3%
sub-neg38.3%
metadata-eval38.3%
remove-double-neg38.3%
fma-def38.3%
Simplified38.3%
Taylor expanded in t around -inf 92.0%
associate-*r*92.0%
neg-mul-192.0%
+-commutative92.0%
sub-neg92.0%
metadata-eval92.0%
+-commutative92.0%
Simplified92.0%
Taylor expanded in x around inf 91.2%
associate-*r/91.2%
metadata-eval91.2%
unpow291.2%
Simplified91.2%
if -7.50000000000000041e-56 < t < 1.79999999999999999e-235Initial program 13.5%
associate-*l/13.6%
Simplified13.6%
Taylor expanded in x around inf 61.3%
associate--l+61.3%
unpow261.3%
distribute-lft-out61.3%
unpow261.3%
unpow261.3%
associate-*r/61.3%
mul-1-neg61.3%
+-commutative61.3%
unpow261.3%
associate-*l*61.3%
unpow261.3%
fma-udef61.3%
Simplified61.3%
Taylor expanded in l around inf 44.2%
associate-*l*44.3%
Simplified44.3%
Taylor expanded in l around 0 44.5%
associate-*l/44.5%
*-lft-identity44.5%
Simplified44.5%
if 1.79999999999999999e-235 < t Initial program 38.0%
associate-/l*38.0%
fma-neg38.0%
remove-double-neg38.0%
fma-neg38.0%
sub-neg38.0%
metadata-eval38.0%
remove-double-neg38.0%
fma-def38.0%
Simplified38.0%
Taylor expanded in t around -inf 1.6%
associate-*r*1.6%
neg-mul-11.6%
+-commutative1.6%
sub-neg1.6%
metadata-eval1.6%
+-commutative1.6%
Simplified1.6%
add-sqr-sqrt0.0%
sqrt-unprod85.4%
frac-times85.4%
add-sqr-sqrt84.1%
pow284.1%
Applied egg-rr84.2%
Taylor expanded in x around inf 85.2%
associate--l+85.2%
associate-*r/85.2%
metadata-eval85.2%
unpow285.2%
Simplified85.2%
Final simplification78.7%
(FPCore (x l t) :precision binary64 (if (<= t -5e-310) (+ (/ 1.0 x) -1.0) (+ 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 / x) + -1.0;
} 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 / x) + (-1.0d0)
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 / x) + -1.0;
} 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 / x) + -1.0 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(Float64(1.0 / x) + -1.0); 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 / x) + -1.0; 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[(N[(1.0 / x), $MachinePrecision] + -1.0), $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}:\\
\;\;\;\;\frac{1}{x} + -1\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 31.0%
associate-/l*31.0%
fma-neg31.0%
remove-double-neg31.0%
fma-neg31.0%
sub-neg31.0%
metadata-eval31.0%
remove-double-neg31.0%
fma-def31.0%
Simplified31.0%
Taylor expanded in t around -inf 76.1%
associate-*r*76.1%
neg-mul-176.1%
+-commutative76.1%
sub-neg76.1%
metadata-eval76.1%
+-commutative76.1%
Simplified76.1%
Taylor expanded in x around inf 75.4%
if -4.999999999999985e-310 < t Initial program 35.0%
associate-/l*35.0%
fma-neg35.1%
remove-double-neg35.1%
fma-neg35.0%
sub-neg35.0%
metadata-eval35.0%
remove-double-neg35.0%
fma-def35.0%
Simplified35.0%
Taylor expanded in t around -inf 1.7%
associate-*r*1.7%
neg-mul-11.7%
+-commutative1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
Simplified1.7%
add-sqr-sqrt0.0%
sqrt-unprod78.8%
frac-times78.8%
add-sqr-sqrt77.7%
pow277.7%
Applied egg-rr77.7%
Taylor expanded in x around inf 78.7%
associate--l+78.7%
associate-*r/78.7%
metadata-eval78.7%
unpow278.7%
Simplified78.7%
Final simplification77.0%
(FPCore (x l t) :precision binary64 (let* ((t_1 (/ 0.5 (* x x)))) (if (<= t -5e-310) (+ (/ 1.0 x) (- -1.0 t_1)) (+ 1.0 (+ t_1 (/ -1.0 x))))))
double code(double x, double l, double t) {
double t_1 = 0.5 / (x * x);
double tmp;
if (t <= -5e-310) {
tmp = (1.0 / x) + (-1.0 - t_1);
} else {
tmp = 1.0 + (t_1 + (-1.0 / x));
}
return tmp;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 0.5d0 / (x * x)
if (t <= (-5d-310)) then
tmp = (1.0d0 / x) + ((-1.0d0) - t_1)
else
tmp = 1.0d0 + (t_1 + ((-1.0d0) / x))
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double t_1 = 0.5 / (x * x);
double tmp;
if (t <= -5e-310) {
tmp = (1.0 / x) + (-1.0 - t_1);
} else {
tmp = 1.0 + (t_1 + (-1.0 / x));
}
return tmp;
}
def code(x, l, t): t_1 = 0.5 / (x * x) tmp = 0 if t <= -5e-310: tmp = (1.0 / x) + (-1.0 - t_1) else: tmp = 1.0 + (t_1 + (-1.0 / x)) return tmp
function code(x, l, t) t_1 = Float64(0.5 / Float64(x * x)) tmp = 0.0 if (t <= -5e-310) tmp = Float64(Float64(1.0 / x) + Float64(-1.0 - t_1)); else tmp = Float64(1.0 + Float64(t_1 + Float64(-1.0 / x))); end return tmp end
function tmp_2 = code(x, l, t) t_1 = 0.5 / (x * x); tmp = 0.0; if (t <= -5e-310) tmp = (1.0 / x) + (-1.0 - t_1); else tmp = 1.0 + (t_1 + (-1.0 / x)); end tmp_2 = tmp; end
code[x_, l_, t_] := Block[{t$95$1 = N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5e-310], N[(N[(1.0 / x), $MachinePrecision] + N[(-1.0 - t$95$1), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(t$95$1 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{0.5}{x \cdot x}\\
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{1}{x} + \left(-1 - t_1\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(t_1 + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 31.0%
associate-/l*31.0%
fma-neg31.0%
remove-double-neg31.0%
fma-neg31.0%
sub-neg31.0%
metadata-eval31.0%
remove-double-neg31.0%
fma-def31.0%
Simplified31.0%
Taylor expanded in t around -inf 76.1%
associate-*r*76.1%
neg-mul-176.1%
+-commutative76.1%
sub-neg76.1%
metadata-eval76.1%
+-commutative76.1%
Simplified76.1%
Taylor expanded in x around inf 75.6%
associate-*r/75.6%
metadata-eval75.6%
unpow275.6%
Simplified75.6%
if -4.999999999999985e-310 < t Initial program 35.0%
associate-/l*35.0%
fma-neg35.1%
remove-double-neg35.1%
fma-neg35.0%
sub-neg35.0%
metadata-eval35.0%
remove-double-neg35.0%
fma-def35.0%
Simplified35.0%
Taylor expanded in t around -inf 1.7%
associate-*r*1.7%
neg-mul-11.7%
+-commutative1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
Simplified1.7%
add-sqr-sqrt0.0%
sqrt-unprod78.8%
frac-times78.8%
add-sqr-sqrt77.7%
pow277.7%
Applied egg-rr77.7%
Taylor expanded in x around inf 78.7%
associate--l+78.7%
associate-*r/78.7%
metadata-eval78.7%
unpow278.7%
Simplified78.7%
Final simplification77.1%
(FPCore (x l t) :precision binary64 (if (<= t -5e-310) -1.0 (+ 1.0 (/ -1.0 x))))
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5d-310)) then
tmp = -1.0d0
else
tmp = 1.0d0 + ((-1.0d0) / x)
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = -1.0 else: tmp = 1.0 + (-1.0 / x) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -5e-310) tmp = -1.0; else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-310) tmp = -1.0; else tmp = 1.0 + (-1.0 / x); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -5e-310], -1.0, N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 31.0%
associate-/l*31.0%
fma-neg31.0%
remove-double-neg31.0%
fma-neg31.0%
sub-neg31.0%
metadata-eval31.0%
remove-double-neg31.0%
fma-def31.0%
Simplified31.0%
Taylor expanded in t around -inf 76.1%
associate-*r*76.1%
neg-mul-176.1%
+-commutative76.1%
sub-neg76.1%
metadata-eval76.1%
+-commutative76.1%
Simplified76.1%
Taylor expanded in x around inf 74.4%
if -4.999999999999985e-310 < t Initial program 35.0%
associate-/l*35.0%
fma-neg35.1%
remove-double-neg35.1%
fma-neg35.0%
sub-neg35.0%
metadata-eval35.0%
remove-double-neg35.0%
fma-def35.0%
Simplified35.0%
Taylor expanded in t around -inf 1.7%
associate-*r*1.7%
neg-mul-11.7%
+-commutative1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
Simplified1.7%
add-sqr-sqrt0.0%
sqrt-unprod78.8%
frac-times78.8%
add-sqr-sqrt77.7%
pow277.7%
Applied egg-rr77.7%
Taylor expanded in x around inf 78.5%
Final simplification76.4%
(FPCore (x l t) :precision binary64 (if (<= t -5e-310) (+ (/ 1.0 x) -1.0) (+ 1.0 (/ -1.0 x))))
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = (1.0 / x) + -1.0;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5d-310)) then
tmp = (1.0d0 / x) + (-1.0d0)
else
tmp = 1.0d0 + ((-1.0d0) / x)
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = (1.0 / x) + -1.0;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = (1.0 / x) + -1.0 else: tmp = 1.0 + (-1.0 / x) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -5e-310) tmp = Float64(Float64(1.0 / x) + -1.0); else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-310) tmp = (1.0 / x) + -1.0; else tmp = 1.0 + (-1.0 / x); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -5e-310], N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{1}{x} + -1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 31.0%
associate-/l*31.0%
fma-neg31.0%
remove-double-neg31.0%
fma-neg31.0%
sub-neg31.0%
metadata-eval31.0%
remove-double-neg31.0%
fma-def31.0%
Simplified31.0%
Taylor expanded in t around -inf 76.1%
associate-*r*76.1%
neg-mul-176.1%
+-commutative76.1%
sub-neg76.1%
metadata-eval76.1%
+-commutative76.1%
Simplified76.1%
Taylor expanded in x around inf 75.4%
if -4.999999999999985e-310 < t Initial program 35.0%
associate-/l*35.0%
fma-neg35.1%
remove-double-neg35.1%
fma-neg35.0%
sub-neg35.0%
metadata-eval35.0%
remove-double-neg35.0%
fma-def35.0%
Simplified35.0%
Taylor expanded in t around -inf 1.7%
associate-*r*1.7%
neg-mul-11.7%
+-commutative1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
Simplified1.7%
add-sqr-sqrt0.0%
sqrt-unprod78.8%
frac-times78.8%
add-sqr-sqrt77.7%
pow277.7%
Applied egg-rr77.7%
Taylor expanded in x around inf 78.5%
Final simplification76.9%
(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 31.0%
associate-/l*31.0%
fma-neg31.0%
remove-double-neg31.0%
fma-neg31.0%
sub-neg31.0%
metadata-eval31.0%
remove-double-neg31.0%
fma-def31.0%
Simplified31.0%
Taylor expanded in t around -inf 76.1%
associate-*r*76.1%
neg-mul-176.1%
+-commutative76.1%
sub-neg76.1%
metadata-eval76.1%
+-commutative76.1%
Simplified76.1%
Taylor expanded in x around inf 74.4%
if -4.999999999999985e-310 < t Initial program 35.0%
associate-*l/35.1%
Simplified35.1%
Taylor expanded in x around inf 76.2%
sqrt-unprod77.3%
metadata-eval77.3%
metadata-eval77.3%
Applied egg-rr77.3%
Final simplification75.8%
(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.9%
associate-/l*32.9%
fma-neg33.0%
remove-double-neg33.0%
fma-neg32.9%
sub-neg32.9%
metadata-eval32.9%
remove-double-neg32.9%
fma-def32.9%
Simplified32.9%
Taylor expanded in t around -inf 40.4%
associate-*r*40.4%
neg-mul-140.4%
+-commutative40.4%
sub-neg40.4%
metadata-eval40.4%
+-commutative40.4%
Simplified40.4%
Taylor expanded in x around inf 39.5%
Final simplification39.5%
herbie shell --seed 2023207
(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)))))