
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1): return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 * v) / ((t1 + u) * (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1): return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 * v) / ((t1 + u) * (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}
(FPCore (u v t1) :precision binary64 (if (<= u -6.8e+128) (/ (* t1 (/ v (+ t1 u))) (- t1 u)) (* (- v) (/ (/ t1 (+ t1 u)) (+ t1 u)))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -6.8e+128) {
tmp = (t1 * (v / (t1 + u))) / (t1 - u);
} else {
tmp = -v * ((t1 / (t1 + u)) / (t1 + u));
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (u <= (-6.8d+128)) then
tmp = (t1 * (v / (t1 + u))) / (t1 - u)
else
tmp = -v * ((t1 / (t1 + u)) / (t1 + u))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -6.8e+128) {
tmp = (t1 * (v / (t1 + u))) / (t1 - u);
} else {
tmp = -v * ((t1 / (t1 + u)) / (t1 + u));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -6.8e+128: tmp = (t1 * (v / (t1 + u))) / (t1 - u) else: tmp = -v * ((t1 / (t1 + u)) / (t1 + u)) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -6.8e+128) tmp = Float64(Float64(t1 * Float64(v / Float64(t1 + u))) / Float64(t1 - u)); else tmp = Float64(Float64(-v) * Float64(Float64(t1 / Float64(t1 + u)) / Float64(t1 + u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -6.8e+128) tmp = (t1 * (v / (t1 + u))) / (t1 - u); else tmp = -v * ((t1 / (t1 + u)) / (t1 + u)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -6.8e+128], N[(N[(t1 * N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t1 - u), $MachinePrecision]), $MachinePrecision], N[((-v) * N[(N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -6.8 \cdot 10^{+128}:\\
\;\;\;\;\frac{t1 \cdot \frac{v}{t1 + u}}{t1 - u}\\
\mathbf{else}:\\
\;\;\;\;\left(-v\right) \cdot \frac{\frac{t1}{t1 + u}}{t1 + u}\\
\end{array}
\end{array}
if u < -6.7999999999999997e128Initial program 78.7%
associate-*l/77.2%
*-commutative77.2%
Simplified77.2%
associate-/r*85.6%
associate-*r/95.8%
*-commutative95.8%
associate-/r/99.8%
frac-2neg99.8%
distribute-frac-neg99.8%
remove-double-neg99.8%
div-inv99.8%
clear-num99.8%
distribute-neg-in99.8%
add-sqr-sqrt62.2%
sqrt-unprod93.5%
sqr-neg93.5%
sqrt-unprod37.7%
add-sqr-sqrt97.7%
sub-neg97.7%
Applied egg-rr97.7%
if -6.7999999999999997e128 < u Initial program 70.7%
associate-*l/77.6%
*-commutative77.6%
Simplified77.6%
neg-mul-177.6%
times-frac97.5%
Applied egg-rr97.5%
associate-*l/97.5%
associate-*r/97.5%
neg-mul-197.5%
Simplified97.5%
Final simplification97.6%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (* v (/ (- t1) (* (+ t1 u) (+ t1 u))))))
(if (<= t1 -2.4e+145)
(/ (- (* v (/ u t1)) v) (+ t1 u))
(if (<= t1 -1.22e-164)
t_1
(if (<= t1 4.4e-166)
(* (/ v u) (/ t1 (- u)))
(if (<= t1 1.6e+137) t_1 (/ (- v) (+ t1 u))))))))
double code(double u, double v, double t1) {
double t_1 = v * (-t1 / ((t1 + u) * (t1 + u)));
double tmp;
if (t1 <= -2.4e+145) {
tmp = ((v * (u / t1)) - v) / (t1 + u);
} else if (t1 <= -1.22e-164) {
tmp = t_1;
} else if (t1 <= 4.4e-166) {
tmp = (v / u) * (t1 / -u);
} else if (t1 <= 1.6e+137) {
tmp = t_1;
} else {
tmp = -v / (t1 + u);
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: t_1
real(8) :: tmp
t_1 = v * (-t1 / ((t1 + u) * (t1 + u)))
if (t1 <= (-2.4d+145)) then
tmp = ((v * (u / t1)) - v) / (t1 + u)
else if (t1 <= (-1.22d-164)) then
tmp = t_1
else if (t1 <= 4.4d-166) then
tmp = (v / u) * (t1 / -u)
else if (t1 <= 1.6d+137) then
tmp = t_1
else
tmp = -v / (t1 + u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = v * (-t1 / ((t1 + u) * (t1 + u)));
double tmp;
if (t1 <= -2.4e+145) {
tmp = ((v * (u / t1)) - v) / (t1 + u);
} else if (t1 <= -1.22e-164) {
tmp = t_1;
} else if (t1 <= 4.4e-166) {
tmp = (v / u) * (t1 / -u);
} else if (t1 <= 1.6e+137) {
tmp = t_1;
} else {
tmp = -v / (t1 + u);
}
return tmp;
}
def code(u, v, t1): t_1 = v * (-t1 / ((t1 + u) * (t1 + u))) tmp = 0 if t1 <= -2.4e+145: tmp = ((v * (u / t1)) - v) / (t1 + u) elif t1 <= -1.22e-164: tmp = t_1 elif t1 <= 4.4e-166: tmp = (v / u) * (t1 / -u) elif t1 <= 1.6e+137: tmp = t_1 else: tmp = -v / (t1 + u) return tmp
function code(u, v, t1) t_1 = Float64(v * Float64(Float64(-t1) / Float64(Float64(t1 + u) * Float64(t1 + u)))) tmp = 0.0 if (t1 <= -2.4e+145) tmp = Float64(Float64(Float64(v * Float64(u / t1)) - v) / Float64(t1 + u)); elseif (t1 <= -1.22e-164) tmp = t_1; elseif (t1 <= 4.4e-166) tmp = Float64(Float64(v / u) * Float64(t1 / Float64(-u))); elseif (t1 <= 1.6e+137) tmp = t_1; else tmp = Float64(Float64(-v) / Float64(t1 + u)); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = v * (-t1 / ((t1 + u) * (t1 + u))); tmp = 0.0; if (t1 <= -2.4e+145) tmp = ((v * (u / t1)) - v) / (t1 + u); elseif (t1 <= -1.22e-164) tmp = t_1; elseif (t1 <= 4.4e-166) tmp = (v / u) * (t1 / -u); elseif (t1 <= 1.6e+137) tmp = t_1; else tmp = -v / (t1 + u); end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v * N[((-t1) / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -2.4e+145], N[(N[(N[(v * N[(u / t1), $MachinePrecision]), $MachinePrecision] - v), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, -1.22e-164], t$95$1, If[LessEqual[t1, 4.4e-166], N[(N[(v / u), $MachinePrecision] * N[(t1 / (-u)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 1.6e+137], t$95$1, N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
\mathbf{if}\;t1 \leq -2.4 \cdot 10^{+145}:\\
\;\;\;\;\frac{v \cdot \frac{u}{t1} - v}{t1 + u}\\
\mathbf{elif}\;t1 \leq -1.22 \cdot 10^{-164}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t1 \leq 4.4 \cdot 10^{-166}:\\
\;\;\;\;\frac{v}{u} \cdot \frac{t1}{-u}\\
\mathbf{elif}\;t1 \leq 1.6 \cdot 10^{+137}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\end{array}
\end{array}
if t1 < -2.39999999999999992e145Initial program 37.4%
associate-/r*52.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t1 around inf 85.0%
+-commutative85.0%
neg-mul-185.0%
unsub-neg85.0%
associate-/l*94.1%
Simplified94.1%
associate-/r/94.1%
Applied egg-rr94.1%
if -2.39999999999999992e145 < t1 < -1.2199999999999999e-164 or 4.4000000000000002e-166 < t1 < 1.60000000000000009e137Initial program 87.9%
associate-*l/95.1%
*-commutative95.1%
Simplified95.1%
if -1.2199999999999999e-164 < t1 < 4.4000000000000002e-166Initial program 71.4%
associate-/l*75.7%
neg-mul-175.7%
associate-*r/87.7%
times-frac94.0%
div-inv93.9%
clear-num94.0%
Applied egg-rr94.0%
Taylor expanded in t1 around 0 71.4%
metadata-eval71.4%
*-commutative71.4%
unpow271.4%
associate-/r*80.7%
*-commutative80.7%
associate-*l/81.0%
times-frac81.0%
*-lft-identity81.0%
associate-*l/80.7%
*-commutative80.7%
neg-mul-180.7%
associate-/r*71.4%
times-frac86.8%
Simplified86.8%
if 1.60000000000000009e137 < t1 Initial program 53.4%
associate-/r*61.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t1 around inf 90.2%
neg-mul-190.2%
Simplified90.2%
Final simplification92.1%
(FPCore (u v t1) :precision binary64 (* (/ -1.0 (+ t1 u)) (* t1 (/ v (+ t1 u)))))
double code(double u, double v, double t1) {
return (-1.0 / (t1 + u)) * (t1 * (v / (t1 + u)));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = ((-1.0d0) / (t1 + u)) * (t1 * (v / (t1 + u)))
end function
public static double code(double u, double v, double t1) {
return (-1.0 / (t1 + u)) * (t1 * (v / (t1 + u)));
}
def code(u, v, t1): return (-1.0 / (t1 + u)) * (t1 * (v / (t1 + u)))
function code(u, v, t1) return Float64(Float64(-1.0 / Float64(t1 + u)) * Float64(t1 * Float64(v / Float64(t1 + u)))) end
function tmp = code(u, v, t1) tmp = (-1.0 / (t1 + u)) * (t1 * (v / (t1 + u))); end
code[u_, v_, t1_] := N[(N[(-1.0 / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(t1 * N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-1}{t1 + u} \cdot \left(t1 \cdot \frac{v}{t1 + u}\right)
\end{array}
Initial program 72.1%
associate-/l*75.2%
neg-mul-175.2%
associate-*r/85.6%
times-frac97.1%
div-inv97.0%
clear-num97.2%
Applied egg-rr97.2%
Final simplification97.2%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.38e-14) (not (<= t1 6.9e-40))) (/ -1.0 (/ (+ t1 u) v)) (* v (/ (- t1) (* u u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.38e-14) || !(t1 <= 6.9e-40)) {
tmp = -1.0 / ((t1 + u) / v);
} else {
tmp = v * (-t1 / (u * u));
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if ((t1 <= (-1.38d-14)) .or. (.not. (t1 <= 6.9d-40))) then
tmp = (-1.0d0) / ((t1 + u) / v)
else
tmp = v * (-t1 / (u * u))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.38e-14) || !(t1 <= 6.9e-40)) {
tmp = -1.0 / ((t1 + u) / v);
} else {
tmp = v * (-t1 / (u * u));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1.38e-14) or not (t1 <= 6.9e-40): tmp = -1.0 / ((t1 + u) / v) else: tmp = v * (-t1 / (u * u)) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.38e-14) || !(t1 <= 6.9e-40)) tmp = Float64(-1.0 / Float64(Float64(t1 + u) / v)); else tmp = Float64(v * Float64(Float64(-t1) / Float64(u * u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -1.38e-14) || ~((t1 <= 6.9e-40))) tmp = -1.0 / ((t1 + u) / v); else tmp = v * (-t1 / (u * u)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.38e-14], N[Not[LessEqual[t1, 6.9e-40]], $MachinePrecision]], N[(-1.0 / N[(N[(t1 + u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision], N[(v * N[((-t1) / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.38 \cdot 10^{-14} \lor \neg \left(t1 \leq 6.9 \cdot 10^{-40}\right):\\
\;\;\;\;\frac{-1}{\frac{t1 + u}{v}}\\
\mathbf{else}:\\
\;\;\;\;v \cdot \frac{-t1}{u \cdot u}\\
\end{array}
\end{array}
if t1 < -1.38000000000000002e-14 or 6.8999999999999996e-40 < t1 Initial program 63.4%
associate-/l*69.4%
neg-mul-169.4%
associate-*r/82.4%
times-frac99.4%
div-inv99.3%
clear-num99.7%
Applied egg-rr99.7%
Taylor expanded in t1 around inf 84.6%
associate-*l/84.8%
associate-/l*85.0%
Applied egg-rr85.0%
if -1.38000000000000002e-14 < t1 < 6.8999999999999996e-40Initial program 81.5%
associate-*l/83.8%
*-commutative83.8%
Simplified83.8%
Taylor expanded in t1 around 0 75.3%
associate-*r/75.3%
neg-mul-175.3%
unpow275.3%
Simplified75.3%
Final simplification80.3%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.45e-14) (not (<= t1 3.3e-39))) (/ -1.0 (/ (+ t1 u) v)) (* v (/ (/ t1 u) (- u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.45e-14) || !(t1 <= 3.3e-39)) {
tmp = -1.0 / ((t1 + u) / v);
} else {
tmp = v * ((t1 / u) / -u);
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if ((t1 <= (-1.45d-14)) .or. (.not. (t1 <= 3.3d-39))) then
tmp = (-1.0d0) / ((t1 + u) / v)
else
tmp = v * ((t1 / u) / -u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.45e-14) || !(t1 <= 3.3e-39)) {
tmp = -1.0 / ((t1 + u) / v);
} else {
tmp = v * ((t1 / u) / -u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1.45e-14) or not (t1 <= 3.3e-39): tmp = -1.0 / ((t1 + u) / v) else: tmp = v * ((t1 / u) / -u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.45e-14) || !(t1 <= 3.3e-39)) tmp = Float64(-1.0 / Float64(Float64(t1 + u) / v)); else tmp = Float64(v * Float64(Float64(t1 / u) / Float64(-u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -1.45e-14) || ~((t1 <= 3.3e-39))) tmp = -1.0 / ((t1 + u) / v); else tmp = v * ((t1 / u) / -u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.45e-14], N[Not[LessEqual[t1, 3.3e-39]], $MachinePrecision]], N[(-1.0 / N[(N[(t1 + u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision], N[(v * N[(N[(t1 / u), $MachinePrecision] / (-u)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.45 \cdot 10^{-14} \lor \neg \left(t1 \leq 3.3 \cdot 10^{-39}\right):\\
\;\;\;\;\frac{-1}{\frac{t1 + u}{v}}\\
\mathbf{else}:\\
\;\;\;\;v \cdot \frac{\frac{t1}{u}}{-u}\\
\end{array}
\end{array}
if t1 < -1.4500000000000001e-14 or 3.29999999999999985e-39 < t1 Initial program 63.4%
associate-/l*69.4%
neg-mul-169.4%
associate-*r/82.4%
times-frac99.4%
div-inv99.3%
clear-num99.7%
Applied egg-rr99.7%
Taylor expanded in t1 around inf 84.6%
associate-*l/84.8%
associate-/l*85.0%
Applied egg-rr85.0%
if -1.4500000000000001e-14 < t1 < 3.29999999999999985e-39Initial program 81.5%
associate-*l/83.8%
*-commutative83.8%
Simplified83.8%
Taylor expanded in t1 around 0 75.3%
associate-*r/75.3%
neg-mul-175.3%
unpow275.3%
Simplified75.3%
neg-mul-175.3%
times-frac82.4%
Applied egg-rr82.4%
*-commutative82.4%
frac-2neg82.4%
metadata-eval82.4%
un-div-inv82.5%
Applied egg-rr82.5%
Final simplification83.8%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.18e-14) (not (<= t1 7.6e-41))) (/ -1.0 (/ (+ t1 u) v)) (* (/ v u) (/ t1 (- u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.18e-14) || !(t1 <= 7.6e-41)) {
tmp = -1.0 / ((t1 + u) / v);
} else {
tmp = (v / u) * (t1 / -u);
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if ((t1 <= (-1.18d-14)) .or. (.not. (t1 <= 7.6d-41))) then
tmp = (-1.0d0) / ((t1 + u) / v)
else
tmp = (v / u) * (t1 / -u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.18e-14) || !(t1 <= 7.6e-41)) {
tmp = -1.0 / ((t1 + u) / v);
} else {
tmp = (v / u) * (t1 / -u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1.18e-14) or not (t1 <= 7.6e-41): tmp = -1.0 / ((t1 + u) / v) else: tmp = (v / u) * (t1 / -u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.18e-14) || !(t1 <= 7.6e-41)) tmp = Float64(-1.0 / Float64(Float64(t1 + u) / v)); else tmp = Float64(Float64(v / u) * Float64(t1 / Float64(-u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -1.18e-14) || ~((t1 <= 7.6e-41))) tmp = -1.0 / ((t1 + u) / v); else tmp = (v / u) * (t1 / -u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.18e-14], N[Not[LessEqual[t1, 7.6e-41]], $MachinePrecision]], N[(-1.0 / N[(N[(t1 + u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision], N[(N[(v / u), $MachinePrecision] * N[(t1 / (-u)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.18 \cdot 10^{-14} \lor \neg \left(t1 \leq 7.6 \cdot 10^{-41}\right):\\
\;\;\;\;\frac{-1}{\frac{t1 + u}{v}}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u} \cdot \frac{t1}{-u}\\
\end{array}
\end{array}
if t1 < -1.17999999999999993e-14 or 7.59999999999999958e-41 < t1 Initial program 63.4%
associate-/l*69.4%
neg-mul-169.4%
associate-*r/82.4%
times-frac99.4%
div-inv99.3%
clear-num99.7%
Applied egg-rr99.7%
Taylor expanded in t1 around inf 84.6%
associate-*l/84.8%
associate-/l*85.0%
Applied egg-rr85.0%
if -1.17999999999999993e-14 < t1 < 7.59999999999999958e-41Initial program 81.5%
associate-/l*81.5%
neg-mul-181.5%
associate-*r/89.1%
times-frac94.7%
div-inv94.5%
clear-num94.6%
Applied egg-rr94.6%
Taylor expanded in t1 around 0 73.8%
metadata-eval73.8%
*-commutative73.8%
unpow273.8%
associate-/r*80.1%
*-commutative80.1%
associate-*l/80.9%
times-frac80.9%
*-lft-identity80.9%
associate-*l/80.1%
*-commutative80.1%
neg-mul-180.1%
associate-/r*73.8%
times-frac83.2%
Simplified83.2%
Final simplification84.1%
(FPCore (u v t1) :precision binary64 (/ (/ (- t1) (/ (+ t1 u) v)) (+ t1 u)))
double code(double u, double v, double t1) {
return (-t1 / ((t1 + u) / v)) / (t1 + u);
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-t1 / ((t1 + u) / v)) / (t1 + u)
end function
public static double code(double u, double v, double t1) {
return (-t1 / ((t1 + u) / v)) / (t1 + u);
}
def code(u, v, t1): return (-t1 / ((t1 + u) / v)) / (t1 + u)
function code(u, v, t1) return Float64(Float64(Float64(-t1) / Float64(Float64(t1 + u) / v)) / Float64(t1 + u)) end
function tmp = code(u, v, t1) tmp = (-t1 / ((t1 + u) / v)) / (t1 + u); end
code[u_, v_, t1_] := N[(N[((-t1) / N[(N[(t1 + u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{-t1}{\frac{t1 + u}{v}}}{t1 + u}
\end{array}
Initial program 72.1%
associate-/r*80.0%
associate-/l*97.2%
Simplified97.2%
Final simplification97.2%
(FPCore (u v t1) :precision binary64 (if (or (<= u -6e+128) (not (<= u 6.5e+201))) (* v (/ (/ t1 u) u)) (/ (- v) (+ t1 u))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -6e+128) || !(u <= 6.5e+201)) {
tmp = v * ((t1 / u) / u);
} else {
tmp = -v / (t1 + u);
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if ((u <= (-6d+128)) .or. (.not. (u <= 6.5d+201))) then
tmp = v * ((t1 / u) / u)
else
tmp = -v / (t1 + u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -6e+128) || !(u <= 6.5e+201)) {
tmp = v * ((t1 / u) / u);
} else {
tmp = -v / (t1 + u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -6e+128) or not (u <= 6.5e+201): tmp = v * ((t1 / u) / u) else: tmp = -v / (t1 + u) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -6e+128) || !(u <= 6.5e+201)) tmp = Float64(v * Float64(Float64(t1 / u) / u)); else tmp = Float64(Float64(-v) / Float64(t1 + u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -6e+128) || ~((u <= 6.5e+201))) tmp = v * ((t1 / u) / u); else tmp = -v / (t1 + u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -6e+128], N[Not[LessEqual[u, 6.5e+201]], $MachinePrecision]], N[(v * N[(N[(t1 / u), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -6 \cdot 10^{+128} \lor \neg \left(u \leq 6.5 \cdot 10^{+201}\right):\\
\;\;\;\;v \cdot \frac{\frac{t1}{u}}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\end{array}
\end{array}
if u < -5.9999999999999997e128 or 6.5000000000000004e201 < u Initial program 83.0%
associate-*l/82.1%
*-commutative82.1%
Simplified82.1%
Taylor expanded in t1 around 0 82.1%
associate-*r/82.1%
neg-mul-182.1%
unpow282.1%
Simplified82.1%
neg-mul-182.1%
times-frac83.7%
Applied egg-rr83.7%
frac-times82.1%
neg-mul-182.1%
add-sqr-sqrt49.3%
sqrt-unprod68.5%
sqr-neg68.5%
sqrt-unprod32.8%
add-sqr-sqrt80.7%
associate-/l/78.0%
Applied egg-rr78.0%
if -5.9999999999999997e128 < u < 6.5000000000000004e201Initial program 68.2%
associate-/r*76.4%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in t1 around inf 66.0%
neg-mul-166.0%
Simplified66.0%
Final simplification69.2%
(FPCore (u v t1) :precision binary64 (if (<= u -6.2e+128) (/ (* t1 v) (* u u)) (if (<= u 5.2e+201) (/ (- v) (+ t1 u)) (* v (/ (/ t1 u) u)))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -6.2e+128) {
tmp = (t1 * v) / (u * u);
} else if (u <= 5.2e+201) {
tmp = -v / (t1 + u);
} else {
tmp = v * ((t1 / u) / u);
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (u <= (-6.2d+128)) then
tmp = (t1 * v) / (u * u)
else if (u <= 5.2d+201) then
tmp = -v / (t1 + u)
else
tmp = v * ((t1 / u) / u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -6.2e+128) {
tmp = (t1 * v) / (u * u);
} else if (u <= 5.2e+201) {
tmp = -v / (t1 + u);
} else {
tmp = v * ((t1 / u) / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -6.2e+128: tmp = (t1 * v) / (u * u) elif u <= 5.2e+201: tmp = -v / (t1 + u) else: tmp = v * ((t1 / u) / u) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -6.2e+128) tmp = Float64(Float64(t1 * v) / Float64(u * u)); elseif (u <= 5.2e+201) tmp = Float64(Float64(-v) / Float64(t1 + u)); else tmp = Float64(v * Float64(Float64(t1 / u) / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -6.2e+128) tmp = (t1 * v) / (u * u); elseif (u <= 5.2e+201) tmp = -v / (t1 + u); else tmp = v * ((t1 / u) / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -6.2e+128], N[(N[(t1 * v), $MachinePrecision] / N[(u * u), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 5.2e+201], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(v * N[(N[(t1 / u), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -6.2 \cdot 10^{+128}:\\
\;\;\;\;\frac{t1 \cdot v}{u \cdot u}\\
\mathbf{elif}\;u \leq 5.2 \cdot 10^{+201}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;v \cdot \frac{\frac{t1}{u}}{u}\\
\end{array}
\end{array}
if u < -6.20000000000000008e128Initial program 78.7%
associate-*l/77.2%
*-commutative77.2%
Simplified77.2%
Taylor expanded in t1 around 0 77.2%
associate-*r/77.2%
neg-mul-177.2%
unpow277.2%
Simplified77.2%
associate-*r/78.7%
add-sqr-sqrt47.3%
sqrt-unprod65.4%
sqr-neg65.4%
sqrt-unprod31.4%
add-sqr-sqrt74.4%
Applied egg-rr74.4%
if -6.20000000000000008e128 < u < 5.19999999999999971e201Initial program 68.2%
associate-/r*76.4%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in t1 around inf 66.0%
neg-mul-166.0%
Simplified66.0%
if 5.19999999999999971e201 < u Initial program 91.3%
associate-*l/91.8%
*-commutative91.8%
Simplified91.8%
Taylor expanded in t1 around 0 91.8%
associate-*r/91.8%
neg-mul-191.8%
unpow291.8%
Simplified91.8%
neg-mul-191.8%
times-frac91.8%
Applied egg-rr91.8%
frac-times91.8%
neg-mul-191.8%
add-sqr-sqrt56.5%
sqrt-unprod73.9%
sqr-neg73.9%
sqrt-unprod35.3%
add-sqr-sqrt91.8%
associate-/l/91.8%
Applied egg-rr91.8%
Final simplification69.8%
(FPCore (u v t1) :precision binary64 (if (or (<= u -2.2e+128) (not (<= u 1.1e+178))) (/ (- v) u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.2e+128) || !(u <= 1.1e+178)) {
tmp = -v / u;
} else {
tmp = -v / t1;
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if ((u <= (-2.2d+128)) .or. (.not. (u <= 1.1d+178))) then
tmp = -v / u
else
tmp = -v / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.2e+128) || !(u <= 1.1e+178)) {
tmp = -v / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -2.2e+128) or not (u <= 1.1e+178): tmp = -v / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -2.2e+128) || !(u <= 1.1e+178)) tmp = Float64(Float64(-v) / u); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -2.2e+128) || ~((u <= 1.1e+178))) tmp = -v / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.2e+128], N[Not[LessEqual[u, 1.1e+178]], $MachinePrecision]], N[((-v) / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.2 \cdot 10^{+128} \lor \neg \left(u \leq 1.1 \cdot 10^{+178}\right):\\
\;\;\;\;\frac{-v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -2.20000000000000017e128 or 1.09999999999999999e178 < u Initial program 82.8%
associate-/r*89.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t1 around 0 87.6%
mul-1-neg87.6%
associate-/l*96.0%
distribute-neg-frac96.0%
Simplified96.0%
Taylor expanded in t1 around inf 49.0%
neg-mul-149.0%
distribute-neg-frac49.0%
Simplified49.0%
if -2.20000000000000017e128 < u < 1.09999999999999999e178Initial program 67.9%
associate-*l/75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in t1 around inf 64.0%
associate-*r/64.0%
neg-mul-164.0%
Simplified64.0%
Final simplification59.7%
(FPCore (u v t1) :precision binary64 (/ (- v) (+ t1 u)))
double code(double u, double v, double t1) {
return -v / (t1 + u);
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = -v / (t1 + u)
end function
public static double code(double u, double v, double t1) {
return -v / (t1 + u);
}
def code(u, v, t1): return -v / (t1 + u)
function code(u, v, t1) return Float64(Float64(-v) / Float64(t1 + u)) end
function tmp = code(u, v, t1) tmp = -v / (t1 + u); end
code[u_, v_, t1_] := N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-v}{t1 + u}
\end{array}
Initial program 72.1%
associate-/r*80.0%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in t1 around inf 62.1%
neg-mul-162.1%
Simplified62.1%
Final simplification62.1%
(FPCore (u v t1) :precision binary64 (/ v (- u t1)))
double code(double u, double v, double t1) {
return v / (u - t1);
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = v / (u - t1)
end function
public static double code(double u, double v, double t1) {
return v / (u - t1);
}
def code(u, v, t1): return v / (u - t1)
function code(u, v, t1) return Float64(v / Float64(u - t1)) end
function tmp = code(u, v, t1) tmp = v / (u - t1); end
code[u_, v_, t1_] := N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{u - t1}
\end{array}
Initial program 72.1%
associate-/l*75.2%
neg-mul-175.2%
associate-*r/85.6%
times-frac97.1%
div-inv97.0%
clear-num97.2%
Applied egg-rr97.2%
Taylor expanded in t1 around inf 61.9%
frac-2neg61.9%
metadata-eval61.9%
associate-*l/62.1%
*-un-lft-identity62.1%
+-commutative62.1%
distribute-neg-in62.1%
add-sqr-sqrt30.7%
sqrt-unprod69.1%
sqr-neg69.1%
sqrt-unprod31.3%
add-sqr-sqrt61.2%
Applied egg-rr61.2%
sub-neg61.2%
Simplified61.2%
Final simplification61.2%
(FPCore (u v t1) :precision binary64 (/ (- v) t1))
double code(double u, double v, double t1) {
return -v / t1;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = -v / t1
end function
public static double code(double u, double v, double t1) {
return -v / t1;
}
def code(u, v, t1): return -v / t1
function code(u, v, t1) return Float64(Float64(-v) / t1) end
function tmp = code(u, v, t1) tmp = -v / t1; end
code[u_, v_, t1_] := N[((-v) / t1), $MachinePrecision]
\begin{array}{l}
\\
\frac{-v}{t1}
\end{array}
Initial program 72.1%
associate-*l/77.5%
*-commutative77.5%
Simplified77.5%
Taylor expanded in t1 around inf 51.3%
associate-*r/51.3%
neg-mul-151.3%
Simplified51.3%
Final simplification51.3%
(FPCore (u v t1) :precision binary64 (/ v t1))
double code(double u, double v, double t1) {
return v / t1;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = v / t1
end function
public static double code(double u, double v, double t1) {
return v / t1;
}
def code(u, v, t1): return v / t1
function code(u, v, t1) return Float64(v / t1) end
function tmp = code(u, v, t1) tmp = v / t1; end
code[u_, v_, t1_] := N[(v / t1), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{t1}
\end{array}
Initial program 72.1%
associate-/r*80.0%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in t1 around inf 47.2%
+-commutative47.2%
neg-mul-147.2%
unsub-neg47.2%
associate-/l*48.6%
Simplified48.6%
associate-/r/49.3%
Applied egg-rr49.3%
Taylor expanded in u around inf 15.1%
Final simplification15.1%
herbie shell --seed 2023275
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))