
(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)) (/ (- (+ u t1)) t1)))
double code(double u, double v, double t1) {
return (v / (u + t1)) / (-(u + t1) / 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)) / (-(u + t1) / t1)
end function
public static double code(double u, double v, double t1) {
return (v / (u + t1)) / (-(u + t1) / t1);
}
def code(u, v, t1): return (v / (u + t1)) / (-(u + t1) / t1)
function code(u, v, t1) return Float64(Float64(v / Float64(u + t1)) / Float64(Float64(-Float64(u + t1)) / t1)) end
function tmp = code(u, v, t1) tmp = (v / (u + t1)) / (-(u + t1) / t1); end
code[u_, v_, t1_] := N[(N[(v / N[(u + t1), $MachinePrecision]), $MachinePrecision] / N[((-N[(u + t1), $MachinePrecision]) / t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{v}{u + t1}}{\frac{-\left(u + t1\right)}{t1}}
\end{array}
Initial program 74.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
frac-2negN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f64N/A
lower-neg.f6498.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.4
Applied rewrites98.4%
(FPCore (u v t1)
:precision binary64
(if (<= t1 -1.25e+94)
(/ v (fma -2.0 u (- t1)))
(if (<= t1 5.2e+77)
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u)))
(/ (- v) (fma (/ u t1) t1 t1)))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.25e+94) {
tmp = v / fma(-2.0, u, -t1);
} else if (t1 <= 5.2e+77) {
tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
} else {
tmp = -v / fma((u / t1), t1, t1);
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if (t1 <= -1.25e+94) tmp = Float64(v / fma(-2.0, u, Float64(-t1))); elseif (t1 <= 5.2e+77) tmp = Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))); else tmp = Float64(Float64(-v) / fma(Float64(u / t1), t1, t1)); end return tmp end
code[u_, v_, t1_] := If[LessEqual[t1, -1.25e+94], N[(v / N[(-2.0 * u + (-t1)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 5.2e+77], N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(N[(u / t1), $MachinePrecision] * t1 + t1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.25 \cdot 10^{+94}:\\
\;\;\;\;\frac{v}{\mathsf{fma}\left(-2, u, -t1\right)}\\
\mathbf{elif}\;t1 \leq 5.2 \cdot 10^{+77}:\\
\;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{\mathsf{fma}\left(\frac{u}{t1}, t1, t1\right)}\\
\end{array}
\end{array}
if t1 < -1.25000000000000003e94Initial program 45.5%
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.f6492.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6492.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6492.8
Applied rewrites92.8%
lift-*.f64N/A
*-lft-identity92.8
Applied rewrites92.8%
Taylor expanded in u around 0
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6485.5
Applied rewrites85.5%
if -1.25000000000000003e94 < t1 < 5.2000000000000004e77Initial program 89.5%
if 5.2000000000000004e77 < t1 Initial program 46.1%
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
mul-1-negN/A
lower-neg.f6489.8
Applied rewrites89.8%
Taylor expanded in t1 around inf
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
lower-/.f6489.8
Applied rewrites89.8%
(FPCore (u v t1)
:precision binary64
(if (<= t1 -1.25e+94)
(/ v (fma -2.0 u (- t1)))
(if (<= t1 5.2e+77)
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u)))
(/ (- v) (+ u t1)))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.25e+94) {
tmp = v / fma(-2.0, u, -t1);
} else if (t1 <= 5.2e+77) {
tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
} else {
tmp = -v / (u + t1);
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if (t1 <= -1.25e+94) tmp = Float64(v / fma(-2.0, u, Float64(-t1))); elseif (t1 <= 5.2e+77) tmp = Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))); else tmp = Float64(Float64(-v) / Float64(u + t1)); end return tmp end
code[u_, v_, t1_] := If[LessEqual[t1, -1.25e+94], N[(v / N[(-2.0 * u + (-t1)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 5.2e+77], N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.25 \cdot 10^{+94}:\\
\;\;\;\;\frac{v}{\mathsf{fma}\left(-2, u, -t1\right)}\\
\mathbf{elif}\;t1 \leq 5.2 \cdot 10^{+77}:\\
\;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{u + t1}\\
\end{array}
\end{array}
if t1 < -1.25000000000000003e94Initial program 45.5%
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.f6492.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6492.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6492.8
Applied rewrites92.8%
lift-*.f64N/A
*-lft-identity92.8
Applied rewrites92.8%
Taylor expanded in u around 0
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6485.5
Applied rewrites85.5%
if -1.25000000000000003e94 < t1 < 5.2000000000000004e77Initial program 89.5%
if 5.2000000000000004e77 < t1 Initial program 46.1%
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
mul-1-negN/A
lower-neg.f6489.8
Applied rewrites89.8%
(FPCore (u v t1) :precision binary64 (if (<= t1 -1.1e-8) (/ v (fma -2.0 u (- t1))) (if (<= t1 2.15e-81) (* (/ t1 u) (/ (- v) u)) (/ (- v) (+ u t1)))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.1e-8) {
tmp = v / fma(-2.0, u, -t1);
} else if (t1 <= 2.15e-81) {
tmp = (t1 / u) * (-v / u);
} else {
tmp = -v / (u + t1);
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if (t1 <= -1.1e-8) tmp = Float64(v / fma(-2.0, u, Float64(-t1))); elseif (t1 <= 2.15e-81) tmp = Float64(Float64(t1 / u) * Float64(Float64(-v) / u)); else tmp = Float64(Float64(-v) / Float64(u + t1)); end return tmp end
code[u_, v_, t1_] := If[LessEqual[t1, -1.1e-8], N[(v / N[(-2.0 * u + (-t1)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 2.15e-81], N[(N[(t1 / u), $MachinePrecision] * N[((-v) / u), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.1 \cdot 10^{-8}:\\
\;\;\;\;\frac{v}{\mathsf{fma}\left(-2, u, -t1\right)}\\
\mathbf{elif}\;t1 \leq 2.15 \cdot 10^{-81}:\\
\;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{u + t1}\\
\end{array}
\end{array}
if t1 < -1.0999999999999999e-8Initial program 61.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.f6493.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
lift-*.f64N/A
*-lft-identity93.8
Applied rewrites93.8%
Taylor expanded in u around 0
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6480.1
Applied rewrites80.1%
if -1.0999999999999999e-8 < t1 < 2.15000000000000015e-81Initial program 89.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-/.f6483.3
Applied rewrites83.3%
if 2.15000000000000015e-81 < t1 Initial program 63.9%
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.f6477.9
Applied rewrites77.9%
Final simplification80.8%
(FPCore (u v t1) :precision binary64 (if (<= t1 -1.1e-8) (/ v (fma -2.0 u (- t1))) (if (<= t1 2.15e-81) (* t1 (/ v (* (- u) u))) (/ (- v) (+ u t1)))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.1e-8) {
tmp = v / fma(-2.0, u, -t1);
} else if (t1 <= 2.15e-81) {
tmp = t1 * (v / (-u * u));
} else {
tmp = -v / (u + t1);
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if (t1 <= -1.1e-8) tmp = Float64(v / fma(-2.0, u, Float64(-t1))); elseif (t1 <= 2.15e-81) tmp = Float64(t1 * Float64(v / Float64(Float64(-u) * u))); else tmp = Float64(Float64(-v) / Float64(u + t1)); end return tmp end
code[u_, v_, t1_] := If[LessEqual[t1, -1.1e-8], N[(v / N[(-2.0 * u + (-t1)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 2.15e-81], N[(t1 * N[(v / N[((-u) * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.1 \cdot 10^{-8}:\\
\;\;\;\;\frac{v}{\mathsf{fma}\left(-2, u, -t1\right)}\\
\mathbf{elif}\;t1 \leq 2.15 \cdot 10^{-81}:\\
\;\;\;\;t1 \cdot \frac{v}{\left(-u\right) \cdot u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{u + t1}\\
\end{array}
\end{array}
if t1 < -1.0999999999999999e-8Initial program 61.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.f6493.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
lift-*.f64N/A
*-lft-identity93.8
Applied rewrites93.8%
Taylor expanded in u around 0
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6480.1
Applied rewrites80.1%
if -1.0999999999999999e-8 < t1 < 2.15000000000000015e-81Initial program 89.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-/.f6483.3
Applied rewrites83.3%
Applied rewrites81.9%
if 2.15000000000000015e-81 < t1 Initial program 63.9%
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.f6477.9
Applied rewrites77.9%
(FPCore (u v t1) :precision binary64 (if (<= t1 -1.1e-8) (/ v (fma -2.0 u (- t1))) (if (<= t1 2.15e-81) (* v (/ t1 (* (- u) u))) (/ (- v) (+ u t1)))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.1e-8) {
tmp = v / fma(-2.0, u, -t1);
} else if (t1 <= 2.15e-81) {
tmp = v * (t1 / (-u * u));
} else {
tmp = -v / (u + t1);
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if (t1 <= -1.1e-8) tmp = Float64(v / fma(-2.0, u, Float64(-t1))); elseif (t1 <= 2.15e-81) tmp = Float64(v * Float64(t1 / Float64(Float64(-u) * u))); else tmp = Float64(Float64(-v) / Float64(u + t1)); end return tmp end
code[u_, v_, t1_] := If[LessEqual[t1, -1.1e-8], N[(v / N[(-2.0 * u + (-t1)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 2.15e-81], N[(v * N[(t1 / N[((-u) * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.1 \cdot 10^{-8}:\\
\;\;\;\;\frac{v}{\mathsf{fma}\left(-2, u, -t1\right)}\\
\mathbf{elif}\;t1 \leq 2.15 \cdot 10^{-81}:\\
\;\;\;\;v \cdot \frac{t1}{\left(-u\right) \cdot u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{u + t1}\\
\end{array}
\end{array}
if t1 < -1.0999999999999999e-8Initial program 61.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.f6493.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
lift-*.f64N/A
*-lft-identity93.8
Applied rewrites93.8%
Taylor expanded in u around 0
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6480.1
Applied rewrites80.1%
if -1.0999999999999999e-8 < t1 < 2.15000000000000015e-81Initial program 89.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-/.f6483.3
Applied rewrites83.3%
Applied rewrites81.9%
Taylor expanded in u around 0
Applied rewrites81.5%
if 2.15000000000000015e-81 < t1 Initial program 63.9%
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.f6477.9
Applied rewrites77.9%
(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 74.8%
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-/.f6498.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.1
Applied rewrites98.1%
Final simplification98.1%
(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(-v) / Float64(Float64(Float64(u + t1) / t1) * Float64(u + t1))) end
function tmp = code(u, v, t1) tmp = -v / (((u + t1) / t1) * (u + t1)); end
code[u_, v_, t1_] := N[((-v) / N[(N[(N[(u + t1), $MachinePrecision] / t1), $MachinePrecision] * N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-v}{\frac{u + t1}{t1} \cdot \left(u + t1\right)}
\end{array}
Initial program 74.8%
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.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.1
Applied rewrites96.1%
lift-*.f64N/A
*-lft-identity96.1
Applied rewrites96.1%
Final simplification96.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 74.8%
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.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.1
Applied rewrites96.1%
lift-*.f64N/A
*-lft-identity96.1
Applied rewrites96.1%
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-/.f6496.1
Applied rewrites96.1%
(FPCore (u v t1) :precision binary64 (/ v (fma (- -2.0 (/ u t1)) u (- t1))))
double code(double u, double v, double t1) {
return v / fma((-2.0 - (u / t1)), u, -t1);
}
function code(u, v, t1) return Float64(v / fma(Float64(-2.0 - Float64(u / t1)), u, Float64(-t1))) end
code[u_, v_, t1_] := N[(v / N[(N[(-2.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision] * u + (-t1)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{\mathsf{fma}\left(-2 - \frac{u}{t1}, u, -t1\right)}
\end{array}
Initial program 74.8%
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.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.1
Applied rewrites96.1%
lift-*.f64N/A
*-lft-identity96.1
Applied rewrites96.1%
Taylor expanded in u around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6496.1
Applied rewrites96.1%
(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 74.8%
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.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6496.1
Applied rewrites96.1%
lift-*.f64N/A
*-lft-identity96.1
Applied rewrites96.1%
Taylor expanded in u around 0
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6459.0
Applied rewrites59.0%
(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 74.8%
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-/.f6498.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.1
Applied rewrites98.1%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6458.5
Applied rewrites58.5%
(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 74.8%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6450.7
Applied rewrites50.7%
herbie shell --seed 2024314
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))