
(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 7 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 (* (/ t1 (+ t1 u)) (- 0.0 (/ v (+ t1 u)))))
double code(double u, double v, double t1) {
return (t1 / (t1 + u)) * (0.0 - (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)) * (0.0d0 - (v / (t1 + u)))
end function
public static double code(double u, double v, double t1) {
return (t1 / (t1 + u)) * (0.0 - (v / (t1 + u)));
}
def code(u, v, t1): return (t1 / (t1 + u)) * (0.0 - (v / (t1 + u)))
function code(u, v, t1) return Float64(Float64(t1 / Float64(t1 + u)) * Float64(0.0 - Float64(v / Float64(t1 + u)))) end
function tmp = code(u, v, t1) tmp = (t1 / (t1 + u)) * (0.0 - (v / (t1 + u))); end
code[u_, v_, t1_] := N[(N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(0.0 - N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t1}{t1 + u} \cdot \left(0 - \frac{v}{t1 + u}\right)
\end{array}
Initial program 75.0%
*-commutativeN/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
frac-2negN/A
remove-double-negN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
+-lowering-+.f6498.0%
Applied egg-rr98.0%
clear-numN/A
associate-/r/N/A
clear-numN/A
sub0-negN/A
distribute-frac-neg2N/A
distribute-lft-neg-outN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6498.1%
Applied egg-rr98.1%
Final simplification98.1%
(FPCore (u v t1) :precision binary64 (if (<= t1 -8.2e-165) (/ (/ t1 (/ (+ t1 u) v)) (- 0.0 t1)) (if (<= t1 9.5e+65) (/ (- 0.0 (/ t1 u)) (/ u v)) (- 0.0 (/ v (+ t1 u))))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -8.2e-165) {
tmp = (t1 / ((t1 + u) / v)) / (0.0 - t1);
} else if (t1 <= 9.5e+65) {
tmp = (0.0 - (t1 / u)) / (u / v);
} else {
tmp = 0.0 - (v / (t1 + 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 <= (-8.2d-165)) then
tmp = (t1 / ((t1 + u) / v)) / (0.0d0 - t1)
else if (t1 <= 9.5d+65) then
tmp = (0.0d0 - (t1 / u)) / (u / v)
else
tmp = 0.0d0 - (v / (t1 + u))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -8.2e-165) {
tmp = (t1 / ((t1 + u) / v)) / (0.0 - t1);
} else if (t1 <= 9.5e+65) {
tmp = (0.0 - (t1 / u)) / (u / v);
} else {
tmp = 0.0 - (v / (t1 + u));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -8.2e-165: tmp = (t1 / ((t1 + u) / v)) / (0.0 - t1) elif t1 <= 9.5e+65: tmp = (0.0 - (t1 / u)) / (u / v) else: tmp = 0.0 - (v / (t1 + u)) return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -8.2e-165) tmp = Float64(Float64(t1 / Float64(Float64(t1 + u) / v)) / Float64(0.0 - t1)); elseif (t1 <= 9.5e+65) tmp = Float64(Float64(0.0 - Float64(t1 / u)) / Float64(u / v)); else tmp = Float64(0.0 - Float64(v / Float64(t1 + u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -8.2e-165) tmp = (t1 / ((t1 + u) / v)) / (0.0 - t1); elseif (t1 <= 9.5e+65) tmp = (0.0 - (t1 / u)) / (u / v); else tmp = 0.0 - (v / (t1 + u)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -8.2e-165], N[(N[(t1 / N[(N[(t1 + u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision] / N[(0.0 - t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 9.5e+65], N[(N[(0.0 - N[(t1 / u), $MachinePrecision]), $MachinePrecision] / N[(u / v), $MachinePrecision]), $MachinePrecision], N[(0.0 - N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -8.2 \cdot 10^{-165}:\\
\;\;\;\;\frac{\frac{t1}{\frac{t1 + u}{v}}}{0 - t1}\\
\mathbf{elif}\;t1 \leq 9.5 \cdot 10^{+65}:\\
\;\;\;\;\frac{0 - \frac{t1}{u}}{\frac{u}{v}}\\
\mathbf{else}:\\
\;\;\;\;0 - \frac{v}{t1 + u}\\
\end{array}
\end{array}
if t1 < -8.2000000000000004e-165Initial program 70.7%
Taylor expanded in t1 around inf
Simplified61.5%
associate-/r*N/A
associate-/l*N/A
distribute-lft-neg-inN/A
clear-numN/A
div-invN/A
distribute-frac-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6482.8%
Applied egg-rr82.8%
if -8.2000000000000004e-165 < t1 < 9.5000000000000005e65Initial program 82.2%
Taylor expanded in t1 around 0
associate-*r/N/A
unpow2N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f6479.9%
Simplified79.9%
sub0-negN/A
distribute-frac-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f64N/A
/-lowering-/.f6482.9%
Applied egg-rr82.9%
clear-numN/A
associate-/r*N/A
clear-numN/A
distribute-frac-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6485.8%
Applied egg-rr85.8%
if 9.5000000000000005e65 < t1 Initial program 71.3%
*-commutativeN/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
frac-2negN/A
remove-double-negN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
+-lowering-+.f6499.9%
Applied egg-rr99.9%
clear-numN/A
associate-/r/N/A
clear-numN/A
sub0-negN/A
distribute-frac-neg2N/A
distribute-lft-neg-outN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64100.0%
Applied egg-rr100.0%
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64100.0%
Applied egg-rr100.0%
Taylor expanded in t1 around inf
Simplified87.2%
Final simplification84.7%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (- 0.0 (/ v (+ t1 u)))))
(if (<= t1 -4.3e-138)
t_1
(if (<= t1 9.5e+65) (/ (- 0.0 (/ t1 u)) (/ u v)) t_1))))
double code(double u, double v, double t1) {
double t_1 = 0.0 - (v / (t1 + u));
double tmp;
if (t1 <= -4.3e-138) {
tmp = t_1;
} else if (t1 <= 9.5e+65) {
tmp = (0.0 - (t1 / u)) / (u / v);
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = 0.0d0 - (v / (t1 + u))
if (t1 <= (-4.3d-138)) then
tmp = t_1
else if (t1 <= 9.5d+65) then
tmp = (0.0d0 - (t1 / u)) / (u / v)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = 0.0 - (v / (t1 + u));
double tmp;
if (t1 <= -4.3e-138) {
tmp = t_1;
} else if (t1 <= 9.5e+65) {
tmp = (0.0 - (t1 / u)) / (u / v);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = 0.0 - (v / (t1 + u)) tmp = 0 if t1 <= -4.3e-138: tmp = t_1 elif t1 <= 9.5e+65: tmp = (0.0 - (t1 / u)) / (u / v) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(0.0 - Float64(v / Float64(t1 + u))) tmp = 0.0 if (t1 <= -4.3e-138) tmp = t_1; elseif (t1 <= 9.5e+65) tmp = Float64(Float64(0.0 - Float64(t1 / u)) / Float64(u / v)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = 0.0 - (v / (t1 + u)); tmp = 0.0; if (t1 <= -4.3e-138) tmp = t_1; elseif (t1 <= 9.5e+65) tmp = (0.0 - (t1 / u)) / (u / v); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(0.0 - N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -4.3e-138], t$95$1, If[LessEqual[t1, 9.5e+65], N[(N[(0.0 - N[(t1 / u), $MachinePrecision]), $MachinePrecision] / N[(u / v), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0 - \frac{v}{t1 + u}\\
\mathbf{if}\;t1 \leq -4.3 \cdot 10^{-138}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 9.5 \cdot 10^{+65}:\\
\;\;\;\;\frac{0 - \frac{t1}{u}}{\frac{u}{v}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -4.3e-138 or 9.5000000000000005e65 < t1 Initial program 70.9%
*-commutativeN/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
frac-2negN/A
remove-double-negN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
+-lowering-+.f6499.3%
Applied egg-rr99.3%
clear-numN/A
associate-/r/N/A
clear-numN/A
sub0-negN/A
distribute-frac-neg2N/A
distribute-lft-neg-outN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6499.4%
Applied egg-rr99.4%
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.7%
Applied egg-rr99.7%
Taylor expanded in t1 around inf
Simplified83.7%
if -4.3e-138 < t1 < 9.5000000000000005e65Initial program 81.6%
Taylor expanded in t1 around 0
associate-*r/N/A
unpow2N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f6479.0%
Simplified79.0%
sub0-negN/A
distribute-frac-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f64N/A
/-lowering-/.f6481.9%
Applied egg-rr81.9%
clear-numN/A
associate-/r*N/A
clear-numN/A
distribute-frac-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6484.6%
Applied egg-rr84.6%
Final simplification84.1%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (- 0.0 (/ v (+ t1 u)))))
(if (<= t1 -3.8e-138)
t_1
(if (<= t1 9.5e+65) (- 0.0 (/ v (/ u (/ t1 u)))) t_1))))
double code(double u, double v, double t1) {
double t_1 = 0.0 - (v / (t1 + u));
double tmp;
if (t1 <= -3.8e-138) {
tmp = t_1;
} else if (t1 <= 9.5e+65) {
tmp = 0.0 - (v / (u / (t1 / u)));
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = 0.0d0 - (v / (t1 + u))
if (t1 <= (-3.8d-138)) then
tmp = t_1
else if (t1 <= 9.5d+65) then
tmp = 0.0d0 - (v / (u / (t1 / u)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = 0.0 - (v / (t1 + u));
double tmp;
if (t1 <= -3.8e-138) {
tmp = t_1;
} else if (t1 <= 9.5e+65) {
tmp = 0.0 - (v / (u / (t1 / u)));
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = 0.0 - (v / (t1 + u)) tmp = 0 if t1 <= -3.8e-138: tmp = t_1 elif t1 <= 9.5e+65: tmp = 0.0 - (v / (u / (t1 / u))) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(0.0 - Float64(v / Float64(t1 + u))) tmp = 0.0 if (t1 <= -3.8e-138) tmp = t_1; elseif (t1 <= 9.5e+65) tmp = Float64(0.0 - Float64(v / Float64(u / Float64(t1 / u)))); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = 0.0 - (v / (t1 + u)); tmp = 0.0; if (t1 <= -3.8e-138) tmp = t_1; elseif (t1 <= 9.5e+65) tmp = 0.0 - (v / (u / (t1 / u))); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(0.0 - N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -3.8e-138], t$95$1, If[LessEqual[t1, 9.5e+65], N[(0.0 - N[(v / N[(u / N[(t1 / u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0 - \frac{v}{t1 + u}\\
\mathbf{if}\;t1 \leq -3.8 \cdot 10^{-138}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 9.5 \cdot 10^{+65}:\\
\;\;\;\;0 - \frac{v}{\frac{u}{\frac{t1}{u}}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -3.8000000000000002e-138 or 9.5000000000000005e65 < t1 Initial program 70.9%
*-commutativeN/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
frac-2negN/A
remove-double-negN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
+-lowering-+.f6499.3%
Applied egg-rr99.3%
clear-numN/A
associate-/r/N/A
clear-numN/A
sub0-negN/A
distribute-frac-neg2N/A
distribute-lft-neg-outN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6499.4%
Applied egg-rr99.4%
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.7%
Applied egg-rr99.7%
Taylor expanded in t1 around inf
Simplified83.7%
if -3.8000000000000002e-138 < t1 < 9.5000000000000005e65Initial program 81.6%
Taylor expanded in t1 around 0
associate-*r/N/A
unpow2N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f6479.0%
Simplified79.0%
sub0-negN/A
distribute-frac-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f64N/A
/-lowering-/.f6481.9%
Applied egg-rr81.9%
associate-*l/N/A
distribute-neg-frac2N/A
clear-numN/A
sub0-negN/A
div-invN/A
associate-/l/N/A
frac-2negN/A
distribute-lft-neg-inN/A
sub0-negN/A
distribute-neg-frac2N/A
frac-2negN/A
distribute-frac-negN/A
neg-lowering-neg.f64N/A
frac-2negN/A
distribute-neg-frac2N/A
sub0-negN/A
distribute-lft-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
div-invN/A
sub0-negN/A
Applied egg-rr79.1%
Final simplification81.9%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (* v (/ -1.0 u)))) (if (<= u -1.6e+175) t_1 (if (<= u 2.1e+234) (- 0.0 (/ v t1)) t_1))))
double code(double u, double v, double t1) {
double t_1 = v * (-1.0 / u);
double tmp;
if (u <= -1.6e+175) {
tmp = t_1;
} else if (u <= 2.1e+234) {
tmp = 0.0 - (v / t1);
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = v * ((-1.0d0) / u)
if (u <= (-1.6d+175)) then
tmp = t_1
else if (u <= 2.1d+234) then
tmp = 0.0d0 - (v / t1)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = v * (-1.0 / u);
double tmp;
if (u <= -1.6e+175) {
tmp = t_1;
} else if (u <= 2.1e+234) {
tmp = 0.0 - (v / t1);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = v * (-1.0 / u) tmp = 0 if u <= -1.6e+175: tmp = t_1 elif u <= 2.1e+234: tmp = 0.0 - (v / t1) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(v * Float64(-1.0 / u)) tmp = 0.0 if (u <= -1.6e+175) tmp = t_1; elseif (u <= 2.1e+234) tmp = Float64(0.0 - Float64(v / t1)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = v * (-1.0 / u); tmp = 0.0; if (u <= -1.6e+175) tmp = t_1; elseif (u <= 2.1e+234) tmp = 0.0 - (v / t1); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v * N[(-1.0 / u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -1.6e+175], t$95$1, If[LessEqual[u, 2.1e+234], N[(0.0 - N[(v / t1), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := v \cdot \frac{-1}{u}\\
\mathbf{if}\;u \leq -1.6 \cdot 10^{+175}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 2.1 \cdot 10^{+234}:\\
\;\;\;\;0 - \frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -1.60000000000000011e175 or 2.1e234 < u Initial program 81.5%
*-commutativeN/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
frac-2negN/A
remove-double-negN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
+-lowering-+.f6499.9%
Applied egg-rr99.9%
Taylor expanded in t1 around 0
/-lowering-/.f6493.8%
Simplified93.8%
div-invN/A
associate-/l*N/A
*-lowering-*.f64N/A
div-invN/A
inv-powN/A
inv-powN/A
pow-prod-downN/A
*-commutativeN/A
inv-powN/A
frac-2negN/A
metadata-evalN/A
/-lowering-/.f64N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
distribute-neg-frac2N/A
distribute-frac-negN/A
sub0-negN/A
frac-2negN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6484.5%
Applied egg-rr84.5%
Taylor expanded in u around 0
/-lowering-/.f6459.0%
Simplified59.0%
if -1.60000000000000011e175 < u < 2.1e234Initial program 73.8%
Taylor expanded in t1 around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6462.8%
Simplified62.8%
neg-sub0N/A
neg-lowering-neg.f6462.8%
Applied egg-rr62.8%
Final simplification62.2%
(FPCore (u v t1) :precision binary64 (- 0.0 (/ v (+ t1 u))))
double code(double u, double v, double t1) {
return 0.0 - (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 = 0.0d0 - (v / (t1 + u))
end function
public static double code(double u, double v, double t1) {
return 0.0 - (v / (t1 + u));
}
def code(u, v, t1): return 0.0 - (v / (t1 + u))
function code(u, v, t1) return Float64(0.0 - Float64(v / Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = 0.0 - (v / (t1 + u)); end
code[u_, v_, t1_] := N[(0.0 - N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0 - \frac{v}{t1 + u}
\end{array}
Initial program 75.0%
*-commutativeN/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
frac-2negN/A
remove-double-negN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
+-lowering-+.f6498.0%
Applied egg-rr98.0%
clear-numN/A
associate-/r/N/A
clear-numN/A
sub0-negN/A
distribute-frac-neg2N/A
distribute-lft-neg-outN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6498.1%
Applied egg-rr98.1%
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6497.8%
Applied egg-rr97.8%
Taylor expanded in t1 around inf
Simplified64.5%
Final simplification64.5%
(FPCore (u v t1) :precision binary64 (- 0.0 (/ v t1)))
double code(double u, double v, double t1) {
return 0.0 - (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 = 0.0d0 - (v / t1)
end function
public static double code(double u, double v, double t1) {
return 0.0 - (v / t1);
}
def code(u, v, t1): return 0.0 - (v / t1)
function code(u, v, t1) return Float64(0.0 - Float64(v / t1)) end
function tmp = code(u, v, t1) tmp = 0.0 - (v / t1); end
code[u_, v_, t1_] := N[(0.0 - N[(v / t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0 - \frac{v}{t1}
\end{array}
Initial program 75.0%
Taylor expanded in t1 around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6456.0%
Simplified56.0%
neg-sub0N/A
neg-lowering-neg.f6456.0%
Applied egg-rr56.0%
Final simplification56.0%
herbie shell --seed 2024161
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))