
(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 (- (- 0.0 t1) u)) (/ t1 (+ t1 u))))
double code(double u, double v, double t1) {
return (v / ((0.0 - 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 / ((0.0d0 - t1) - u)) * (t1 / (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (v / ((0.0 - t1) - u)) * (t1 / (t1 + u));
}
def code(u, v, t1): return (v / ((0.0 - t1) - u)) * (t1 / (t1 + u))
function code(u, v, t1) return Float64(Float64(v / Float64(Float64(0.0 - t1) - u)) * Float64(t1 / Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (v / ((0.0 - t1) - u)) * (t1 / (t1 + u)); end
code[u_, v_, t1_] := N[(N[(v / N[(N[(0.0 - t1), $MachinePrecision] - u), $MachinePrecision]), $MachinePrecision] * N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{\left(0 - t1\right) - u} \cdot \frac{t1}{t1 + u}
\end{array}
Initial program 71.4%
*-commutativeN/A
neg-mul-1N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
neg-mul-1N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6498.0
Applied egg-rr98.0%
sub0-negN/A
neg-lowering-neg.f6498.0
Applied egg-rr98.0%
Final simplification98.0%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (- 0.0 (/ v (fma u 2.0 t1)))))
(if (<= t1 -3.1e+51)
t_1
(if (<= t1 9e+114) (* t1 (/ (- 0.0 v) (* (+ t1 u) (+ t1 u)))) t_1))))
double code(double u, double v, double t1) {
double t_1 = 0.0 - (v / fma(u, 2.0, t1));
double tmp;
if (t1 <= -3.1e+51) {
tmp = t_1;
} else if (t1 <= 9e+114) {
tmp = t1 * ((0.0 - v) / ((t1 + u) * (t1 + u)));
} else {
tmp = t_1;
}
return tmp;
}
function code(u, v, t1) t_1 = Float64(0.0 - Float64(v / fma(u, 2.0, t1))) tmp = 0.0 if (t1 <= -3.1e+51) tmp = t_1; elseif (t1 <= 9e+114) tmp = Float64(t1 * Float64(Float64(0.0 - v) / Float64(Float64(t1 + u) * Float64(t1 + u)))); else tmp = t_1; end return tmp end
code[u_, v_, t1_] := Block[{t$95$1 = N[(0.0 - N[(v / N[(u * 2.0 + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -3.1e+51], t$95$1, If[LessEqual[t1, 9e+114], N[(t1 * N[(N[(0.0 - v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0 - \frac{v}{\mathsf{fma}\left(u, 2, t1\right)}\\
\mathbf{if}\;t1 \leq -3.1 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 9 \cdot 10^{+114}:\\
\;\;\;\;t1 \cdot \frac{0 - v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -3.10000000000000011e51 or 9.0000000000000001e114 < t1 Initial program 44.7%
Taylor expanded in u around 0
+-commutativeN/A
unpow2N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6443.3
Simplified43.3%
times-fracN/A
distribute-frac-negN/A
*-inversesN/A
distribute-lft-neg-outN/A
clear-numN/A
div-invN/A
clear-numN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
accelerator-lowering-fma.f6490.5
Applied egg-rr90.5%
if -3.10000000000000011e51 < t1 < 9.0000000000000001e114Initial program 81.6%
associate-/l*N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6485.6
Applied egg-rr85.6%
Final simplification87.0%
(FPCore (u v t1) :precision binary64 (if (<= v 4e+179) (/ (- 0.0 v) (fma u (+ 2.0 (/ u t1)) t1)) (* t1 (/ (/ v (- (- 0.0 t1) u)) (+ t1 u)))))
double code(double u, double v, double t1) {
double tmp;
if (v <= 4e+179) {
tmp = (0.0 - v) / fma(u, (2.0 + (u / t1)), t1);
} else {
tmp = t1 * ((v / ((0.0 - t1) - u)) / (t1 + u));
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if (v <= 4e+179) tmp = Float64(Float64(0.0 - v) / fma(u, Float64(2.0 + Float64(u / t1)), t1)); else tmp = Float64(t1 * Float64(Float64(v / Float64(Float64(0.0 - t1) - u)) / Float64(t1 + u))); end return tmp end
code[u_, v_, t1_] := If[LessEqual[v, 4e+179], N[(N[(0.0 - v), $MachinePrecision] / N[(u * N[(2.0 + N[(u / t1), $MachinePrecision]), $MachinePrecision] + t1), $MachinePrecision]), $MachinePrecision], N[(t1 * N[(N[(v / N[(N[(0.0 - t1), $MachinePrecision] - u), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq 4 \cdot 10^{+179}:\\
\;\;\;\;\frac{0 - v}{\mathsf{fma}\left(u, 2 + \frac{u}{t1}, t1\right)}\\
\mathbf{else}:\\
\;\;\;\;t1 \cdot \frac{\frac{v}{\left(0 - t1\right) - u}}{t1 + u}\\
\end{array}
\end{array}
if v < 3.99999999999999992e179Initial program 73.7%
*-commutativeN/A
neg-mul-1N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
neg-mul-1N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6498.2
Applied egg-rr98.2%
*-commutativeN/A
clear-numN/A
frac-timesN/A
frac-2negN/A
*-lft-identityN/A
flip3--N/A
flip3--N/A
sub0-negN/A
remove-double-negN/A
/-lowering-/.f64N/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6496.1
Applied egg-rr96.1%
Taylor expanded in t1 around inf
Simplified96.1%
if 3.99999999999999992e179 < v Initial program 51.7%
*-commutativeN/A
neg-mul-1N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
neg-mul-1N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6496.3
Applied egg-rr96.3%
sub0-negN/A
distribute-frac-negN/A
distribute-lft-neg-inN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6492.5
Applied egg-rr92.5%
Final simplification95.7%
(FPCore (u v t1) :precision binary64 (if (<= u -3.8e+118) (- 0.0 (/ (* t1 (/ v u)) u)) (/ (- 0.0 v) (fma u (+ 2.0 (/ u t1)) t1))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -3.8e+118) {
tmp = 0.0 - ((t1 * (v / u)) / u);
} else {
tmp = (0.0 - v) / fma(u, (2.0 + (u / t1)), t1);
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if (u <= -3.8e+118) tmp = Float64(0.0 - Float64(Float64(t1 * Float64(v / u)) / u)); else tmp = Float64(Float64(0.0 - v) / fma(u, Float64(2.0 + Float64(u / t1)), t1)); end return tmp end
code[u_, v_, t1_] := If[LessEqual[u, -3.8e+118], N[(0.0 - N[(N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision], N[(N[(0.0 - v), $MachinePrecision] / N[(u * N[(2.0 + N[(u / t1), $MachinePrecision]), $MachinePrecision] + t1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.8 \cdot 10^{+118}:\\
\;\;\;\;0 - \frac{t1 \cdot \frac{v}{u}}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{0 - v}{\mathsf{fma}\left(u, 2 + \frac{u}{t1}, t1\right)}\\
\end{array}
\end{array}
if u < -3.80000000000000016e118Initial program 80.5%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6476.3
Applied egg-rr76.3%
Taylor expanded in t1 around 0
unpow2N/A
*-lowering-*.f6476.3
Simplified76.3%
neg-sub0N/A
associate-*l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
+-lft-identityN/A
+-commutativeN/A
distribute-lft-inN/A
mul0-rgtN/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6495.1
Applied egg-rr95.1%
+-rgt-identityN/A
sub0-negN/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
sub0-negN/A
--lowering--.f64N/A
/-lowering-/.f6499.9
Applied egg-rr99.9%
if -3.80000000000000016e118 < u Initial program 69.7%
*-commutativeN/A
neg-mul-1N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
neg-mul-1N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6498.4
Applied egg-rr98.4%
*-commutativeN/A
clear-numN/A
frac-timesN/A
frac-2negN/A
*-lft-identityN/A
flip3--N/A
flip3--N/A
sub0-negN/A
remove-double-negN/A
/-lowering-/.f64N/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6496.3
Applied egg-rr96.3%
Taylor expanded in t1 around inf
Simplified96.4%
Final simplification96.9%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (- 0.0 (* t1 (/ v (* u (+ t1 u)))))))
(if (<= u -4.3e-36)
t_1
(if (<= u 1.7e-112) (- 0.0 (/ v (fma u 2.0 t1))) t_1))))
double code(double u, double v, double t1) {
double t_1 = 0.0 - (t1 * (v / (u * (t1 + u))));
double tmp;
if (u <= -4.3e-36) {
tmp = t_1;
} else if (u <= 1.7e-112) {
tmp = 0.0 - (v / fma(u, 2.0, t1));
} else {
tmp = t_1;
}
return tmp;
}
function code(u, v, t1) t_1 = Float64(0.0 - Float64(t1 * Float64(v / Float64(u * Float64(t1 + u))))) tmp = 0.0 if (u <= -4.3e-36) tmp = t_1; elseif (u <= 1.7e-112) tmp = Float64(0.0 - Float64(v / fma(u, 2.0, t1))); else tmp = t_1; end return tmp end
code[u_, v_, t1_] := Block[{t$95$1 = N[(0.0 - N[(t1 * N[(v / N[(u * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -4.3e-36], t$95$1, If[LessEqual[u, 1.7e-112], N[(0.0 - N[(v / N[(u * 2.0 + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0 - t1 \cdot \frac{v}{u \cdot \left(t1 + u\right)}\\
\mathbf{if}\;u \leq -4.3 \cdot 10^{-36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 1.7 \cdot 10^{-112}:\\
\;\;\;\;0 - \frac{v}{\mathsf{fma}\left(u, 2, t1\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -4.3000000000000002e-36 or 1.6999999999999999e-112 < u Initial program 80.2%
Taylor expanded in t1 around 0
Simplified73.8%
associate-/l*N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6477.1
Applied egg-rr77.1%
if -4.3000000000000002e-36 < u < 1.6999999999999999e-112Initial program 57.4%
Taylor expanded in u around 0
+-commutativeN/A
unpow2N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6451.2
Simplified51.2%
times-fracN/A
distribute-frac-negN/A
*-inversesN/A
distribute-lft-neg-outN/A
clear-numN/A
div-invN/A
clear-numN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
accelerator-lowering-fma.f6482.9
Applied egg-rr82.9%
Final simplification79.3%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (* (- 0.0 t1) (/ v (* u u)))))
(if (<= u -4.3e-36)
t_1
(if (<= u 3e-16) (- 0.0 (/ v (fma u 2.0 t1))) t_1))))
double code(double u, double v, double t1) {
double t_1 = (0.0 - t1) * (v / (u * u));
double tmp;
if (u <= -4.3e-36) {
tmp = t_1;
} else if (u <= 3e-16) {
tmp = 0.0 - (v / fma(u, 2.0, t1));
} else {
tmp = t_1;
}
return tmp;
}
function code(u, v, t1) t_1 = Float64(Float64(0.0 - t1) * Float64(v / Float64(u * u))) tmp = 0.0 if (u <= -4.3e-36) tmp = t_1; elseif (u <= 3e-16) tmp = Float64(0.0 - Float64(v / fma(u, 2.0, t1))); else tmp = t_1; end return tmp end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(0.0 - t1), $MachinePrecision] * N[(v / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -4.3e-36], t$95$1, If[LessEqual[u, 3e-16], N[(0.0 - N[(v / N[(u * 2.0 + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(0 - t1\right) \cdot \frac{v}{u \cdot u}\\
\mathbf{if}\;u \leq -4.3 \cdot 10^{-36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 3 \cdot 10^{-16}:\\
\;\;\;\;0 - \frac{v}{\mathsf{fma}\left(u, 2, t1\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -4.3000000000000002e-36 or 2.99999999999999994e-16 < u Initial program 82.0%
*-commutativeN/A
neg-mul-1N/A
associate-*r*N/A
times-fracN/A
*-commutativeN/A
neg-mul-1N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6497.8
Applied egg-rr97.8%
sub0-negN/A
distribute-frac-negN/A
distribute-lft-neg-inN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6492.8
Applied egg-rr92.8%
Taylor expanded in t1 around 0
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6479.9
Simplified79.9%
if -4.3000000000000002e-36 < u < 2.99999999999999994e-16Initial program 59.3%
Taylor expanded in u around 0
+-commutativeN/A
unpow2N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6447.7
Simplified47.7%
times-fracN/A
distribute-frac-negN/A
*-inversesN/A
distribute-lft-neg-outN/A
clear-numN/A
div-invN/A
clear-numN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
accelerator-lowering-fma.f6477.0
Applied egg-rr77.0%
Final simplification78.6%
(FPCore (u v t1) :precision binary64 (if (<= u -3.8e+118) (* (/ v u) -0.5) (/ v (- 0.0 t1))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -3.8e+118) {
tmp = (v / u) * -0.5;
} else {
tmp = v / (0.0 - 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 <= (-3.8d+118)) then
tmp = (v / u) * (-0.5d0)
else
tmp = v / (0.0d0 - t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -3.8e+118) {
tmp = (v / u) * -0.5;
} else {
tmp = v / (0.0 - t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -3.8e+118: tmp = (v / u) * -0.5 else: tmp = v / (0.0 - t1) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -3.8e+118) tmp = Float64(Float64(v / u) * -0.5); else tmp = Float64(v / Float64(0.0 - t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -3.8e+118) tmp = (v / u) * -0.5; else tmp = v / (0.0 - t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -3.8e+118], N[(N[(v / u), $MachinePrecision] * -0.5), $MachinePrecision], N[(v / N[(0.0 - t1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.8 \cdot 10^{+118}:\\
\;\;\;\;\frac{v}{u} \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{0 - t1}\\
\end{array}
\end{array}
if u < -3.80000000000000016e118Initial program 80.5%
Taylor expanded in u around 0
+-commutativeN/A
unpow2N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6445.5
Simplified45.5%
Taylor expanded in t1 around 0
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6436.7
Simplified36.7%
if -3.80000000000000016e118 < u Initial program 69.7%
Taylor expanded in t1 around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f6454.3
Simplified54.3%
sub0-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f6454.3
Applied egg-rr54.3%
Final simplification51.5%
(FPCore (u v t1) :precision binary64 (if (<= u -3.8e+118) (- 0.0 (/ v u)) (/ v (- 0.0 t1))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -3.8e+118) {
tmp = 0.0 - (v / u);
} else {
tmp = v / (0.0 - 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 <= (-3.8d+118)) then
tmp = 0.0d0 - (v / u)
else
tmp = v / (0.0d0 - t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -3.8e+118) {
tmp = 0.0 - (v / u);
} else {
tmp = v / (0.0 - t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -3.8e+118: tmp = 0.0 - (v / u) else: tmp = v / (0.0 - t1) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -3.8e+118) tmp = Float64(0.0 - Float64(v / u)); else tmp = Float64(v / Float64(0.0 - t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -3.8e+118) tmp = 0.0 - (v / u); else tmp = v / (0.0 - t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -3.8e+118], N[(0.0 - N[(v / u), $MachinePrecision]), $MachinePrecision], N[(v / N[(0.0 - t1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.8 \cdot 10^{+118}:\\
\;\;\;\;0 - \frac{v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{0 - t1}\\
\end{array}
\end{array}
if u < -3.80000000000000016e118Initial program 80.5%
Taylor expanded in t1 around 0
Simplified80.5%
Taylor expanded in t1 around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f6436.6
Simplified36.6%
sub0-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f6436.6
Applied egg-rr36.6%
if -3.80000000000000016e118 < u Initial program 69.7%
Taylor expanded in t1 around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f6454.3
Simplified54.3%
sub0-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f6454.3
Applied egg-rr54.3%
Final simplification51.5%
(FPCore (u v t1) :precision binary64 (- 0.0 (/ v (fma u 2.0 t1))))
double code(double u, double v, double t1) {
return 0.0 - (v / fma(u, 2.0, t1));
}
function code(u, v, t1) return Float64(0.0 - Float64(v / fma(u, 2.0, t1))) end
code[u_, v_, t1_] := N[(0.0 - N[(v / N[(u * 2.0 + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0 - \frac{v}{\mathsf{fma}\left(u, 2, t1\right)}
\end{array}
Initial program 71.4%
Taylor expanded in u around 0
+-commutativeN/A
unpow2N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6439.9
Simplified39.9%
times-fracN/A
distribute-frac-negN/A
*-inversesN/A
distribute-lft-neg-outN/A
clear-numN/A
div-invN/A
clear-numN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
accelerator-lowering-fma.f6454.4
Applied egg-rr54.4%
Final simplification54.4%
(FPCore (u v t1) :precision binary64 (/ v (- (- 0.0 t1) u)))
double code(double u, double v, double t1) {
return v / ((0.0 - 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 / ((0.0d0 - t1) - u)
end function
public static double code(double u, double v, double t1) {
return v / ((0.0 - t1) - u);
}
def code(u, v, t1): return v / ((0.0 - t1) - u)
function code(u, v, t1) return Float64(v / Float64(Float64(0.0 - t1) - u)) end
function tmp = code(u, v, t1) tmp = v / ((0.0 - t1) - u); end
code[u_, v_, t1_] := N[(v / N[(N[(0.0 - t1), $MachinePrecision] - u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{\left(0 - t1\right) - u}
\end{array}
Initial program 71.4%
associate-/r*N/A
/-lowering-/.f64N/A
frac-2negN/A
distribute-frac-neg2N/A
neg-sub0N/A
--lowering--.f64N/A
distribute-lft-neg-outN/A
remove-double-negN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6497.7
Applied egg-rr97.7%
Taylor expanded in t1 around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6453.7
Simplified53.7%
Final simplification53.7%
(FPCore (u v t1) :precision binary64 (/ v (- 0.0 t1)))
double code(double u, double v, double t1) {
return v / (0.0 - 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 / (0.0d0 - t1)
end function
public static double code(double u, double v, double t1) {
return v / (0.0 - t1);
}
def code(u, v, t1): return v / (0.0 - t1)
function code(u, v, t1) return Float64(v / Float64(0.0 - t1)) end
function tmp = code(u, v, t1) tmp = v / (0.0 - t1); end
code[u_, v_, t1_] := N[(v / N[(0.0 - t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{0 - t1}
\end{array}
Initial program 71.4%
Taylor expanded in t1 around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f6447.1
Simplified47.1%
sub0-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f6447.1
Applied egg-rr47.1%
Final simplification47.1%
herbie shell --seed 2024194
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))