
(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)))) (/ l (/ x (* 2.0 l))))))))
(t_2 (fma 2.0 (* t t) (* l l))))
(if (<= t -4200000.0)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t 2.55e-227)
t_1
(if (<= t 1.75e-159)
(*
t
(/
(sqrt 2.0)
(fma 0.5 (/ (+ t_2 t_2) (* (sqrt 2.0) (* t x))) (* t (sqrt 2.0)))))
(if (<= t 1.05e+107) t_1 (+ 1.0 (+ (/ 0.5 (* x x)) (/ -1.0 x)))))))))
double code(double x, double l, double t) {
double t_1 = t * (sqrt(2.0) / sqrt(((2.0 * (t * (t + (t / x)))) + (l / (x / (2.0 * l))))));
double t_2 = fma(2.0, (t * t), (l * l));
double tmp;
if (t <= -4200000.0) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 2.55e-227) {
tmp = t_1;
} else if (t <= 1.75e-159) {
tmp = t * (sqrt(2.0) / fma(0.5, ((t_2 + t_2) / (sqrt(2.0) * (t * x))), (t * sqrt(2.0))));
} else if (t <= 1.05e+107) {
tmp = t_1;
} else {
tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
}
return tmp;
}
function code(x, l, t) t_1 = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(2.0 * Float64(t * Float64(t + Float64(t / x)))) + Float64(l / Float64(x / Float64(2.0 * l))))))) t_2 = fma(2.0, Float64(t * t), Float64(l * l)) tmp = 0.0 if (t <= -4200000.0) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= 2.55e-227) tmp = t_1; elseif (t <= 1.75e-159) tmp = Float64(t * Float64(sqrt(2.0) / fma(0.5, Float64(Float64(t_2 + t_2) / Float64(sqrt(2.0) * Float64(t * x))), Float64(t * sqrt(2.0))))); elseif (t <= 1.05e+107) tmp = t_1; else tmp = Float64(1.0 + Float64(Float64(0.5 / Float64(x * x)) + Float64(-1.0 / x))); end return tmp end
code[x_, l_, t_] := Block[{t$95$1 = N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(2.0 * N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(l / N[(x / N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(t * t), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4200000.0], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 2.55e-227], t$95$1, If[LessEqual[t, 1.75e-159], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(0.5 * N[(N[(t$95$2 + t$95$2), $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, 1.05e+107], t$95$1, N[(1.0 + N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \frac{\ell}{\frac{x}{2 \cdot \ell}}}}\\
t_2 := \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)\\
\mathbf{if}\;t \leq -4200000:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{-227}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{-159}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(0.5, \frac{t_2 + t_2}{\sqrt{2} \cdot \left(t \cdot x\right)}, t \cdot \sqrt{2}\right)}\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{+107}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -4.2e6Initial program 38.2%
Applied egg-rr85.1%
Taylor expanded in t around -inf 92.4%
mul-1-neg92.4%
sub-neg92.4%
metadata-eval92.4%
Simplified92.4%
if -4.2e6 < t < 2.54999999999999996e-227 or 1.75000000000000001e-159 < t < 1.05e107Initial program 41.0%
associate-*l/41.1%
Simplified41.1%
Taylor expanded in x around inf 80.2%
associate--l+80.2%
unpow280.2%
distribute-lft-out80.2%
unpow280.2%
unpow280.2%
associate-*r/80.2%
mul-1-neg80.2%
+-commutative80.2%
unpow280.2%
unpow280.2%
fma-udef80.2%
Simplified80.2%
Taylor expanded in t around 0 80.1%
associate-*r/80.1%
mul-1-neg80.1%
unpow280.1%
distribute-rgt-neg-in80.1%
Simplified80.1%
expm1-log1p-u79.1%
expm1-udef31.2%
associate-/l*31.2%
+-commutative31.2%
fma-def31.2%
associate-/l*31.2%
Applied egg-rr31.2%
Simplified86.8%
if 2.54999999999999996e-227 < t < 1.75000000000000001e-159Initial program 2.6%
associate-*l/2.6%
Simplified2.6%
Taylor expanded in x around inf 86.1%
fma-def86.1%
+-commutative86.1%
unpow286.1%
unpow286.1%
fma-udef86.1%
mul-1-neg86.1%
+-commutative86.1%
unpow286.1%
unpow286.1%
fma-udef86.1%
*-commutative86.1%
Simplified86.1%
if 1.05e107 < t Initial program 23.7%
Applied egg-rr81.5%
Taylor expanded in t around inf 96.6%
Taylor expanded in x around inf 96.6%
associate--l+96.6%
associate-*r/96.6%
metadata-eval96.6%
unpow296.6%
Simplified96.6%
Final simplification90.5%
(FPCore (x l t)
:precision binary64
(let* ((t_1
(*
t
(/
(sqrt 2.0)
(sqrt (+ (* 2.0 (* t (+ t (/ t x)))) (/ l (/ x (* 2.0 l)))))))))
(if (<= t -4200000.0)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t 3.2e-224)
t_1
(if (<= t 2.18e-159)
1.0
(if (<= t 3e+97) t_1 (+ 1.0 (+ (/ 0.5 (* x x)) (/ -1.0 x)))))))))
double code(double x, double l, double t) {
double t_1 = t * (sqrt(2.0) / sqrt(((2.0 * (t * (t + (t / x)))) + (l / (x / (2.0 * l))))));
double tmp;
if (t <= -4200000.0) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 3.2e-224) {
tmp = t_1;
} else if (t <= 2.18e-159) {
tmp = 1.0;
} else if (t <= 3e+97) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = t * (sqrt(2.0d0) / sqrt(((2.0d0 * (t * (t + (t / x)))) + (l / (x / (2.0d0 * l))))))
if (t <= (-4200000.0d0)) then
tmp = -sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else if (t <= 3.2d-224) then
tmp = t_1
else if (t <= 2.18d-159) then
tmp = 1.0d0
else if (t <= 3d+97) then
tmp = t_1
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 t_1 = t * (Math.sqrt(2.0) / Math.sqrt(((2.0 * (t * (t + (t / x)))) + (l / (x / (2.0 * l))))));
double tmp;
if (t <= -4200000.0) {
tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 3.2e-224) {
tmp = t_1;
} else if (t <= 2.18e-159) {
tmp = 1.0;
} else if (t <= 3e+97) {
tmp = t_1;
} else {
tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
}
return tmp;
}
def code(x, l, t): t_1 = t * (math.sqrt(2.0) / math.sqrt(((2.0 * (t * (t + (t / x)))) + (l / (x / (2.0 * l)))))) tmp = 0 if t <= -4200000.0: tmp = -math.sqrt(((x + -1.0) / (x + 1.0))) elif t <= 3.2e-224: tmp = t_1 elif t <= 2.18e-159: tmp = 1.0 elif t <= 3e+97: tmp = t_1 else: tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x)) return tmp
function code(x, l, t) t_1 = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(2.0 * Float64(t * Float64(t + Float64(t / x)))) + Float64(l / Float64(x / Float64(2.0 * l))))))) tmp = 0.0 if (t <= -4200000.0) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= 3.2e-224) tmp = t_1; elseif (t <= 2.18e-159) tmp = 1.0; elseif (t <= 3e+97) tmp = t_1; 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) t_1 = t * (sqrt(2.0) / sqrt(((2.0 * (t * (t + (t / x)))) + (l / (x / (2.0 * l)))))); tmp = 0.0; if (t <= -4200000.0) tmp = -sqrt(((x + -1.0) / (x + 1.0))); elseif (t <= 3.2e-224) tmp = t_1; elseif (t <= 2.18e-159) tmp = 1.0; elseif (t <= 3e+97) tmp = t_1; else tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x)); end tmp_2 = tmp; end
code[x_, l_, t_] := Block[{t$95$1 = N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(2.0 * N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(l / N[(x / N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4200000.0], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 3.2e-224], t$95$1, If[LessEqual[t, 2.18e-159], 1.0, If[LessEqual[t, 3e+97], t$95$1, N[(1.0 + N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \frac{\ell}{\frac{x}{2 \cdot \ell}}}}\\
\mathbf{if}\;t \leq -4200000:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-224}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.18 \cdot 10^{-159}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+97}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -4.2e6Initial program 38.2%
Applied egg-rr85.1%
Taylor expanded in t around -inf 92.4%
mul-1-neg92.4%
sub-neg92.4%
metadata-eval92.4%
Simplified92.4%
if -4.2e6 < t < 3.1999999999999999e-224 or 2.18e-159 < t < 2.9999999999999998e97Initial program 41.0%
associate-*l/41.1%
Simplified41.1%
Taylor expanded in x around inf 80.2%
associate--l+80.2%
unpow280.2%
distribute-lft-out80.2%
unpow280.2%
unpow280.2%
associate-*r/80.2%
mul-1-neg80.2%
+-commutative80.2%
unpow280.2%
unpow280.2%
fma-udef80.2%
Simplified80.2%
Taylor expanded in t around 0 80.1%
associate-*r/80.1%
mul-1-neg80.1%
unpow280.1%
distribute-rgt-neg-in80.1%
Simplified80.1%
expm1-log1p-u79.1%
expm1-udef31.2%
associate-/l*31.2%
+-commutative31.2%
fma-def31.2%
associate-/l*31.2%
Applied egg-rr31.2%
Simplified86.8%
if 3.1999999999999999e-224 < t < 2.18e-159Initial program 2.6%
Applied egg-rr55.7%
Taylor expanded in t around inf 72.5%
Taylor expanded in x around inf 72.5%
if 2.9999999999999998e97 < t Initial program 23.7%
Applied egg-rr81.5%
Taylor expanded in t around inf 96.6%
Taylor expanded in x around inf 96.6%
associate--l+96.6%
associate-*r/96.6%
metadata-eval96.6%
unpow296.6%
Simplified96.6%
Final simplification89.7%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -4.2e-152)
(- t_1)
(if (<= t 7e-226)
(* t (/ (sqrt 2.0) (* l (sqrt (+ (/ 2.0 (* x x)) (/ 2.0 x))))))
t_1))))
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -4.2e-152) {
tmp = -t_1;
} else if (t <= 7e-226) {
tmp = t * (sqrt(2.0) / (l * sqrt(((2.0 / (x * x)) + (2.0 / x)))));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
if (t <= (-4.2d-152)) then
tmp = -t_1
else if (t <= 7d-226) then
tmp = t * (sqrt(2.0d0) / (l * sqrt(((2.0d0 / (x * x)) + (2.0d0 / x)))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -4.2e-152) {
tmp = -t_1;
} else if (t <= 7e-226) {
tmp = t * (Math.sqrt(2.0) / (l * Math.sqrt(((2.0 / (x * x)) + (2.0 / x)))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, l, t): t_1 = math.sqrt(((x + -1.0) / (x + 1.0))) tmp = 0 if t <= -4.2e-152: tmp = -t_1 elif t <= 7e-226: tmp = t * (math.sqrt(2.0) / (l * math.sqrt(((2.0 / (x * x)) + (2.0 / x))))) else: tmp = t_1 return tmp
function code(x, l, t) t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -4.2e-152) tmp = Float64(-t_1); elseif (t <= 7e-226) tmp = Float64(t * Float64(sqrt(2.0) / Float64(l * sqrt(Float64(Float64(2.0 / Float64(x * x)) + Float64(2.0 / x)))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, l, t) t_1 = sqrt(((x + -1.0) / (x + 1.0))); tmp = 0.0; if (t <= -4.2e-152) tmp = -t_1; elseif (t <= 7e-226) tmp = t * (sqrt(2.0) / (l * sqrt(((2.0 / (x * x)) + (2.0 / x))))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -4.2e-152], (-t$95$1), If[LessEqual[t, 7e-226], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(l * N[Sqrt[N[(N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -4.2 \cdot 10^{-152}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-226}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \sqrt{\frac{2}{x \cdot x} + \frac{2}{x}}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -4.19999999999999998e-152Initial program 44.1%
Applied egg-rr77.8%
Taylor expanded in t around -inf 86.4%
mul-1-neg86.4%
sub-neg86.4%
metadata-eval86.4%
Simplified86.4%
if -4.19999999999999998e-152 < t < 7e-226Initial program 3.4%
associate-*l/3.4%
Simplified3.4%
Taylor expanded in t around 0 9.1%
associate-/l*3.5%
+-commutative3.5%
sub-neg3.5%
metadata-eval3.5%
+-commutative3.5%
unpow23.5%
unpow23.5%
Simplified3.5%
Taylor expanded in x around -inf 52.0%
unpow252.0%
associate-*r/52.0%
mul-1-neg52.0%
neg-mul-152.0%
unpow252.0%
distribute-rgt-neg-in52.0%
unpow252.0%
unpow252.0%
associate-*r/52.0%
neg-mul-152.0%
unpow252.0%
distribute-rgt-neg-in52.0%
Simplified52.0%
Taylor expanded in l around 0 42.3%
*-commutative42.3%
associate-*r/42.3%
metadata-eval42.3%
unpow242.3%
associate-*r/42.3%
metadata-eval42.3%
Simplified42.3%
if 7e-226 < t Initial program 35.7%
Applied egg-rr68.6%
Taylor expanded in t around inf 85.6%
Final simplification79.7%
(FPCore (x l t) :precision binary64 (if (<= t -2.35e-150) (+ -1.0 (/ 1.0 x)) (if (<= t 3.7e-224) (/ (* t (sqrt x)) l) (sqrt (/ (+ x -1.0) (+ x 1.0))))))
double code(double x, double l, double t) {
double tmp;
if (t <= -2.35e-150) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 3.7e-224) {
tmp = (t * sqrt(x)) / l;
} else {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-2.35d-150)) then
tmp = (-1.0d0) + (1.0d0 / x)
else if (t <= 3.7d-224) then
tmp = (t * sqrt(x)) / l
else
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= -2.35e-150) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 3.7e-224) {
tmp = (t * Math.sqrt(x)) / l;
} else {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -2.35e-150: tmp = -1.0 + (1.0 / x) elif t <= 3.7e-224: tmp = (t * math.sqrt(x)) / l else: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -2.35e-150) tmp = Float64(-1.0 + Float64(1.0 / x)); elseif (t <= 3.7e-224) tmp = Float64(Float64(t * sqrt(x)) / l); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -2.35e-150) tmp = -1.0 + (1.0 / x); elseif (t <= 3.7e-224) tmp = (t * sqrt(x)) / l; else tmp = sqrt(((x + -1.0) / (x + 1.0))); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -2.35e-150], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.7e-224], N[(N[(t * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.35 \cdot 10^{-150}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{-224}:\\
\;\;\;\;\frac{t \cdot \sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -2.3499999999999999e-150Initial program 44.1%
Applied egg-rr77.8%
Taylor expanded in t around inf 1.6%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt85.8%
Simplified85.8%
if -2.3499999999999999e-150 < t < 3.7000000000000002e-224Initial program 3.4%
associate-*l/3.4%
Simplified3.4%
Taylor expanded in t around 0 9.1%
associate-/l*3.5%
+-commutative3.5%
sub-neg3.5%
metadata-eval3.5%
+-commutative3.5%
unpow23.5%
unpow23.5%
Simplified3.5%
Taylor expanded in x around inf 67.6%
cancel-sign-sub-inv67.6%
unpow267.6%
metadata-eval67.6%
*-commutative67.6%
*-rgt-identity67.6%
unpow267.6%
Simplified67.6%
Taylor expanded in l around 0 42.4%
associate-*l/42.4%
*-lft-identity42.4%
Simplified42.4%
associate-*l/42.5%
Applied egg-rr42.5%
if 3.7000000000000002e-224 < t Initial program 35.7%
Applied egg-rr68.6%
Taylor expanded in t around inf 85.6%
Final simplification79.5%
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -3.1e-151)
(- t_1)
(if (<= t 6.4e-225) (/ (* t (sqrt x)) l) t_1))))
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -3.1e-151) {
tmp = -t_1;
} else if (t <= 6.4e-225) {
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)) / (x + 1.0d0)))
if (t <= (-3.1d-151)) then
tmp = -t_1
else if (t <= 6.4d-225) 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) / (x + 1.0)));
double tmp;
if (t <= -3.1e-151) {
tmp = -t_1;
} else if (t <= 6.4e-225) {
tmp = (t * Math.sqrt(x)) / l;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, l, t): t_1 = math.sqrt(((x + -1.0) / (x + 1.0))) tmp = 0 if t <= -3.1e-151: tmp = -t_1 elif t <= 6.4e-225: 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(x + 1.0))) tmp = 0.0 if (t <= -3.1e-151) tmp = Float64(-t_1); elseif (t <= 6.4e-225) tmp = Float64(Float64(t * sqrt(x)) / l); else tmp = t_1; end return tmp end
function tmp_2 = code(x, l, t) t_1 = sqrt(((x + -1.0) / (x + 1.0))); tmp = 0.0; if (t <= -3.1e-151) tmp = -t_1; elseif (t <= 6.4e-225) 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[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -3.1e-151], (-t$95$1), If[LessEqual[t, 6.4e-225], N[(N[(t * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -3.1 \cdot 10^{-151}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 6.4 \cdot 10^{-225}:\\
\;\;\;\;\frac{t \cdot \sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -3.09999999999999984e-151Initial program 44.1%
Applied egg-rr77.8%
Taylor expanded in t around -inf 86.4%
mul-1-neg86.4%
sub-neg86.4%
metadata-eval86.4%
Simplified86.4%
if -3.09999999999999984e-151 < t < 6.3999999999999995e-225Initial program 3.4%
associate-*l/3.4%
Simplified3.4%
Taylor expanded in t around 0 9.1%
associate-/l*3.5%
+-commutative3.5%
sub-neg3.5%
metadata-eval3.5%
+-commutative3.5%
unpow23.5%
unpow23.5%
Simplified3.5%
Taylor expanded in x around inf 67.6%
cancel-sign-sub-inv67.6%
unpow267.6%
metadata-eval67.6%
*-commutative67.6%
*-rgt-identity67.6%
unpow267.6%
Simplified67.6%
Taylor expanded in l around 0 42.4%
associate-*l/42.4%
*-lft-identity42.4%
Simplified42.4%
associate-*l/42.5%
Applied egg-rr42.5%
if 6.3999999999999995e-225 < t Initial program 35.7%
Applied egg-rr68.6%
Taylor expanded in t around inf 85.6%
Final simplification79.7%
(FPCore (x l t)
:precision binary64
(if (<= t -2.2e-150)
(+ -1.0 (/ 1.0 x))
(if (<= t 7.2e-226)
(* (sqrt x) (/ t l))
(+ 1.0 (+ (/ 0.5 (* x x)) (/ -1.0 x))))))
double code(double x, double l, double t) {
double tmp;
if (t <= -2.2e-150) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 7.2e-226) {
tmp = sqrt(x) * (t / l);
} 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 <= (-2.2d-150)) then
tmp = (-1.0d0) + (1.0d0 / x)
else if (t <= 7.2d-226) then
tmp = sqrt(x) * (t / l)
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 <= -2.2e-150) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 7.2e-226) {
tmp = Math.sqrt(x) * (t / l);
} else {
tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -2.2e-150: tmp = -1.0 + (1.0 / x) elif t <= 7.2e-226: tmp = math.sqrt(x) * (t / l) else: tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x)) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -2.2e-150) tmp = Float64(-1.0 + Float64(1.0 / x)); elseif (t <= 7.2e-226) tmp = Float64(sqrt(x) * Float64(t / l)); 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 <= -2.2e-150) tmp = -1.0 + (1.0 / x); elseif (t <= 7.2e-226) tmp = sqrt(x) * (t / l); else tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x)); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -2.2e-150], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e-226], N[(N[Sqrt[x], $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{-150}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-226}:\\
\;\;\;\;\sqrt{x} \cdot \frac{t}{\ell}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -2.1999999999999999e-150Initial program 44.1%
Applied egg-rr77.8%
Taylor expanded in t around inf 1.6%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt85.8%
Simplified85.8%
if -2.1999999999999999e-150 < t < 7.19999999999999988e-226Initial program 3.4%
associate-*l/3.4%
Simplified3.4%
Taylor expanded in t around 0 9.1%
associate-/l*3.5%
+-commutative3.5%
sub-neg3.5%
metadata-eval3.5%
+-commutative3.5%
unpow23.5%
unpow23.5%
Simplified3.5%
Taylor expanded in x around inf 67.6%
cancel-sign-sub-inv67.6%
unpow267.6%
metadata-eval67.6%
*-commutative67.6%
*-rgt-identity67.6%
unpow267.6%
Simplified67.6%
Taylor expanded in l around 0 39.9%
if 7.19999999999999988e-226 < t Initial program 35.7%
Applied egg-rr68.6%
Taylor expanded in t around inf 85.6%
Taylor expanded in x around inf 85.1%
associate--l+85.1%
associate-*r/85.1%
metadata-eval85.1%
unpow285.1%
Simplified85.1%
Final simplification78.9%
(FPCore (x l t)
:precision binary64
(if (<= t -1.35e-153)
(+ -1.0 (/ 1.0 x))
(if (<= t 5.8e-225)
(* t (/ (sqrt x) l))
(+ 1.0 (+ (/ 0.5 (* x x)) (/ -1.0 x))))))
double code(double x, double l, double t) {
double tmp;
if (t <= -1.35e-153) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 5.8e-225) {
tmp = t * (sqrt(x) / l);
} 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 <= (-1.35d-153)) then
tmp = (-1.0d0) + (1.0d0 / x)
else if (t <= 5.8d-225) then
tmp = t * (sqrt(x) / l)
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 <= -1.35e-153) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 5.8e-225) {
tmp = t * (Math.sqrt(x) / l);
} else {
tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -1.35e-153: tmp = -1.0 + (1.0 / x) elif t <= 5.8e-225: tmp = t * (math.sqrt(x) / l) else: tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x)) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -1.35e-153) tmp = Float64(-1.0 + Float64(1.0 / x)); elseif (t <= 5.8e-225) tmp = Float64(t * Float64(sqrt(x) / l)); 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 <= -1.35e-153) tmp = -1.0 + (1.0 / x); elseif (t <= 5.8e-225) tmp = t * (sqrt(x) / l); else tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x)); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -1.35e-153], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.8e-225], N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{-153}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{-225}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -1.35000000000000005e-153Initial program 44.1%
Applied egg-rr77.8%
Taylor expanded in t around inf 1.6%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt85.8%
Simplified85.8%
if -1.35000000000000005e-153 < t < 5.7999999999999996e-225Initial program 3.4%
associate-*l/3.4%
Simplified3.4%
Taylor expanded in t around 0 9.1%
associate-/l*3.5%
+-commutative3.5%
sub-neg3.5%
metadata-eval3.5%
+-commutative3.5%
unpow23.5%
unpow23.5%
Simplified3.5%
Taylor expanded in x around inf 67.6%
cancel-sign-sub-inv67.6%
unpow267.6%
metadata-eval67.6%
*-commutative67.6%
*-rgt-identity67.6%
unpow267.6%
Simplified67.6%
Taylor expanded in l around 0 42.4%
associate-*l/42.4%
*-lft-identity42.4%
Simplified42.4%
if 5.7999999999999996e-225 < t Initial program 35.7%
Applied egg-rr68.6%
Taylor expanded in t around inf 85.6%
Taylor expanded in x around inf 85.1%
associate--l+85.1%
associate-*r/85.1%
metadata-eval85.1%
unpow285.1%
Simplified85.1%
Final simplification79.2%
(FPCore (x l t)
:precision binary64
(if (<= t -8.8e-154)
(+ -1.0 (/ 1.0 x))
(if (<= t 3.3e-225)
(/ (* t (sqrt x)) l)
(+ 1.0 (+ (/ 0.5 (* x x)) (/ -1.0 x))))))
double code(double x, double l, double t) {
double tmp;
if (t <= -8.8e-154) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 3.3e-225) {
tmp = (t * sqrt(x)) / l;
} 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 <= (-8.8d-154)) then
tmp = (-1.0d0) + (1.0d0 / x)
else if (t <= 3.3d-225) then
tmp = (t * sqrt(x)) / l
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 <= -8.8e-154) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 3.3e-225) {
tmp = (t * Math.sqrt(x)) / l;
} else {
tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= -8.8e-154: tmp = -1.0 + (1.0 / x) elif t <= 3.3e-225: tmp = (t * math.sqrt(x)) / l else: tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x)) return tmp
function code(x, l, t) tmp = 0.0 if (t <= -8.8e-154) tmp = Float64(-1.0 + Float64(1.0 / x)); elseif (t <= 3.3e-225) tmp = Float64(Float64(t * sqrt(x)) / l); 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 <= -8.8e-154) tmp = -1.0 + (1.0 / x); elseif (t <= 3.3e-225) tmp = (t * sqrt(x)) / l; else tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x)); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, -8.8e-154], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.3e-225], N[(N[(t * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l), $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 -8.8 \cdot 10^{-154}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{-225}:\\
\;\;\;\;\frac{t \cdot \sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -8.80000000000000029e-154Initial program 44.1%
Applied egg-rr77.8%
Taylor expanded in t around inf 1.6%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt85.8%
Simplified85.8%
if -8.80000000000000029e-154 < t < 3.3000000000000001e-225Initial program 3.4%
associate-*l/3.4%
Simplified3.4%
Taylor expanded in t around 0 9.1%
associate-/l*3.5%
+-commutative3.5%
sub-neg3.5%
metadata-eval3.5%
+-commutative3.5%
unpow23.5%
unpow23.5%
Simplified3.5%
Taylor expanded in x around inf 67.6%
cancel-sign-sub-inv67.6%
unpow267.6%
metadata-eval67.6%
*-commutative67.6%
*-rgt-identity67.6%
unpow267.6%
Simplified67.6%
Taylor expanded in l around 0 42.4%
associate-*l/42.4%
*-lft-identity42.4%
Simplified42.4%
associate-*l/42.5%
Applied egg-rr42.5%
if 3.3000000000000001e-225 < t Initial program 35.7%
Applied egg-rr68.6%
Taylor expanded in t around inf 85.6%
Taylor expanded in x around inf 85.1%
associate--l+85.1%
associate-*r/85.1%
metadata-eval85.1%
unpow285.1%
Simplified85.1%
Final simplification79.2%
(FPCore (x l t) :precision binary64 (if (<= t 1.4e-302) (+ -1.0 (/ 1.0 x)) (+ 1.0 (+ (/ 0.5 (* x x)) (/ -1.0 x)))))
double code(double x, double l, double t) {
double tmp;
if (t <= 1.4e-302) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
}
return tmp;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 1.4d-302) then
tmp = (-1.0d0) + (1.0d0 / x)
else
tmp = 1.0d0 + ((0.5d0 / (x * x)) + ((-1.0d0) / x))
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= 1.4e-302) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= 1.4e-302: tmp = -1.0 + (1.0 / x) else: tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x)) return tmp
function code(x, l, t) tmp = 0.0 if (t <= 1.4e-302) tmp = Float64(-1.0 + Float64(1.0 / x)); else tmp = Float64(1.0 + Float64(Float64(0.5 / Float64(x * x)) + Float64(-1.0 / x))); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= 1.4e-302) tmp = -1.0 + (1.0 / x); else tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x)); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, 1.4e-302], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.4 \cdot 10^{-302}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < 1.4e-302Initial program 36.2%
Applied egg-rr71.8%
Taylor expanded in t around inf 1.7%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt76.5%
Simplified76.5%
if 1.4e-302 < t Initial program 32.7%
Applied egg-rr66.0%
Taylor expanded in t around inf 78.1%
Taylor expanded in x around inf 77.7%
associate--l+77.7%
associate-*r/77.7%
metadata-eval77.7%
unpow277.7%
Simplified77.7%
Final simplification77.1%
(FPCore (x l t) :precision binary64 (if (<= t 1.4e-302) (+ -1.0 (/ 1.0 x)) 1.0))
double code(double x, double l, double t) {
double tmp;
if (t <= 1.4e-302) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 1.4d-302) then
tmp = (-1.0d0) + (1.0d0 / x)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= 1.4e-302) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= 1.4e-302: tmp = -1.0 + (1.0 / x) else: tmp = 1.0 return tmp
function code(x, l, t) tmp = 0.0 if (t <= 1.4e-302) tmp = Float64(-1.0 + Float64(1.0 / x)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= 1.4e-302) tmp = -1.0 + (1.0 / x); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, 1.4e-302], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.4 \cdot 10^{-302}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < 1.4e-302Initial program 36.2%
Applied egg-rr71.8%
Taylor expanded in t around inf 1.7%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt76.5%
Simplified76.5%
if 1.4e-302 < t Initial program 32.7%
Applied egg-rr66.0%
Taylor expanded in t around inf 78.1%
Taylor expanded in x around inf 77.2%
Final simplification76.8%
(FPCore (x l t) :precision binary64 (if (<= t 1.4e-302) (+ -1.0 (/ 1.0 x)) (+ 1.0 (/ -1.0 x))))
double code(double x, double l, double t) {
double tmp;
if (t <= 1.4e-302) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 1.4d-302) then
tmp = (-1.0d0) + (1.0d0 / x)
else
tmp = 1.0d0 + ((-1.0d0) / x)
end if
code = tmp
end function
public static double code(double x, double l, double t) {
double tmp;
if (t <= 1.4e-302) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
def code(x, l, t): tmp = 0 if t <= 1.4e-302: tmp = -1.0 + (1.0 / x) else: tmp = 1.0 + (-1.0 / x) return tmp
function code(x, l, t) tmp = 0.0 if (t <= 1.4e-302) tmp = Float64(-1.0 + Float64(1.0 / x)); else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= 1.4e-302) tmp = -1.0 + (1.0 / x); else tmp = 1.0 + (-1.0 / x); end tmp_2 = tmp; end
code[x_, l_, t_] := If[LessEqual[t, 1.4e-302], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.4 \cdot 10^{-302}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < 1.4e-302Initial program 36.2%
Applied egg-rr71.8%
Taylor expanded in t around inf 1.7%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt76.5%
Simplified76.5%
if 1.4e-302 < t Initial program 32.7%
Applied egg-rr66.0%
Taylor expanded in t around inf 78.1%
Taylor expanded in x around inf 77.5%
Final simplification77.0%
(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 36.5%
Applied egg-rr71.5%
Taylor expanded in t around inf 1.7%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt76.4%
Simplified76.4%
if -4.999999999999985e-310 < t Initial program 32.4%
Applied egg-rr66.3%
Taylor expanded in t around inf 77.6%
Taylor expanded in x around inf 76.6%
Final simplification76.5%
(FPCore (x l t) :precision binary64 -1.0)
double code(double x, double l, double t) {
return -1.0;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = -1.0d0
end function
public static double code(double x, double l, double t) {
return -1.0;
}
def code(x, l, t): return -1.0
function code(x, l, t) return -1.0 end
function tmp = code(x, l, t) tmp = -1.0; end
code[x_, l_, t_] := -1.0
\begin{array}{l}
\\
-1
\end{array}
Initial program 34.4%
Applied egg-rr68.9%
Taylor expanded in t around inf 39.9%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt38.8%
Simplified38.8%
Final simplification38.8%
herbie shell --seed 2023242
(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)))))