
(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 (/ (* 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\right) - t1}
\end{array}
Initial program 71.4%
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.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.2
Applied rewrites99.2%
Final simplification99.2%
(FPCore (u v t1)
:precision binary64
(if (<= t1 -1.02e+170)
(* v (/ -1.0 (fma 2.0 u t1)))
(if (<= t1 6e+127)
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u)))
(/ (fma (/ v t1) u (- v)) (+ u t1)))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.02e+170) {
tmp = v * (-1.0 / fma(2.0, u, t1));
} else if (t1 <= 6e+127) {
tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
} else {
tmp = fma((v / t1), u, -v) / (u + t1);
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if (t1 <= -1.02e+170) tmp = Float64(v * Float64(-1.0 / fma(2.0, u, t1))); elseif (t1 <= 6e+127) tmp = Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))); else tmp = Float64(fma(Float64(v / t1), u, Float64(-v)) / Float64(u + t1)); end return tmp end
code[u_, v_, t1_] := If[LessEqual[t1, -1.02e+170], N[(v * N[(-1.0 / N[(2.0 * u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 6e+127], N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(v / t1), $MachinePrecision] * u + (-v)), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.02 \cdot 10^{+170}:\\
\;\;\;\;v \cdot \frac{-1}{\mathsf{fma}\left(2, u, t1\right)}\\
\mathbf{elif}\;t1 \leq 6 \cdot 10^{+127}:\\
\;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{v}{t1}, u, -v\right)}{u + t1}\\
\end{array}
\end{array}
if t1 < -1.02000000000000002e170Initial program 43.4%
lift-/.f64N/A
frac-2negN/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
times-fracN/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
frac-timesN/A
div-invN/A
*-lft-identityN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6499.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.6
Applied rewrites99.6%
Taylor expanded in u around 0
+-commutativeN/A
lower-fma.f6494.2
Applied rewrites94.2%
if -1.02000000000000002e170 < t1 < 6.0000000000000005e127Initial program 83.6%
if 6.0000000000000005e127 < t1 Initial program 31.2%
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-/.f64100.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f64100.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f64100.0
Applied rewrites100.0%
Taylor expanded in u around 0
+-commutativeN/A
*-commutativeN/A
associate-*l/N/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6499.6
Applied rewrites99.6%
Final simplification87.1%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.02e+170) (not (<= t1 9.2e+125))) (* v (/ -1.0 (fma 2.0 u t1))) (/ (* (- t1) v) (* (+ t1 u) (+ t1 u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.02e+170) || !(t1 <= 9.2e+125)) {
tmp = v * (-1.0 / 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 <= -1.02e+170) || !(t1 <= 9.2e+125)) tmp = Float64(v * Float64(-1.0 / fma(2.0, u, 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, -1.02e+170], N[Not[LessEqual[t1, 9.2e+125]], $MachinePrecision]], N[(v * N[(-1.0 / N[(2.0 * u + t1), $MachinePrecision]), $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 -1.02 \cdot 10^{+170} \lor \neg \left(t1 \leq 9.2 \cdot 10^{+125}\right):\\
\;\;\;\;v \cdot \frac{-1}{\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 < -1.02000000000000002e170 or 9.20000000000000051e125 < t1 Initial program 37.2%
lift-/.f64N/A
frac-2negN/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
times-fracN/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
frac-timesN/A
div-invN/A
*-lft-identityN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6499.7
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.7
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.7
Applied rewrites99.7%
Taylor expanded in u around 0
+-commutativeN/A
lower-fma.f6496.8
Applied rewrites96.8%
if -1.02000000000000002e170 < t1 < 9.20000000000000051e125Initial program 83.6%
Final simplification87.0%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -4.5e+55) (not (<= t1 1.45e+90))) (* v (/ -1.0 (fma 2.0 u t1))) (/ (* (/ v u) t1) (- u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -4.5e+55) || !(t1 <= 1.45e+90)) {
tmp = v * (-1.0 / fma(2.0, u, t1));
} else {
tmp = ((v / u) * t1) / -u;
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if ((t1 <= -4.5e+55) || !(t1 <= 1.45e+90)) tmp = Float64(v * Float64(-1.0 / fma(2.0, u, t1))); else tmp = Float64(Float64(Float64(v / u) * t1) / Float64(-u)); end return tmp end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -4.5e+55], N[Not[LessEqual[t1, 1.45e+90]], $MachinePrecision]], N[(v * N[(-1.0 / N[(2.0 * u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(v / u), $MachinePrecision] * t1), $MachinePrecision] / (-u)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -4.5 \cdot 10^{+55} \lor \neg \left(t1 \leq 1.45 \cdot 10^{+90}\right):\\
\;\;\;\;v \cdot \frac{-1}{\mathsf{fma}\left(2, u, t1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{v}{u} \cdot t1}{-u}\\
\end{array}
\end{array}
if t1 < -4.49999999999999998e55 or 1.4500000000000001e90 < t1 Initial program 54.9%
lift-/.f64N/A
frac-2negN/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
times-fracN/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
frac-timesN/A
div-invN/A
*-lft-identityN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6498.7
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.7
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.7
Applied rewrites98.7%
Taylor expanded in u around 0
+-commutativeN/A
lower-fma.f6492.9
Applied rewrites92.9%
if -4.49999999999999998e55 < t1 < 1.4500000000000001e90Initial program 81.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-/.f6473.7
Applied rewrites73.7%
Applied rewrites74.5%
Final simplification81.5%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -4.5e+55) (not (<= t1 1.45e+90))) (* v (/ -1.0 (fma 2.0 u t1))) (* (/ t1 u) (/ (- v) u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -4.5e+55) || !(t1 <= 1.45e+90)) {
tmp = v * (-1.0 / fma(2.0, u, t1));
} else {
tmp = (t1 / u) * (-v / u);
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if ((t1 <= -4.5e+55) || !(t1 <= 1.45e+90)) tmp = Float64(v * Float64(-1.0 / fma(2.0, u, t1))); else tmp = Float64(Float64(t1 / u) * Float64(Float64(-v) / u)); end return tmp end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -4.5e+55], N[Not[LessEqual[t1, 1.45e+90]], $MachinePrecision]], N[(v * N[(-1.0 / N[(2.0 * u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t1 / u), $MachinePrecision] * N[((-v) / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -4.5 \cdot 10^{+55} \lor \neg \left(t1 \leq 1.45 \cdot 10^{+90}\right):\\
\;\;\;\;v \cdot \frac{-1}{\mathsf{fma}\left(2, u, t1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u}\\
\end{array}
\end{array}
if t1 < -4.49999999999999998e55 or 1.4500000000000001e90 < t1 Initial program 54.9%
lift-/.f64N/A
frac-2negN/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
times-fracN/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
frac-timesN/A
div-invN/A
*-lft-identityN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6498.7
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.7
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.7
Applied rewrites98.7%
Taylor expanded in u around 0
+-commutativeN/A
lower-fma.f6492.9
Applied rewrites92.9%
if -4.49999999999999998e55 < t1 < 1.4500000000000001e90Initial program 81.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-/.f6473.7
Applied rewrites73.7%
Final simplification81.0%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.42e-10) (not (<= t1 8.5e+31))) (* v (/ -1.0 (fma 2.0 u t1))) (* v (/ (/ (- t1) u) u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.42e-10) || !(t1 <= 8.5e+31)) {
tmp = v * (-1.0 / fma(2.0, u, t1));
} else {
tmp = v * ((-t1 / u) / u);
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.42e-10) || !(t1 <= 8.5e+31)) tmp = Float64(v * Float64(-1.0 / fma(2.0, u, t1))); else tmp = Float64(v * Float64(Float64(Float64(-t1) / u) / u)); end return tmp end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.42e-10], N[Not[LessEqual[t1, 8.5e+31]], $MachinePrecision]], N[(v * N[(-1.0 / N[(2.0 * u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v * N[(N[((-t1) / u), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.42 \cdot 10^{-10} \lor \neg \left(t1 \leq 8.5 \cdot 10^{+31}\right):\\
\;\;\;\;v \cdot \frac{-1}{\mathsf{fma}\left(2, u, t1\right)}\\
\mathbf{else}:\\
\;\;\;\;v \cdot \frac{\frac{-t1}{u}}{u}\\
\end{array}
\end{array}
if t1 < -1.42000000000000001e-10 or 8.49999999999999947e31 < t1 Initial program 59.3%
lift-/.f64N/A
frac-2negN/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
times-fracN/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
frac-timesN/A
div-invN/A
*-lft-identityN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6497.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.4
Applied rewrites97.4%
Taylor expanded in u around 0
+-commutativeN/A
lower-fma.f6485.3
Applied rewrites85.3%
if -1.42000000000000001e-10 < t1 < 8.49999999999999947e31Initial program 83.0%
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-/.f6476.2
Applied rewrites76.2%
Applied rewrites71.1%
Applied rewrites75.0%
Final simplification80.1%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.42e-10) (not (<= t1 8.5e+31))) (* v (/ -1.0 (fma 2.0 u t1))) (/ (* (- t1) v) (* u u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.42e-10) || !(t1 <= 8.5e+31)) {
tmp = v * (-1.0 / fma(2.0, u, t1));
} else {
tmp = (-t1 * v) / (u * u);
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.42e-10) || !(t1 <= 8.5e+31)) tmp = Float64(v * Float64(-1.0 / fma(2.0, u, t1))); else tmp = Float64(Float64(Float64(-t1) * v) / Float64(u * u)); end return tmp end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.42e-10], N[Not[LessEqual[t1, 8.5e+31]], $MachinePrecision]], N[(v * N[(-1.0 / N[(2.0 * u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-t1) * v), $MachinePrecision] / N[(u * u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.42 \cdot 10^{-10} \lor \neg \left(t1 \leq 8.5 \cdot 10^{+31}\right):\\
\;\;\;\;v \cdot \frac{-1}{\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.42000000000000001e-10 or 8.49999999999999947e31 < t1 Initial program 59.3%
lift-/.f64N/A
frac-2negN/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
times-fracN/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
frac-timesN/A
div-invN/A
*-lft-identityN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6497.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.4
Applied rewrites97.4%
Taylor expanded in u around 0
+-commutativeN/A
lower-fma.f6485.3
Applied rewrites85.3%
if -1.42000000000000001e-10 < t1 < 8.49999999999999947e31Initial program 83.0%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6471.6
Applied rewrites71.6%
Final simplification78.3%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.42e-10) (not (<= t1 8.5e+31))) (/ (- v) (+ u t1)) (/ (* (- t1) v) (* u u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.42e-10) || !(t1 <= 8.5e+31)) {
tmp = -v / (u + t1);
} else {
tmp = (-t1 * v) / (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.42d-10)) .or. (.not. (t1 <= 8.5d+31))) then
tmp = -v / (u + t1)
else
tmp = (-t1 * v) / (u * u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.42e-10) || !(t1 <= 8.5e+31)) {
tmp = -v / (u + t1);
} else {
tmp = (-t1 * v) / (u * u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1.42e-10) or not (t1 <= 8.5e+31): tmp = -v / (u + t1) else: tmp = (-t1 * v) / (u * u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.42e-10) || !(t1 <= 8.5e+31)) tmp = Float64(Float64(-v) / Float64(u + t1)); else tmp = Float64(Float64(Float64(-t1) * v) / Float64(u * u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -1.42e-10) || ~((t1 <= 8.5e+31))) tmp = -v / (u + t1); else tmp = (-t1 * v) / (u * u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.42e-10], N[Not[LessEqual[t1, 8.5e+31]], $MachinePrecision]], N[((-v) / N[(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.42 \cdot 10^{-10} \lor \neg \left(t1 \leq 8.5 \cdot 10^{+31}\right):\\
\;\;\;\;\frac{-v}{u + t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-t1\right) \cdot v}{u \cdot u}\\
\end{array}
\end{array}
if t1 < -1.42000000000000001e-10 or 8.49999999999999947e31 < t1 Initial program 59.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.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6484.6
Applied rewrites84.6%
if -1.42000000000000001e-10 < t1 < 8.49999999999999947e31Initial program 83.0%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6471.6
Applied rewrites71.6%
Final simplification77.9%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.42e-10) (not (<= t1 8.5e+31))) (/ (- v) (+ u t1)) (* v (/ t1 (* (- u) u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.42e-10) || !(t1 <= 8.5e+31)) {
tmp = -v / (u + t1);
} 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.42d-10)) .or. (.not. (t1 <= 8.5d+31))) then
tmp = -v / (u + t1)
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.42e-10) || !(t1 <= 8.5e+31)) {
tmp = -v / (u + t1);
} else {
tmp = v * (t1 / (-u * u));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1.42e-10) or not (t1 <= 8.5e+31): tmp = -v / (u + t1) else: tmp = v * (t1 / (-u * u)) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.42e-10) || !(t1 <= 8.5e+31)) tmp = Float64(Float64(-v) / Float64(u + t1)); else tmp = Float64(v * Float64(t1 / Float64(Float64(-u) * u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -1.42e-10) || ~((t1 <= 8.5e+31))) tmp = -v / (u + t1); else tmp = v * (t1 / (-u * u)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.42e-10], N[Not[LessEqual[t1, 8.5e+31]], $MachinePrecision]], N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision], N[(v * N[(t1 / N[((-u) * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.42 \cdot 10^{-10} \lor \neg \left(t1 \leq 8.5 \cdot 10^{+31}\right):\\
\;\;\;\;\frac{-v}{u + t1}\\
\mathbf{else}:\\
\;\;\;\;v \cdot \frac{t1}{\left(-u\right) \cdot u}\\
\end{array}
\end{array}
if t1 < -1.42000000000000001e-10 or 8.49999999999999947e31 < t1 Initial program 59.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.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6484.6
Applied rewrites84.6%
if -1.42000000000000001e-10 < t1 < 8.49999999999999947e31Initial program 83.0%
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-/.f6476.2
Applied rewrites76.2%
Applied rewrites71.1%
Final simplification77.7%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.42e-10) (not (<= t1 8.5e+31))) (/ (- v) (+ u t1)) (* t1 (/ v (* (- u) u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.42e-10) || !(t1 <= 8.5e+31)) {
tmp = -v / (u + t1);
} else {
tmp = t1 * (v / (-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.42d-10)) .or. (.not. (t1 <= 8.5d+31))) then
tmp = -v / (u + t1)
else
tmp = t1 * (v / (-u * u))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.42e-10) || !(t1 <= 8.5e+31)) {
tmp = -v / (u + t1);
} else {
tmp = t1 * (v / (-u * u));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1.42e-10) or not (t1 <= 8.5e+31): tmp = -v / (u + t1) else: tmp = t1 * (v / (-u * u)) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.42e-10) || !(t1 <= 8.5e+31)) tmp = Float64(Float64(-v) / Float64(u + t1)); else tmp = Float64(t1 * Float64(v / Float64(Float64(-u) * u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -1.42e-10) || ~((t1 <= 8.5e+31))) tmp = -v / (u + t1); else tmp = t1 * (v / (-u * u)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.42e-10], N[Not[LessEqual[t1, 8.5e+31]], $MachinePrecision]], N[((-v) / N[(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.42 \cdot 10^{-10} \lor \neg \left(t1 \leq 8.5 \cdot 10^{+31}\right):\\
\;\;\;\;\frac{-v}{u + t1}\\
\mathbf{else}:\\
\;\;\;\;t1 \cdot \frac{v}{\left(-u\right) \cdot u}\\
\end{array}
\end{array}
if t1 < -1.42000000000000001e-10 or 8.49999999999999947e31 < t1 Initial program 59.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.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6484.6
Applied rewrites84.6%
if -1.42000000000000001e-10 < t1 < 8.49999999999999947e31Initial program 83.0%
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-/.f6476.2
Applied rewrites76.2%
Applied rewrites69.6%
Final simplification76.9%
(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)) * Float64(t1 / Float64(u + t1))) end
function tmp = code(u, v, t1) tmp = (-v / (u + t1)) * (t1 / (u + t1)); end
code[u_, v_, t1_] := N[(N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision] * N[(t1 / N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-v}{u + t1} \cdot \frac{t1}{u + t1}
\end{array}
Initial program 71.4%
lift-/.f64N/A
frac-2negN/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
times-fracN/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6497.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.5
Applied rewrites97.5%
(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(Float64(t1 / Float64(u + t1)) / Float64(u + t1))) end
function tmp = code(u, v, t1) tmp = -v * ((t1 / (u + t1)) / (u + t1)); end
code[u_, v_, t1_] := N[((-v) * N[(N[(t1 / N[(u + t1), $MachinePrecision]), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-v\right) \cdot \frac{\frac{t1}{u + t1}}{u + t1}
\end{array}
Initial program 71.4%
lift-/.f64N/A
frac-2negN/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
times-fracN/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6497.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6497.5
Applied rewrites97.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
frac-timesN/A
div-invN/A
*-lft-identityN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6495.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6495.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6495.6
Applied rewrites95.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
clear-numN/A
lift-+.f64N/A
+-commutativeN/A
lower-/.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6495.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6495.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6495.8
Applied rewrites95.8%
(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(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 71.4%
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.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.2
Applied rewrites99.2%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6459.2
Applied rewrites59.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 71.4%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6451.9
Applied rewrites51.9%
herbie shell --seed 2024320
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))