
(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 11 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) (- (+ t1 u))))
double code(double u, double v, double t1) {
return ((v / (t1 + u)) * t1) / -(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)) * t1) / -(t1 + u)
end function
public static double code(double u, double v, double t1) {
return ((v / (t1 + u)) * t1) / -(t1 + u);
}
def code(u, v, t1): return ((v / (t1 + u)) * t1) / -(t1 + u)
function code(u, v, t1) return Float64(Float64(Float64(v / Float64(t1 + u)) * t1) / Float64(-Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = ((v / (t1 + u)) * t1) / -(t1 + u); end
code[u_, v_, t1_] := N[(N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * t1), $MachinePrecision] / (-N[(t1 + u), $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{v}{t1 + u} \cdot t1}{-\left(t1 + u\right)}
\end{array}
Initial program 69.2%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/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%
Final simplification99.1%
(FPCore (u v t1)
:precision binary64
(if (<= u -1.6e+179)
(/ (* (/ (- v) u) t1) u)
(if (<= u 5e+147)
(/ (- v) (fma (+ 2.0 (/ u t1)) u t1))
(/ (- t1) (* (/ (+ t1 u) v) (+ t1 u))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -1.6e+179) {
tmp = ((-v / u) * t1) / u;
} else if (u <= 5e+147) {
tmp = -v / fma((2.0 + (u / t1)), u, t1);
} else {
tmp = -t1 / (((t1 + u) / v) * (t1 + u));
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if (u <= -1.6e+179) tmp = Float64(Float64(Float64(Float64(-v) / u) * t1) / u); elseif (u <= 5e+147) tmp = Float64(Float64(-v) / fma(Float64(2.0 + Float64(u / t1)), u, t1)); else tmp = Float64(Float64(-t1) / Float64(Float64(Float64(t1 + u) / v) * Float64(t1 + u))); end return tmp end
code[u_, v_, t1_] := If[LessEqual[u, -1.6e+179], N[(N[(N[((-v) / u), $MachinePrecision] * t1), $MachinePrecision] / u), $MachinePrecision], If[LessEqual[u, 5e+147], N[((-v) / N[(N[(2.0 + N[(u / t1), $MachinePrecision]), $MachinePrecision] * u + t1), $MachinePrecision]), $MachinePrecision], N[((-t1) / N[(N[(N[(t1 + u), $MachinePrecision] / v), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.6 \cdot 10^{+179}:\\
\;\;\;\;\frac{\frac{-v}{u} \cdot t1}{u}\\
\mathbf{elif}\;u \leq 5 \cdot 10^{+147}:\\
\;\;\;\;\frac{-v}{\mathsf{fma}\left(2 + \frac{u}{t1}, u, t1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-t1}{\frac{t1 + u}{v} \cdot \left(t1 + u\right)}\\
\end{array}
\end{array}
if u < -1.6000000000000001e179Initial program 61.2%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/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.7
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.7
Applied rewrites99.7%
Taylor expanded in u around inf
*-commutativeN/A
associate-*l/N/A
associate-*l*N/A
lower-*.f64N/A
associate-*r/N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6478.0
Applied rewrites78.0%
Applied rewrites98.2%
if -1.6000000000000001e179 < u < 5.0000000000000002e147Initial program 71.4%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6435.5
Applied rewrites35.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6435.8
Applied rewrites35.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
remove-double-negN/A
lower-/.f64N/A
lower-/.f6435.6
Applied rewrites35.6%
Taylor expanded in u around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6498.4
Applied rewrites98.4%
if 5.0000000000000002e147 < u Initial program 61.7%
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.f6491.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6491.9
Applied rewrites91.9%
Final simplification97.5%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (* (/ (- v) u) t1) u)))
(if (<= u -1.6e+179)
t_1
(if (<= u 5e+147) (/ (- v) (fma (+ 2.0 (/ u t1)) u t1)) t_1))))
double code(double u, double v, double t1) {
double t_1 = ((-v / u) * t1) / u;
double tmp;
if (u <= -1.6e+179) {
tmp = t_1;
} else if (u <= 5e+147) {
tmp = -v / fma((2.0 + (u / t1)), u, t1);
} else {
tmp = t_1;
}
return tmp;
}
function code(u, v, t1) t_1 = Float64(Float64(Float64(Float64(-v) / u) * t1) / u) tmp = 0.0 if (u <= -1.6e+179) tmp = t_1; elseif (u <= 5e+147) tmp = Float64(Float64(-v) / fma(Float64(2.0 + Float64(u / t1)), u, t1)); else tmp = t_1; end return tmp end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(N[((-v) / u), $MachinePrecision] * t1), $MachinePrecision] / u), $MachinePrecision]}, If[LessEqual[u, -1.6e+179], t$95$1, If[LessEqual[u, 5e+147], N[((-v) / N[(N[(2.0 + N[(u / t1), $MachinePrecision]), $MachinePrecision] * u + t1), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{-v}{u} \cdot t1}{u}\\
\mathbf{if}\;u \leq -1.6 \cdot 10^{+179}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 5 \cdot 10^{+147}:\\
\;\;\;\;\frac{-v}{\mathsf{fma}\left(2 + \frac{u}{t1}, u, t1\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -1.6000000000000001e179 or 5.0000000000000002e147 < u Initial program 61.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/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.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
Applied rewrites99.8%
Taylor expanded in u around inf
*-commutativeN/A
associate-*l/N/A
associate-*l*N/A
lower-*.f64N/A
associate-*r/N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6481.5
Applied rewrites81.5%
Applied rewrites92.7%
if -1.6000000000000001e179 < u < 5.0000000000000002e147Initial program 71.4%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6435.5
Applied rewrites35.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6435.8
Applied rewrites35.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
remove-double-negN/A
lower-/.f64N/A
lower-/.f6435.6
Applied rewrites35.6%
Taylor expanded in u around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6498.4
Applied rewrites98.4%
Final simplification97.1%
(FPCore (u v t1) :precision binary64 (if (<= t1 -7.2e+70) (/ (- v) (fma 2.0 u t1)) (if (<= t1 1.55e+50) (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))) (/ (- v) t1))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -7.2e+70) {
tmp = -v / fma(2.0, u, t1);
} else if (t1 <= 1.55e+50) {
tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
} else {
tmp = -v / t1;
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if (t1 <= -7.2e+70) tmp = Float64(Float64(-v) / fma(2.0, u, t1)); elseif (t1 <= 1.55e+50) tmp = Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))); else tmp = Float64(Float64(-v) / t1); end return tmp end
code[u_, v_, t1_] := If[LessEqual[t1, -7.2e+70], N[((-v) / N[(2.0 * u + t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 1.55e+50], N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -7.2 \cdot 10^{+70}:\\
\;\;\;\;\frac{-v}{\mathsf{fma}\left(2, u, t1\right)}\\
\mathbf{elif}\;t1 \leq 1.55 \cdot 10^{+50}:\\
\;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if t1 < -7.1999999999999999e70Initial program 46.7%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6414.4
Applied rewrites14.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6414.9
Applied rewrites14.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
remove-double-negN/A
lower-/.f64N/A
lower-/.f6414.9
Applied rewrites14.9%
Taylor expanded in u around 0
+-commutativeN/A
lower-fma.f6494.3
Applied rewrites94.3%
if -7.1999999999999999e70 < t1 < 1.55000000000000001e50Initial program 82.2%
if 1.55000000000000001e50 < t1 Initial program 49.0%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6483.4
Applied rewrites83.4%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (fma 2.0 u t1))))
(if (<= t1 -2.65e+46)
t_1
(if (<= t1 1.26e-114) (/ (* (/ (- v) u) t1) u) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / fma(2.0, u, t1);
double tmp;
if (t1 <= -2.65e+46) {
tmp = t_1;
} else if (t1 <= 1.26e-114) {
tmp = ((-v / u) * t1) / u;
} else {
tmp = t_1;
}
return tmp;
}
function code(u, v, t1) t_1 = Float64(Float64(-v) / fma(2.0, u, t1)) tmp = 0.0 if (t1 <= -2.65e+46) tmp = t_1; elseif (t1 <= 1.26e-114) tmp = Float64(Float64(Float64(Float64(-v) / u) * t1) / u); else tmp = t_1; end return tmp end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(2.0 * u + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -2.65e+46], t$95$1, If[LessEqual[t1, 1.26e-114], N[(N[(N[((-v) / u), $MachinePrecision] * t1), $MachinePrecision] / u), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{\mathsf{fma}\left(2, u, t1\right)}\\
\mathbf{if}\;t1 \leq -2.65 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 1.26 \cdot 10^{-114}:\\
\;\;\;\;\frac{\frac{-v}{u} \cdot t1}{u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -2.64999999999999989e46 or 1.25999999999999992e-114 < t1 Initial program 59.9%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6421.0
Applied rewrites21.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6421.4
Applied rewrites21.4%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
remove-double-negN/A
lower-/.f64N/A
lower-/.f6421.4
Applied rewrites21.4%
Taylor expanded in u around 0
+-commutativeN/A
lower-fma.f6482.4
Applied rewrites82.4%
if -2.64999999999999989e46 < t1 < 1.25999999999999992e-114Initial program 80.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/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.f6498.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.1
Applied rewrites98.1%
Taylor expanded in u around inf
*-commutativeN/A
associate-*l/N/A
associate-*l*N/A
lower-*.f64N/A
associate-*r/N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6469.5
Applied rewrites69.5%
Applied rewrites76.9%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (fma 2.0 u t1))))
(if (<= t1 -2.65e+46)
t_1
(if (<= t1 1.26e-114) (* (/ t1 u) (/ (- v) u)) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / fma(2.0, u, t1);
double tmp;
if (t1 <= -2.65e+46) {
tmp = t_1;
} else if (t1 <= 1.26e-114) {
tmp = (t1 / u) * (-v / u);
} else {
tmp = t_1;
}
return tmp;
}
function code(u, v, t1) t_1 = Float64(Float64(-v) / fma(2.0, u, t1)) tmp = 0.0 if (t1 <= -2.65e+46) tmp = t_1; elseif (t1 <= 1.26e-114) tmp = Float64(Float64(t1 / u) * Float64(Float64(-v) / u)); else tmp = t_1; end return tmp end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(2.0 * u + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -2.65e+46], t$95$1, If[LessEqual[t1, 1.26e-114], N[(N[(t1 / u), $MachinePrecision] * N[((-v) / u), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{\mathsf{fma}\left(2, u, t1\right)}\\
\mathbf{if}\;t1 \leq -2.65 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 1.26 \cdot 10^{-114}:\\
\;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -2.64999999999999989e46 or 1.25999999999999992e-114 < t1 Initial program 59.9%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6421.0
Applied rewrites21.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6421.4
Applied rewrites21.4%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
remove-double-negN/A
lower-/.f64N/A
lower-/.f6421.4
Applied rewrites21.4%
Taylor expanded in u around 0
+-commutativeN/A
lower-fma.f6482.4
Applied rewrites82.4%
if -2.64999999999999989e46 < t1 < 1.25999999999999992e-114Initial program 80.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-/.f6475.4
Applied rewrites75.4%
Final simplification79.3%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (fma 2.0 u t1))))
(if (<= t1 -5.2e-94)
t_1
(if (<= t1 1.22e-114) (* (/ (- t1) (* u u)) v) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / fma(2.0, u, t1);
double tmp;
if (t1 <= -5.2e-94) {
tmp = t_1;
} else if (t1 <= 1.22e-114) {
tmp = (-t1 / (u * u)) * v;
} else {
tmp = t_1;
}
return tmp;
}
function code(u, v, t1) t_1 = Float64(Float64(-v) / fma(2.0, u, t1)) tmp = 0.0 if (t1 <= -5.2e-94) tmp = t_1; elseif (t1 <= 1.22e-114) tmp = Float64(Float64(Float64(-t1) / Float64(u * u)) * v); else tmp = t_1; end return tmp end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(2.0 * u + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -5.2e-94], t$95$1, If[LessEqual[t1, 1.22e-114], N[(N[((-t1) / N[(u * u), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{\mathsf{fma}\left(2, u, t1\right)}\\
\mathbf{if}\;t1 \leq -5.2 \cdot 10^{-94}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 1.22 \cdot 10^{-114}:\\
\;\;\;\;\frac{-t1}{u \cdot u} \cdot v\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -5.19999999999999988e-94 or 1.22e-114 < t1 Initial program 65.4%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6426.7
Applied rewrites26.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6426.6
Applied rewrites26.6%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
remove-double-negN/A
lower-/.f64N/A
lower-/.f6426.6
Applied rewrites26.6%
Taylor expanded in u around 0
+-commutativeN/A
lower-fma.f6477.8
Applied rewrites77.8%
if -5.19999999999999988e-94 < t1 < 1.22e-114Initial program 77.5%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6473.2
Applied rewrites73.2%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6473.9
Applied rewrites73.9%
Final simplification76.6%
(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(t1 + u)) * v) / Float64(-Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = ((t1 / (t1 + u)) * v) / -(t1 + u); end
code[u_, v_, t1_] := N[(N[(N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision] / (-N[(t1 + u), $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{t1}{t1 + u} \cdot v}{-\left(t1 + u\right)}
\end{array}
Initial program 69.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-/.f6498.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.5
Applied rewrites98.5%
Final simplification98.5%
(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(Float64(-v) / fma(2.0, u, 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 69.2%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6441.3
Applied rewrites41.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6441.4
Applied rewrites41.4%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
remove-double-negN/A
lower-/.f64N/A
lower-/.f6441.2
Applied rewrites41.2%
Taylor expanded in u around 0
+-commutativeN/A
lower-fma.f6461.9
Applied rewrites61.9%
(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 69.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-/.f6498.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.5
Applied rewrites98.5%
Taylor expanded in u around 0
Applied rewrites61.7%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6461.7
Applied rewrites61.7%
Final simplification61.7%
(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 69.2%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6456.1
Applied rewrites56.1%
herbie shell --seed 2024331
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))