
(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 13 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 (/ (* (/ v (+ u t1)) t1) (- (+ u t1))))
double code(double u, double v, double t1) {
return ((v / (u + t1)) * t1) / -(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)) * t1) / -(u + t1)
end function
public static double code(double u, double v, double t1) {
return ((v / (u + t1)) * t1) / -(u + t1);
}
def code(u, v, t1): return ((v / (u + t1)) * t1) / -(u + t1)
function code(u, v, t1) return Float64(Float64(Float64(v / Float64(u + t1)) * t1) / Float64(-Float64(u + t1))) end
function tmp = code(u, v, t1) tmp = ((v / (u + t1)) * t1) / -(u + t1); end
code[u_, v_, t1_] := N[(N[(N[(v / N[(u + t1), $MachinePrecision]), $MachinePrecision] * t1), $MachinePrecision] / (-N[(u + t1), $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{v}{u + t1} \cdot t1}{-\left(u + t1\right)}
\end{array}
Initial program 73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-neg.f64N/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6499.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.1
Applied rewrites99.1%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -3.8e+65) (not (<= t1 2.7e+55))) (/ v (fma -2.0 u (- t1))) (/ (* (- t1) v) (* (+ t1 u) (+ t1 u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3.8e+65) || !(t1 <= 2.7e+55)) {
tmp = v / fma(-2.0, u, -t1);
} else {
tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if ((t1 <= -3.8e+65) || !(t1 <= 2.7e+55)) tmp = Float64(v / fma(-2.0, u, Float64(-t1))); else tmp = Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))); end return tmp end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -3.8e+65], N[Not[LessEqual[t1, 2.7e+55]], $MachinePrecision]], N[(v / N[(-2.0 * u + (-t1)), $MachinePrecision]), $MachinePrecision], N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3.8 \cdot 10^{+65} \lor \neg \left(t1 \leq 2.7 \cdot 10^{+55}\right):\\
\;\;\;\;\frac{v}{\mathsf{fma}\left(-2, u, -t1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
\end{array}
\end{array}
if t1 < -3.80000000000000011e65 or 2.69999999999999977e55 < t1 Initial program 53.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
frac-2negN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f64N/A
lower-neg.f6496.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.0
Applied rewrites96.0%
lift-*.f64N/A
*-lft-identity96.0
Applied rewrites96.0%
Taylor expanded in u around 0
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6491.0
Applied rewrites91.0%
if -3.80000000000000011e65 < t1 < 2.69999999999999977e55Initial program 85.2%
Final simplification87.4%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -7e+56) (not (<= t1 6000000000.0))) (/ v (fma -2.0 u (- t1))) (/ (* (/ t1 u) v) (- u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -7e+56) || !(t1 <= 6000000000.0)) {
tmp = v / fma(-2.0, u, -t1);
} else {
tmp = ((t1 / u) * v) / -u;
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if ((t1 <= -7e+56) || !(t1 <= 6000000000.0)) tmp = Float64(v / fma(-2.0, u, Float64(-t1))); else tmp = Float64(Float64(Float64(t1 / u) * v) / Float64(-u)); end return tmp end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -7e+56], N[Not[LessEqual[t1, 6000000000.0]], $MachinePrecision]], N[(v / N[(-2.0 * u + (-t1)), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t1 / u), $MachinePrecision] * v), $MachinePrecision] / (-u)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -7 \cdot 10^{+56} \lor \neg \left(t1 \leq 6000000000\right):\\
\;\;\;\;\frac{v}{\mathsf{fma}\left(-2, u, -t1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{t1}{u} \cdot v}{-u}\\
\end{array}
\end{array}
if t1 < -6.99999999999999999e56 or 6e9 < t1 Initial program 56.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
frac-2negN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f64N/A
lower-neg.f6494.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6494.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6494.9
Applied rewrites94.9%
lift-*.f64N/A
*-lft-identity94.9
Applied rewrites94.9%
Taylor expanded in u around 0
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6488.6
Applied rewrites88.6%
if -6.99999999999999999e56 < t1 < 6e9Initial program 85.7%
Taylor expanded in u around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
neg-mul-1N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-/.f6477.0
Applied rewrites77.0%
Applied rewrites78.2%
Final simplification82.7%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -7e+56) (not (<= t1 6000000000.0))) (/ v (fma -2.0 u (- t1))) (* (/ t1 u) (/ (- v) u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -7e+56) || !(t1 <= 6000000000.0)) {
tmp = v / fma(-2.0, u, -t1);
} else {
tmp = (t1 / u) * (-v / u);
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if ((t1 <= -7e+56) || !(t1 <= 6000000000.0)) tmp = Float64(v / fma(-2.0, u, Float64(-t1))); else tmp = Float64(Float64(t1 / u) * Float64(Float64(-v) / u)); end return tmp end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -7e+56], N[Not[LessEqual[t1, 6000000000.0]], $MachinePrecision]], N[(v / N[(-2.0 * u + (-t1)), $MachinePrecision]), $MachinePrecision], N[(N[(t1 / u), $MachinePrecision] * N[((-v) / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -7 \cdot 10^{+56} \lor \neg \left(t1 \leq 6000000000\right):\\
\;\;\;\;\frac{v}{\mathsf{fma}\left(-2, u, -t1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u}\\
\end{array}
\end{array}
if t1 < -6.99999999999999999e56 or 6e9 < t1 Initial program 56.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
frac-2negN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f64N/A
lower-neg.f6494.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6494.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6494.9
Applied rewrites94.9%
lift-*.f64N/A
*-lft-identity94.9
Applied rewrites94.9%
Taylor expanded in u around 0
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6488.6
Applied rewrites88.6%
if -6.99999999999999999e56 < t1 < 6e9Initial program 85.7%
Taylor expanded in u around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
neg-mul-1N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-/.f6477.0
Applied rewrites77.0%
Final simplification82.0%
(FPCore (u v t1) :precision binary64 (if (<= v 1e+250) (/ v (* (- -1.0 (/ u t1)) (+ u t1))) (/ (- t1) (* (/ (+ u t1) v) (+ u t1)))))
double code(double u, double v, double t1) {
double tmp;
if (v <= 1e+250) {
tmp = v / ((-1.0 - (u / t1)) * (u + t1));
} else {
tmp = -t1 / (((u + t1) / v) * (u + 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 (v <= 1d+250) then
tmp = v / (((-1.0d0) - (u / t1)) * (u + t1))
else
tmp = -t1 / (((u + t1) / v) * (u + t1))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (v <= 1e+250) {
tmp = v / ((-1.0 - (u / t1)) * (u + t1));
} else {
tmp = -t1 / (((u + t1) / v) * (u + t1));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if v <= 1e+250: tmp = v / ((-1.0 - (u / t1)) * (u + t1)) else: tmp = -t1 / (((u + t1) / v) * (u + t1)) return tmp
function code(u, v, t1) tmp = 0.0 if (v <= 1e+250) tmp = Float64(v / Float64(Float64(-1.0 - Float64(u / t1)) * Float64(u + t1))); else tmp = Float64(Float64(-t1) / Float64(Float64(Float64(u + t1) / v) * Float64(u + t1))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (v <= 1e+250) tmp = v / ((-1.0 - (u / t1)) * (u + t1)); else tmp = -t1 / (((u + t1) / v) * (u + t1)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[v, 1e+250], N[(v / N[(N[(-1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision] * N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-t1) / N[(N[(N[(u + t1), $MachinePrecision] / v), $MachinePrecision] * N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq 10^{+250}:\\
\;\;\;\;\frac{v}{\left(-1 - \frac{u}{t1}\right) \cdot \left(u + t1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-t1}{\frac{u + t1}{v} \cdot \left(u + t1\right)}\\
\end{array}
\end{array}
if v < 9.9999999999999992e249Initial program 75.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
frac-2negN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f64N/A
lower-neg.f6494.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6494.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6494.8
Applied rewrites94.8%
lift-*.f64N/A
*-lft-identity94.8
Applied rewrites94.8%
Taylor expanded in u around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f6494.8
Applied rewrites94.8%
if 9.9999999999999992e249 < v Initial program 48.9%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
frac-2negN/A
frac-timesN/A
metadata-evalN/A
lift-neg.f64N/A
remove-double-negN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
remove-double-negN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6490.7
lift-+.f64N/A
+-commutativeN/A
lower-+.f6490.7
Applied rewrites90.7%
Final simplification94.5%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.15e-67) (not (<= t1 5600000000.0))) (/ v (fma -2.0 u (- t1))) (/ (* (- t1) v) (* u u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.15e-67) || !(t1 <= 5600000000.0)) {
tmp = v / fma(-2.0, u, -t1);
} else {
tmp = (-t1 * v) / (u * u);
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.15e-67) || !(t1 <= 5600000000.0)) tmp = Float64(v / fma(-2.0, u, Float64(-t1))); else tmp = Float64(Float64(Float64(-t1) * v) / Float64(u * u)); end return tmp end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.15e-67], N[Not[LessEqual[t1, 5600000000.0]], $MachinePrecision]], N[(v / N[(-2.0 * u + (-t1)), $MachinePrecision]), $MachinePrecision], N[(N[((-t1) * v), $MachinePrecision] / N[(u * u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.15 \cdot 10^{-67} \lor \neg \left(t1 \leq 5600000000\right):\\
\;\;\;\;\frac{v}{\mathsf{fma}\left(-2, u, -t1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-t1\right) \cdot v}{u \cdot u}\\
\end{array}
\end{array}
if t1 < -1.15e-67 or 5.6e9 < t1 Initial program 60.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
frac-2negN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f64N/A
lower-neg.f6493.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.6
Applied rewrites93.6%
lift-*.f64N/A
*-lft-identity93.6
Applied rewrites93.6%
Taylor expanded in u around 0
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6482.4
Applied rewrites82.4%
if -1.15e-67 < t1 < 5.6e9Initial program 86.9%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6478.7
Applied rewrites78.7%
Final simplification80.6%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.15e-67) (not (<= t1 5600000000.0))) (/ v (fma -2.0 u (- t1))) (* t1 (/ v (* (- u) u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.15e-67) || !(t1 <= 5600000000.0)) {
tmp = v / fma(-2.0, u, -t1);
} else {
tmp = t1 * (v / (-u * u));
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.15e-67) || !(t1 <= 5600000000.0)) tmp = Float64(v / fma(-2.0, u, Float64(-t1))); else tmp = Float64(t1 * Float64(v / Float64(Float64(-u) * u))); end return tmp end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.15e-67], N[Not[LessEqual[t1, 5600000000.0]], $MachinePrecision]], N[(v / N[(-2.0 * u + (-t1)), $MachinePrecision]), $MachinePrecision], N[(t1 * N[(v / N[((-u) * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.15 \cdot 10^{-67} \lor \neg \left(t1 \leq 5600000000\right):\\
\;\;\;\;\frac{v}{\mathsf{fma}\left(-2, u, -t1\right)}\\
\mathbf{else}:\\
\;\;\;\;t1 \cdot \frac{v}{\left(-u\right) \cdot u}\\
\end{array}
\end{array}
if t1 < -1.15e-67 or 5.6e9 < t1 Initial program 60.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
frac-2negN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f64N/A
lower-neg.f6493.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.6
Applied rewrites93.6%
lift-*.f64N/A
*-lft-identity93.6
Applied rewrites93.6%
Taylor expanded in u around 0
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6482.4
Applied rewrites82.4%
if -1.15e-67 < t1 < 5.6e9Initial program 86.9%
Taylor expanded in u around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
neg-mul-1N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-/.f6480.9
Applied rewrites80.9%
Applied rewrites78.5%
Final simplification80.5%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -2.7e-79) (not (<= t1 5600000000.0))) (/ v (fma -2.0 u (- t1))) (* v (/ t1 (* (- u) u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -2.7e-79) || !(t1 <= 5600000000.0)) {
tmp = v / fma(-2.0, u, -t1);
} else {
tmp = v * (t1 / (-u * u));
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if ((t1 <= -2.7e-79) || !(t1 <= 5600000000.0)) tmp = Float64(v / fma(-2.0, u, Float64(-t1))); else tmp = Float64(v * Float64(t1 / Float64(Float64(-u) * u))); end return tmp end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -2.7e-79], N[Not[LessEqual[t1, 5600000000.0]], $MachinePrecision]], N[(v / N[(-2.0 * u + (-t1)), $MachinePrecision]), $MachinePrecision], N[(v * N[(t1 / N[((-u) * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.7 \cdot 10^{-79} \lor \neg \left(t1 \leq 5600000000\right):\\
\;\;\;\;\frac{v}{\mathsf{fma}\left(-2, u, -t1\right)}\\
\mathbf{else}:\\
\;\;\;\;v \cdot \frac{t1}{\left(-u\right) \cdot u}\\
\end{array}
\end{array}
if t1 < -2.7000000000000002e-79 or 5.6e9 < t1 Initial program 61.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
frac-2negN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f64N/A
lower-neg.f6493.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.1
Applied rewrites93.1%
lift-*.f64N/A
*-lft-identity93.1
Applied rewrites93.1%
Taylor expanded in u around 0
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6481.5
Applied rewrites81.5%
if -2.7000000000000002e-79 < t1 < 5.6e9Initial program 86.5%
Taylor expanded in u around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
neg-mul-1N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-/.f6481.8
Applied rewrites81.8%
Applied rewrites79.3%
Taylor expanded in u around 0
Applied rewrites77.0%
Final simplification79.4%
(FPCore (u v t1) :precision binary64 (/ (* v (/ t1 (+ u t1))) (- (+ u t1))))
double code(double u, double v, double t1) {
return (v * (t1 / (u + t1))) / -(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 * (t1 / (u + t1))) / -(u + t1)
end function
public static double code(double u, double v, double t1) {
return (v * (t1 / (u + t1))) / -(u + t1);
}
def code(u, v, t1): return (v * (t1 / (u + t1))) / -(u + t1)
function code(u, v, t1) return Float64(Float64(v * Float64(t1 / Float64(u + t1))) / Float64(-Float64(u + t1))) end
function tmp = code(u, v, t1) tmp = (v * (t1 / (u + t1))) / -(u + t1); end
code[u_, v_, t1_] := N[(N[(v * N[(t1 / N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-N[(u + t1), $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
\\
\frac{v \cdot \frac{t1}{u + t1}}{-\left(u + t1\right)}
\end{array}
Initial program 73.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6499.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.1
Applied rewrites99.1%
Final simplification99.1%
(FPCore (u v t1) :precision binary64 (/ v (* (- -1.0 (/ u t1)) (+ u t1))))
double code(double u, double v, double t1) {
return v / ((-1.0 - (u / t1)) * (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 / (((-1.0d0) - (u / t1)) * (u + t1))
end function
public static double code(double u, double v, double t1) {
return v / ((-1.0 - (u / t1)) * (u + t1));
}
def code(u, v, t1): return v / ((-1.0 - (u / t1)) * (u + t1))
function code(u, v, t1) return Float64(v / Float64(Float64(-1.0 - Float64(u / t1)) * Float64(u + t1))) end
function tmp = code(u, v, t1) tmp = v / ((-1.0 - (u / t1)) * (u + t1)); end
code[u_, v_, t1_] := N[(v / N[(N[(-1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision] * N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{\left(-1 - \frac{u}{t1}\right) \cdot \left(u + t1\right)}
\end{array}
Initial program 73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
frac-2negN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f64N/A
lower-neg.f6493.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.3
Applied rewrites93.3%
lift-*.f64N/A
*-lft-identity93.3
Applied rewrites93.3%
Taylor expanded in u around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f6493.3
Applied rewrites93.3%
(FPCore (u v t1) :precision binary64 (if (or (<= u -2.7e+127) (not (<= u 2.5e+223))) (/ v (* -2.0 u)) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.7e+127) || !(u <= 2.5e+223)) {
tmp = v / (-2.0 * 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.7d+127)) .or. (.not. (u <= 2.5d+223))) then
tmp = v / ((-2.0d0) * 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.7e+127) || !(u <= 2.5e+223)) {
tmp = v / (-2.0 * u);
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -2.7e+127) or not (u <= 2.5e+223): tmp = v / (-2.0 * u) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -2.7e+127) || !(u <= 2.5e+223)) tmp = Float64(v / Float64(-2.0 * u)); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -2.7e+127) || ~((u <= 2.5e+223))) tmp = v / (-2.0 * u); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.7e+127], N[Not[LessEqual[u, 2.5e+223]], $MachinePrecision]], N[(v / N[(-2.0 * u), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.7 \cdot 10^{+127} \lor \neg \left(u \leq 2.5 \cdot 10^{+223}\right):\\
\;\;\;\;\frac{v}{-2 \cdot u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -2.7000000000000002e127 or 2.49999999999999992e223 < u Initial program 80.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
frac-2negN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f64N/A
lower-neg.f6485.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6485.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6485.8
Applied rewrites85.8%
lift-*.f64N/A
*-lft-identity85.8
Applied rewrites85.8%
Taylor expanded in u around 0
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6439.8
Applied rewrites39.8%
Taylor expanded in u around inf
Applied rewrites36.0%
if -2.7000000000000002e127 < u < 2.49999999999999992e223Initial program 71.0%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6464.2
Applied rewrites64.2%
Final simplification57.7%
(FPCore (u v t1) :precision binary64 (/ v (fma -2.0 u (- t1))))
double code(double u, double v, double t1) {
return v / fma(-2.0, u, -t1);
}
function code(u, v, t1) return Float64(v / fma(-2.0, u, Float64(-t1))) end
code[u_, v_, t1_] := N[(v / N[(-2.0 * u + (-t1)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{\mathsf{fma}\left(-2, u, -t1\right)}
\end{array}
Initial program 73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
frac-2negN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f64N/A
lower-neg.f6493.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.3
Applied rewrites93.3%
lift-*.f64N/A
*-lft-identity93.3
Applied rewrites93.3%
Taylor expanded in u around 0
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6460.4
Applied rewrites60.4%
(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 73.3%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6453.5
Applied rewrites53.5%
herbie shell --seed 2024313
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))