
(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 7 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 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -8.5e+54)
(- t_1)
(if (<= t -2.8e-188)
(*
t
(/
(sqrt 2.0)
(sqrt (+ (* 2.0 (* t (+ t (/ t x)))) (* 2.0 (* l (/ l x)))))))
(if (<= t -5e-217)
-1.0
(if (<= t 2.8e-278) (* 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 <= -8.5e+54) {
tmp = -t_1;
} else if (t <= -2.8e-188) {
tmp = t * (sqrt(2.0) / sqrt(((2.0 * (t * (t + (t / x)))) + (2.0 * (l * (l / x))))));
} else if (t <= -5e-217) {
tmp = -1.0;
} else if (t <= 2.8e-278) {
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 <= (-8.5d+54)) then
tmp = -t_1
else if (t <= (-2.8d-188)) then
tmp = t * (sqrt(2.0d0) / sqrt(((2.0d0 * (t * (t + (t / x)))) + (2.0d0 * (l * (l / x))))))
else if (t <= (-5d-217)) then
tmp = -1.0d0
else if (t <= 2.8d-278) 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 <= -8.5e+54) {
tmp = -t_1;
} else if (t <= -2.8e-188) {
tmp = t * (Math.sqrt(2.0) / Math.sqrt(((2.0 * (t * (t + (t / x)))) + (2.0 * (l * (l / x))))));
} else if (t <= -5e-217) {
tmp = -1.0;
} else if (t <= 2.8e-278) {
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 <= -8.5e+54: tmp = -t_1 elif t <= -2.8e-188: tmp = t * (math.sqrt(2.0) / math.sqrt(((2.0 * (t * (t + (t / x)))) + (2.0 * (l * (l / x)))))) elif t <= -5e-217: tmp = -1.0 elif t <= 2.8e-278: 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 <= -8.5e+54) tmp = Float64(-t_1); elseif (t <= -2.8e-188) tmp = 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))))))); elseif (t <= -5e-217) tmp = -1.0; elseif (t <= 2.8e-278) 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 <= -8.5e+54) tmp = -t_1; elseif (t <= -2.8e-188) tmp = t * (sqrt(2.0) / sqrt(((2.0 * (t * (t + (t / x)))) + (2.0 * (l * (l / x)))))); elseif (t <= -5e-217) tmp = -1.0; elseif (t <= 2.8e-278) 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, -8.5e+54], (-t$95$1), If[LessEqual[t, -2.8e-188], 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, -5e-217], -1.0, If[LessEqual[t, 2.8e-278], 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 -8.5 \cdot 10^{+54}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq -2.8 \cdot 10^{-188}:\\
\;\;\;\;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{elif}\;t \leq -5 \cdot 10^{-217}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{-278}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -8.4999999999999995e54Initial program 35.2%
associate-*r/35.1%
fma-neg35.1%
sub-neg35.1%
metadata-eval35.1%
+-commutative35.1%
fma-def35.1%
distribute-rgt-neg-in35.1%
Simplified35.1%
Applied egg-rr86.3%
Taylor expanded in t around -inf 96.8%
mul-1-neg96.8%
sub-neg96.8%
metadata-eval96.8%
Simplified96.8%
if -8.4999999999999995e54 < t < -2.8000000000000001e-188Initial program 55.4%
associate-*l/55.5%
Simplified55.5%
Taylor expanded in x around inf 81.2%
associate--l+81.2%
unpow281.2%
distribute-lft-out81.2%
unpow281.2%
unpow281.2%
associate-*r/81.2%
mul-1-neg81.2%
+-commutative81.2%
unpow281.2%
associate-*l*81.2%
unpow281.2%
fma-udef81.2%
Simplified81.2%
Taylor expanded in t around 0 81.2%
associate-*r/81.2%
mul-1-neg81.2%
unpow281.2%
Simplified81.2%
*-un-lft-identity81.2%
associate-*l/81.2%
*-commutative81.2%
+-commutative81.2%
associate-/l*81.2%
distribute-rgt-neg-in81.2%
Applied egg-rr81.2%
*-lft-identity81.2%
+-commutative81.2%
distribute-rgt-neg-out81.2%
unpow281.2%
distribute-frac-neg81.2%
unpow281.2%
associate-*r/87.9%
distribute-lft-neg-in87.9%
cancel-sign-sub87.9%
associate-+l+87.9%
associate-/r/87.9%
distribute-rgt-out87.9%
Simplified87.9%
if -2.8000000000000001e-188 < t < -5.0000000000000002e-217Initial program 3.1%
associate-*l/3.1%
Simplified3.1%
sqrt-undiv3.1%
fma-neg3.1%
distribute-rgt-neg-out3.1%
fma-udef3.1%
associate-*r*3.1%
fma-def3.1%
add-sqr-sqrt2.5%
sqrt-unprod3.7%
distribute-rgt-neg-out3.7%
distribute-rgt-neg-out3.7%
sqr-neg3.7%
sqrt-unprod3.7%
add-sqr-sqrt3.7%
Applied egg-rr3.7%
Taylor expanded in x around inf 3.7%
distribute-lft-out3.7%
unpow23.7%
unpow23.7%
Simplified3.7%
Taylor expanded in t around -inf 100.0%
if -5.0000000000000002e-217 < t < 2.80000000000000008e-278Initial program 1.8%
associate-*l/1.8%
Simplified1.8%
Taylor expanded in x around inf 54.1%
associate--l+54.1%
unpow254.1%
distribute-lft-out54.1%
unpow254.1%
unpow254.1%
associate-*r/54.1%
mul-1-neg54.1%
+-commutative54.1%
unpow254.1%
associate-*l*54.1%
unpow254.1%
fma-udef54.1%
Simplified54.1%
Taylor expanded in t around 0 54.0%
cancel-sign-sub-inv54.0%
metadata-eval54.0%
distribute-rgt1-in54.0%
metadata-eval54.0%
unpow254.0%
associate-*l/55.8%
Simplified55.8%
Taylor expanded in l around 0 63.9%
associate-*l/64.1%
*-lft-identity64.1%
Simplified64.1%
if 2.80000000000000008e-278 < t Initial program 41.1%
associate-*r/41.0%
fma-neg41.0%
sub-neg41.0%
metadata-eval41.0%
+-commutative41.0%
fma-def41.0%
distribute-rgt-neg-in41.0%
Simplified41.0%
Applied egg-rr73.0%
Taylor expanded in t around inf 88.0%
Final simplification88.2%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -6.8e-217) -1.0 (if (<= t 1.75e-272) (* 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 <= -6.8e-217) {
tmp = -1.0;
} else if (t <= 1.75e-272) {
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 <= (-6.8d-217)) then
tmp = -1.0d0
else if (t <= 1.75d-272) 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 <= -6.8e-217) {
tmp = -1.0;
} else if (t <= 1.75e-272) {
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 <= -6.8e-217: tmp = -1.0 elif t <= 1.75e-272: 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 <= -6.8e-217) tmp = -1.0; elseif (t <= 1.75e-272) 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 <= -6.8e-217) tmp = -1.0; elseif (t <= 1.75e-272) 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, -6.8e-217], -1.0, If[LessEqual[t, 1.75e-272], 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 -6.8 \cdot 10^{-217}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{-272}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -6.80000000000000032e-217Initial program 43.3%
associate-*l/43.3%
Simplified43.3%
sqrt-undiv41.2%
fma-neg41.2%
distribute-rgt-neg-out41.2%
fma-udef41.2%
associate-*r*41.2%
fma-def41.2%
add-sqr-sqrt17.1%
sqrt-unprod40.1%
distribute-rgt-neg-out40.1%
distribute-rgt-neg-out40.1%
sqr-neg40.1%
sqrt-unprod41.2%
add-sqr-sqrt41.2%
Applied egg-rr41.2%
Taylor expanded in x around inf 41.2%
distribute-lft-out41.2%
unpow241.2%
unpow241.2%
Simplified41.2%
Taylor expanded in t around -inf 83.7%
if -6.80000000000000032e-217 < t < 1.7499999999999998e-272Initial program 1.8%
associate-*l/1.8%
Simplified1.8%
Taylor expanded in x around inf 54.1%
associate--l+54.1%
unpow254.1%
distribute-lft-out54.1%
unpow254.1%
unpow254.1%
associate-*r/54.1%
mul-1-neg54.1%
+-commutative54.1%
unpow254.1%
associate-*l*54.1%
unpow254.1%
fma-udef54.1%
Simplified54.1%
Taylor expanded in t around 0 54.0%
cancel-sign-sub-inv54.0%
metadata-eval54.0%
distribute-rgt1-in54.0%
metadata-eval54.0%
unpow254.0%
associate-*l/55.8%
Simplified55.8%
Taylor expanded in l around 0 63.9%
associate-*l/64.1%
*-lft-identity64.1%
Simplified64.1%
if 1.7499999999999998e-272 < t Initial program 41.1%
associate-*r/41.0%
fma-neg41.0%
sub-neg41.0%
metadata-eval41.0%
+-commutative41.0%
fma-def41.0%
distribute-rgt-neg-in41.0%
Simplified41.0%
Applied egg-rr73.0%
Taylor expanded in t around inf 88.0%
Final simplification83.9%
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 -7.6e-217)
(- t_1)
(if (<= t 5.5e-279) (* 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 <= -7.6e-217) {
tmp = -t_1;
} else if (t <= 5.5e-279) {
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 <= (-7.6d-217)) then
tmp = -t_1
else if (t <= 5.5d-279) 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 <= -7.6e-217) {
tmp = -t_1;
} else if (t <= 5.5e-279) {
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 <= -7.6e-217: tmp = -t_1 elif t <= 5.5e-279: 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 <= -7.6e-217) tmp = Float64(-t_1); elseif (t <= 5.5e-279) 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 <= -7.6e-217) tmp = -t_1; elseif (t <= 5.5e-279) 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, -7.6e-217], (-t$95$1), If[LessEqual[t, 5.5e-279], 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 -7.6 \cdot 10^{-217}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{-279}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -7.59999999999999974e-217Initial program 43.3%
associate-*r/43.2%
fma-neg43.2%
sub-neg43.2%
metadata-eval43.2%
+-commutative43.2%
fma-def43.2%
distribute-rgt-neg-in43.2%
Simplified43.2%
Applied egg-rr73.4%
Taylor expanded in t around -inf 84.6%
mul-1-neg84.6%
sub-neg84.6%
metadata-eval84.6%
Simplified84.6%
if -7.59999999999999974e-217 < t < 5.5000000000000002e-279Initial program 1.8%
associate-*l/1.8%
Simplified1.8%
Taylor expanded in x around inf 54.1%
associate--l+54.1%
unpow254.1%
distribute-lft-out54.1%
unpow254.1%
unpow254.1%
associate-*r/54.1%
mul-1-neg54.1%
+-commutative54.1%
unpow254.1%
associate-*l*54.1%
unpow254.1%
fma-udef54.1%
Simplified54.1%
Taylor expanded in t around 0 54.0%
cancel-sign-sub-inv54.0%
metadata-eval54.0%
distribute-rgt1-in54.0%
metadata-eval54.0%
unpow254.0%
associate-*l/55.8%
Simplified55.8%
Taylor expanded in l around 0 63.9%
associate-*l/64.1%
*-lft-identity64.1%
Simplified64.1%
if 5.5000000000000002e-279 < t Initial program 41.1%
associate-*r/41.0%
fma-neg41.0%
sub-neg41.0%
metadata-eval41.0%
+-commutative41.0%
fma-def41.0%
distribute-rgt-neg-in41.0%
Simplified41.0%
Applied egg-rr73.0%
Taylor expanded in t around inf 88.0%
Final simplification84.4%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5.5e-217) -1.0 (if (<= t 1.7e-272) (* (sqrt x) (/ t l)) 1.0)))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5.5e-217) {
tmp = -1.0;
} else if (t <= 1.7e-272) {
tmp = sqrt(x) * (t / l);
} 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 <= (-5.5d-217)) then
tmp = -1.0d0
else if (t <= 1.7d-272) then
tmp = sqrt(x) * (t / l)
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 <= -5.5e-217) {
tmp = -1.0;
} else if (t <= 1.7e-272) {
tmp = Math.sqrt(x) * (t / l);
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -5.5e-217: tmp = -1.0 elif t <= 1.7e-272: tmp = math.sqrt(x) * (t / l) else: tmp = 1.0 return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -5.5e-217) tmp = -1.0; elseif (t <= 1.7e-272) tmp = Float64(sqrt(x) * Float64(t / l)); else tmp = 1.0; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5.5e-217) tmp = -1.0; elseif (t <= 1.7e-272) tmp = sqrt(x) * (t / l); 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, -5.5e-217], -1.0, If[LessEqual[t, 1.7e-272], N[(N[Sqrt[x], $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{-217}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{-272}:\\
\;\;\;\;\sqrt{x} \cdot \frac{t}{\ell}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -5.49999999999999975e-217Initial program 43.3%
associate-*l/43.3%
Simplified43.3%
sqrt-undiv41.2%
fma-neg41.2%
distribute-rgt-neg-out41.2%
fma-udef41.2%
associate-*r*41.2%
fma-def41.2%
add-sqr-sqrt17.1%
sqrt-unprod40.1%
distribute-rgt-neg-out40.1%
distribute-rgt-neg-out40.1%
sqr-neg40.1%
sqrt-unprod41.2%
add-sqr-sqrt41.2%
Applied egg-rr41.2%
Taylor expanded in x around inf 41.2%
distribute-lft-out41.2%
unpow241.2%
unpow241.2%
Simplified41.2%
Taylor expanded in t around -inf 83.7%
if -5.49999999999999975e-217 < t < 1.7000000000000002e-272Initial program 1.8%
associate-*l/1.8%
Simplified1.8%
Taylor expanded in x around inf 54.1%
associate--l+54.1%
unpow254.1%
distribute-lft-out54.1%
unpow254.1%
unpow254.1%
associate-*r/54.1%
mul-1-neg54.1%
+-commutative54.1%
unpow254.1%
associate-*l*54.1%
unpow254.1%
fma-udef54.1%
Simplified54.1%
Taylor expanded in t around 0 54.0%
cancel-sign-sub-inv54.0%
metadata-eval54.0%
distribute-rgt1-in54.0%
metadata-eval54.0%
unpow254.0%
associate-*l/55.8%
Simplified55.8%
Taylor expanded in l around 0 60.2%
if 1.7000000000000002e-272 < t Initial program 41.1%
associate-*l/41.2%
Simplified41.2%
sqrt-undiv40.6%
fma-neg40.6%
distribute-rgt-neg-out40.6%
fma-udef40.6%
associate-*r*40.6%
fma-def40.6%
add-sqr-sqrt18.7%
sqrt-unprod40.3%
distribute-rgt-neg-out40.3%
distribute-rgt-neg-out40.3%
sqr-neg40.3%
sqrt-unprod40.4%
add-sqr-sqrt40.4%
Applied egg-rr40.4%
Taylor expanded in x around inf 39.2%
distribute-lft-out39.2%
unpow239.2%
unpow239.2%
Simplified39.2%
Taylor expanded in l around 0 85.7%
Final simplification82.5%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -2.9e-217) -1.0 (if (<= t 7.4e-273) (* t (/ (sqrt x) l)) 1.0)))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -2.9e-217) {
tmp = -1.0;
} else if (t <= 7.4e-273) {
tmp = t * (sqrt(x) / l);
} 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 <= (-2.9d-217)) then
tmp = -1.0d0
else if (t <= 7.4d-273) then
tmp = t * (sqrt(x) / l)
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 <= -2.9e-217) {
tmp = -1.0;
} else if (t <= 7.4e-273) {
tmp = t * (Math.sqrt(x) / l);
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -2.9e-217: tmp = -1.0 elif t <= 7.4e-273: tmp = t * (math.sqrt(x) / l) else: tmp = 1.0 return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -2.9e-217) tmp = -1.0; elseif (t <= 7.4e-273) tmp = Float64(t * Float64(sqrt(x) / l)); else tmp = 1.0; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -2.9e-217) tmp = -1.0; elseif (t <= 7.4e-273) tmp = t * (sqrt(x) / l); 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, -2.9e-217], -1.0, If[LessEqual[t, 7.4e-273], N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{-217}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq 7.4 \cdot 10^{-273}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -2.89999999999999982e-217Initial program 43.3%
associate-*l/43.3%
Simplified43.3%
sqrt-undiv41.2%
fma-neg41.2%
distribute-rgt-neg-out41.2%
fma-udef41.2%
associate-*r*41.2%
fma-def41.2%
add-sqr-sqrt17.1%
sqrt-unprod40.1%
distribute-rgt-neg-out40.1%
distribute-rgt-neg-out40.1%
sqr-neg40.1%
sqrt-unprod41.2%
add-sqr-sqrt41.2%
Applied egg-rr41.2%
Taylor expanded in x around inf 41.2%
distribute-lft-out41.2%
unpow241.2%
unpow241.2%
Simplified41.2%
Taylor expanded in t around -inf 83.7%
if -2.89999999999999982e-217 < t < 7.4000000000000007e-273Initial program 1.8%
associate-*l/1.8%
Simplified1.8%
Taylor expanded in x around inf 54.1%
associate--l+54.1%
unpow254.1%
distribute-lft-out54.1%
unpow254.1%
unpow254.1%
associate-*r/54.1%
mul-1-neg54.1%
+-commutative54.1%
unpow254.1%
associate-*l*54.1%
unpow254.1%
fma-udef54.1%
Simplified54.1%
Taylor expanded in t around 0 54.0%
cancel-sign-sub-inv54.0%
metadata-eval54.0%
distribute-rgt1-in54.0%
metadata-eval54.0%
unpow254.0%
associate-*l/55.8%
Simplified55.8%
Taylor expanded in l around 0 63.9%
associate-*l/64.1%
*-lft-identity64.1%
Simplified64.1%
if 7.4000000000000007e-273 < t Initial program 41.1%
associate-*l/41.2%
Simplified41.2%
sqrt-undiv40.6%
fma-neg40.6%
distribute-rgt-neg-out40.6%
fma-udef40.6%
associate-*r*40.6%
fma-def40.6%
add-sqr-sqrt18.7%
sqrt-unprod40.3%
distribute-rgt-neg-out40.3%
distribute-rgt-neg-out40.3%
sqr-neg40.3%
sqrt-unprod40.4%
add-sqr-sqrt40.4%
Applied egg-rr40.4%
Taylor expanded in x around inf 39.2%
distribute-lft-out39.2%
unpow239.2%
unpow239.2%
Simplified39.2%
Taylor expanded in l around 0 85.7%
Final simplification82.9%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -8.4e-307) -1.0 1.0))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -8.4e-307) {
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 <= (-8.4d-307)) 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 <= -8.4e-307) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -8.4e-307: tmp = -1.0 else: tmp = 1.0 return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -8.4e-307) 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 <= -8.4e-307) 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, -8.4e-307], -1.0, 1.0]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.4 \cdot 10^{-307}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -8.4000000000000004e-307Initial program 38.4%
associate-*l/38.5%
Simplified38.5%
sqrt-undiv36.6%
fma-neg36.6%
distribute-rgt-neg-out36.6%
fma-udef36.6%
associate-*r*36.6%
fma-def36.6%
add-sqr-sqrt15.2%
sqrt-unprod38.5%
distribute-rgt-neg-out38.5%
distribute-rgt-neg-out38.5%
sqr-neg38.5%
sqrt-unprod39.4%
add-sqr-sqrt39.4%
Applied egg-rr39.4%
Taylor expanded in x around inf 39.4%
distribute-lft-out39.4%
unpow239.4%
unpow239.4%
Simplified39.4%
Taylor expanded in t around -inf 77.3%
if -8.4000000000000004e-307 < t Initial program 39.1%
associate-*l/39.2%
Simplified39.2%
sqrt-undiv38.6%
fma-neg38.6%
distribute-rgt-neg-out38.6%
fma-udef38.6%
associate-*r*38.6%
fma-def38.6%
add-sqr-sqrt17.8%
sqrt-unprod40.8%
distribute-rgt-neg-out40.8%
distribute-rgt-neg-out40.8%
sqr-neg40.8%
sqrt-unprod41.0%
add-sqr-sqrt41.0%
Applied egg-rr41.0%
Taylor expanded in x around inf 39.9%
distribute-lft-out39.9%
unpow239.9%
unpow239.9%
Simplified39.9%
Taylor expanded in l around 0 82.4%
Final simplification79.7%
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 38.7%
associate-*l/38.8%
Simplified38.8%
sqrt-undiv37.6%
fma-neg37.6%
distribute-rgt-neg-out37.6%
fma-udef37.6%
associate-*r*37.6%
fma-def37.6%
add-sqr-sqrt16.4%
sqrt-unprod39.6%
distribute-rgt-neg-out39.6%
distribute-rgt-neg-out39.6%
sqr-neg39.6%
sqrt-unprod40.2%
add-sqr-sqrt40.2%
Applied egg-rr40.2%
Taylor expanded in x around inf 39.6%
distribute-lft-out39.6%
unpow239.6%
unpow239.6%
Simplified39.6%
Taylor expanded in t around -inf 41.9%
Final simplification41.9%
herbie shell --seed 2023238
(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)))))