
(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 12 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)) (/ (+ t1 u) (- 0.0 v))))
double code(double u, double v, double t1) {
return (t1 / (t1 + u)) / ((t1 + u) / (0.0 - v));
}
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)) / ((t1 + u) / (0.0d0 - v))
end function
public static double code(double u, double v, double t1) {
return (t1 / (t1 + u)) / ((t1 + u) / (0.0 - v));
}
def code(u, v, t1): return (t1 / (t1 + u)) / ((t1 + u) / (0.0 - v))
function code(u, v, t1) return Float64(Float64(t1 / Float64(t1 + u)) / Float64(Float64(t1 + u) / Float64(0.0 - v))) end
function tmp = code(u, v, t1) tmp = (t1 / (t1 + u)) / ((t1 + u) / (0.0 - v)); end
code[u_, v_, t1_] := N[(N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] / N[(0.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{t1}{t1 + u}}{\frac{t1 + u}{0 - v}}
\end{array}
Initial program 62.4%
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
distribute-frac-negN/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6497.7%
Applied egg-rr97.7%
sub0-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6497.7%
Applied egg-rr97.7%
Final simplification97.7%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (* (/ -1.0 u) (* t1 (/ v (+ t1 u)))))) (if (<= u -3.6e-11) t_1 (if (<= u 4.3e-7) (/ v (- 0.0 t1)) t_1))))
double code(double u, double v, double t1) {
double t_1 = (-1.0 / u) * (t1 * (v / (t1 + u)));
double tmp;
if (u <= -3.6e-11) {
tmp = t_1;
} else if (u <= 4.3e-7) {
tmp = v / (0.0 - 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 = ((-1.0d0) / u) * (t1 * (v / (t1 + u)))
if (u <= (-3.6d-11)) then
tmp = t_1
else if (u <= 4.3d-7) then
tmp = v / (0.0d0 - t1)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = (-1.0 / u) * (t1 * (v / (t1 + u)));
double tmp;
if (u <= -3.6e-11) {
tmp = t_1;
} else if (u <= 4.3e-7) {
tmp = v / (0.0 - t1);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = (-1.0 / u) * (t1 * (v / (t1 + u))) tmp = 0 if u <= -3.6e-11: tmp = t_1 elif u <= 4.3e-7: tmp = v / (0.0 - t1) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-1.0 / u) * Float64(t1 * Float64(v / Float64(t1 + u)))) tmp = 0.0 if (u <= -3.6e-11) tmp = t_1; elseif (u <= 4.3e-7) tmp = Float64(v / Float64(0.0 - t1)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = (-1.0 / u) * (t1 * (v / (t1 + u))); tmp = 0.0; if (u <= -3.6e-11) tmp = t_1; elseif (u <= 4.3e-7) tmp = v / (0.0 - t1); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(-1.0 / u), $MachinePrecision] * N[(t1 * N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -3.6e-11], t$95$1, If[LessEqual[u, 4.3e-7], N[(v / N[(0.0 - t1), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-1}{u} \cdot \left(t1 \cdot \frac{v}{t1 + u}\right)\\
\mathbf{if}\;u \leq -3.6 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 4.3 \cdot 10^{-7}:\\
\;\;\;\;\frac{v}{0 - t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -3.59999999999999985e-11 or 4.3000000000000001e-7 < u Initial program 71.5%
remove-double-negN/A
neg-mul-1N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
distribute-lft-neg-outN/A
remove-double-negN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6499.8%
Applied egg-rr99.8%
Taylor expanded in t1 around 0
Simplified82.3%
if -3.59999999999999985e-11 < u < 4.3000000000000001e-7Initial program 54.5%
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--.f6479.6%
Simplified79.6%
sub0-negN/A
neg-lowering-neg.f6479.6%
Applied egg-rr79.6%
Final simplification80.9%
(FPCore (u v t1) :precision binary64 (if (<= u -1.26e-11) (- 0.0 (/ (/ t1 (/ u v)) u)) (if (<= u 5e-8) (/ v (- 0.0 t1)) (* (/ -1.0 u) (* t1 (/ v u))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -1.26e-11) {
tmp = 0.0 - ((t1 / (u / v)) / u);
} else if (u <= 5e-8) {
tmp = v / (0.0 - t1);
} else {
tmp = (-1.0 / u) * (t1 * (v / 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 (u <= (-1.26d-11)) then
tmp = 0.0d0 - ((t1 / (u / v)) / u)
else if (u <= 5d-8) then
tmp = v / (0.0d0 - t1)
else
tmp = ((-1.0d0) / u) * (t1 * (v / u))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -1.26e-11) {
tmp = 0.0 - ((t1 / (u / v)) / u);
} else if (u <= 5e-8) {
tmp = v / (0.0 - t1);
} else {
tmp = (-1.0 / u) * (t1 * (v / u));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -1.26e-11: tmp = 0.0 - ((t1 / (u / v)) / u) elif u <= 5e-8: tmp = v / (0.0 - t1) else: tmp = (-1.0 / u) * (t1 * (v / u)) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -1.26e-11) tmp = Float64(0.0 - Float64(Float64(t1 / Float64(u / v)) / u)); elseif (u <= 5e-8) tmp = Float64(v / Float64(0.0 - t1)); else tmp = Float64(Float64(-1.0 / u) * Float64(t1 * Float64(v / u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -1.26e-11) tmp = 0.0 - ((t1 / (u / v)) / u); elseif (u <= 5e-8) tmp = v / (0.0 - t1); else tmp = (-1.0 / u) * (t1 * (v / u)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -1.26e-11], N[(0.0 - N[(N[(t1 / N[(u / v), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 5e-8], N[(v / N[(0.0 - t1), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / u), $MachinePrecision] * N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.26 \cdot 10^{-11}:\\
\;\;\;\;0 - \frac{\frac{t1}{\frac{u}{v}}}{u}\\
\mathbf{elif}\;u \leq 5 \cdot 10^{-8}:\\
\;\;\;\;\frac{v}{0 - t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{u} \cdot \left(t1 \cdot \frac{v}{u}\right)\\
\end{array}
\end{array}
if u < -1.26e-11Initial program 80.4%
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-*.f6477.9%
Simplified77.9%
sub0-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f6477.9%
Applied egg-rr77.9%
distribute-frac-negN/A
neg-lowering-neg.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6481.9%
Applied egg-rr81.9%
if -1.26e-11 < u < 4.9999999999999998e-8Initial program 54.5%
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--.f6479.6%
Simplified79.6%
sub0-negN/A
neg-lowering-neg.f6479.6%
Applied egg-rr79.6%
if 4.9999999999999998e-8 < u Initial program 65.1%
remove-double-negN/A
neg-mul-1N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
distribute-lft-neg-outN/A
remove-double-negN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6499.8%
Applied egg-rr99.8%
Taylor expanded in t1 around 0
Simplified81.4%
Taylor expanded in t1 around 0
Simplified81.4%
Final simplification80.5%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (- 0.0 (/ (/ t1 (/ u v)) u)))) (if (<= u -2.4e-10) t_1 (if (<= u 3.7e-7) (/ v (- 0.0 t1)) t_1))))
double code(double u, double v, double t1) {
double t_1 = 0.0 - ((t1 / (u / v)) / u);
double tmp;
if (u <= -2.4e-10) {
tmp = t_1;
} else if (u <= 3.7e-7) {
tmp = v / (0.0 - 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 = 0.0d0 - ((t1 / (u / v)) / u)
if (u <= (-2.4d-10)) then
tmp = t_1
else if (u <= 3.7d-7) then
tmp = v / (0.0d0 - t1)
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 - ((t1 / (u / v)) / u);
double tmp;
if (u <= -2.4e-10) {
tmp = t_1;
} else if (u <= 3.7e-7) {
tmp = v / (0.0 - t1);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = 0.0 - ((t1 / (u / v)) / u) tmp = 0 if u <= -2.4e-10: tmp = t_1 elif u <= 3.7e-7: tmp = v / (0.0 - t1) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(0.0 - Float64(Float64(t1 / Float64(u / v)) / u)) tmp = 0.0 if (u <= -2.4e-10) tmp = t_1; elseif (u <= 3.7e-7) tmp = Float64(v / Float64(0.0 - t1)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = 0.0 - ((t1 / (u / v)) / u); tmp = 0.0; if (u <= -2.4e-10) tmp = t_1; elseif (u <= 3.7e-7) tmp = v / (0.0 - t1); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(0.0 - N[(N[(t1 / N[(u / v), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -2.4e-10], t$95$1, If[LessEqual[u, 3.7e-7], N[(v / N[(0.0 - t1), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0 - \frac{\frac{t1}{\frac{u}{v}}}{u}\\
\mathbf{if}\;u \leq -2.4 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 3.7 \cdot 10^{-7}:\\
\;\;\;\;\frac{v}{0 - t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -2.4e-10 or 3.70000000000000004e-7 < u Initial program 71.5%
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-*.f6476.5%
Simplified76.5%
sub0-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f6476.5%
Applied egg-rr76.5%
distribute-frac-negN/A
neg-lowering-neg.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6481.6%
Applied egg-rr81.6%
if -2.4e-10 < u < 3.70000000000000004e-7Initial program 54.5%
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--.f6479.6%
Simplified79.6%
sub0-negN/A
neg-lowering-neg.f6479.6%
Applied egg-rr79.6%
Final simplification80.5%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (/ (/ v u) (- 0.0 (/ u t1))))) (if (<= u -1.7e-12) t_1 (if (<= u 2.2e-9) (/ v (- 0.0 t1)) t_1))))
double code(double u, double v, double t1) {
double t_1 = (v / u) / (0.0 - (u / t1));
double tmp;
if (u <= -1.7e-12) {
tmp = t_1;
} else if (u <= 2.2e-9) {
tmp = v / (0.0 - 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 / u) / (0.0d0 - (u / t1))
if (u <= (-1.7d-12)) then
tmp = t_1
else if (u <= 2.2d-9) then
tmp = v / (0.0d0 - 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 / u) / (0.0 - (u / t1));
double tmp;
if (u <= -1.7e-12) {
tmp = t_1;
} else if (u <= 2.2e-9) {
tmp = v / (0.0 - t1);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = (v / u) / (0.0 - (u / t1)) tmp = 0 if u <= -1.7e-12: tmp = t_1 elif u <= 2.2e-9: tmp = v / (0.0 - t1) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(v / u) / Float64(0.0 - Float64(u / t1))) tmp = 0.0 if (u <= -1.7e-12) tmp = t_1; elseif (u <= 2.2e-9) tmp = Float64(v / Float64(0.0 - t1)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = (v / u) / (0.0 - (u / t1)); tmp = 0.0; if (u <= -1.7e-12) tmp = t_1; elseif (u <= 2.2e-9) tmp = v / (0.0 - t1); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(v / u), $MachinePrecision] / N[(0.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -1.7e-12], t$95$1, If[LessEqual[u, 2.2e-9], N[(v / N[(0.0 - t1), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{v}{u}}{0 - \frac{u}{t1}}\\
\mathbf{if}\;u \leq -1.7 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 2.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{v}{0 - t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -1.7e-12 or 2.1999999999999998e-9 < u Initial program 71.5%
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-*.f6476.5%
Simplified76.5%
sub0-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f6476.5%
Applied egg-rr76.5%
associate-/l/N/A
distribute-lft-neg-inN/A
sub0-negN/A
times-fracN/A
*-commutativeN/A
clear-numN/A
div-invN/A
sub0-negN/A
distribute-frac-neg2N/A
distribute-frac-neg2N/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6479.3%
Applied egg-rr79.3%
if -1.7e-12 < u < 2.1999999999999998e-9Initial program 54.5%
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--.f6479.6%
Simplified79.6%
sub0-negN/A
neg-lowering-neg.f6479.6%
Applied egg-rr79.6%
Final simplification79.5%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (- 0.0 (/ v (+ t1 u)))))
(if (<= t1 -5.2e-121)
t_1
(if (<= t1 4.2e+85) (- 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 <= -5.2e-121) {
tmp = t_1;
} else if (t1 <= 4.2e+85) {
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 <= (-5.2d-121)) then
tmp = t_1
else if (t1 <= 4.2d+85) 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 <= -5.2e-121) {
tmp = t_1;
} else if (t1 <= 4.2e+85) {
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 <= -5.2e-121: tmp = t_1 elif t1 <= 4.2e+85: 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 <= -5.2e-121) tmp = t_1; elseif (t1 <= 4.2e+85) 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 <= -5.2e-121) tmp = t_1; elseif (t1 <= 4.2e+85) 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, -5.2e-121], t$95$1, If[LessEqual[t1, 4.2e+85], 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 -5.2 \cdot 10^{-121}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 4.2 \cdot 10^{+85}:\\
\;\;\;\;0 - \frac{v}{\frac{u}{\frac{t1}{u}}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -5.19999999999999972e-121 or 4.2000000000000002e85 < t1 Initial program 51.4%
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
distribute-frac-negN/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6499.6%
Applied egg-rr99.6%
Taylor expanded in t1 around inf
Simplified79.1%
div-invN/A
clear-numN/A
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6479.4%
Applied egg-rr79.4%
if -5.19999999999999972e-121 < t1 < 4.2000000000000002e85Initial program 75.3%
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-*.f6469.4%
Simplified69.4%
frac-2negN/A
distribute-neg-frac2N/A
sub0-negN/A
frac-2negN/A
*-commutativeN/A
associate-/l*N/A
neg-mul-1N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6473.0%
Applied egg-rr73.0%
frac-timesN/A
neg-mul-1N/A
distribute-frac-neg2N/A
associate-*r/N/A
neg-lowering-neg.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6473.0%
Applied egg-rr73.0%
Final simplification76.4%
(FPCore (u v t1) :precision binary64 (/ (- 0.0 v) (/ (+ t1 u) (/ t1 (+ t1 u)))))
double code(double u, double v, double t1) {
return (0.0 - 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 = (0.0d0 - v) / ((t1 + u) / (t1 / (t1 + u)))
end function
public static double code(double u, double v, double t1) {
return (0.0 - v) / ((t1 + u) / (t1 / (t1 + u)));
}
def code(u, v, t1): return (0.0 - v) / ((t1 + u) / (t1 / (t1 + u)))
function code(u, v, t1) return Float64(Float64(0.0 - v) / Float64(Float64(t1 + u) / Float64(t1 / Float64(t1 + u)))) end
function tmp = code(u, v, t1) tmp = (0.0 - v) / ((t1 + u) / (t1 / (t1 + u))); end
code[u_, v_, t1_] := N[(N[(0.0 - v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] / N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0 - v}{\frac{t1 + u}{\frac{t1}{t1 + u}}}
\end{array}
Initial program 62.4%
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
distribute-frac-negN/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6497.7%
Applied egg-rr97.7%
sub0-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6497.7%
Applied egg-rr97.7%
frac-2negN/A
associate-/r/N/A
frac-2negN/A
neg-mul-1N/A
metadata-evalN/A
associate-/r/N/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f6494.1%
Applied egg-rr94.1%
div-invN/A
frac-2negN/A
metadata-evalN/A
remove-double-divN/A
*-commutativeN/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-/.f64N/A
+-lowering-+.f6494.0%
Applied egg-rr94.0%
Final simplification94.0%
(FPCore (u v t1) :precision binary64 (if (<= u -2.4e+164) (/ -1.0 (/ u v)) (/ v (- 0.0 t1))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -2.4e+164) {
tmp = -1.0 / (u / v);
} 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 <= (-2.4d+164)) then
tmp = (-1.0d0) / (u / v)
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 <= -2.4e+164) {
tmp = -1.0 / (u / v);
} else {
tmp = v / (0.0 - t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -2.4e+164: tmp = -1.0 / (u / v) else: tmp = v / (0.0 - t1) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -2.4e+164) tmp = Float64(-1.0 / Float64(u / v)); else tmp = Float64(v / Float64(0.0 - t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -2.4e+164) tmp = -1.0 / (u / v); else tmp = v / (0.0 - t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -2.4e+164], N[(-1.0 / N[(u / v), $MachinePrecision]), $MachinePrecision], N[(v / N[(0.0 - t1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.4 \cdot 10^{+164}:\\
\;\;\;\;\frac{-1}{\frac{u}{v}}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{0 - t1}\\
\end{array}
\end{array}
if u < -2.40000000000000011e164Initial program 78.2%
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
distribute-frac-negN/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6499.8%
Applied egg-rr99.8%
Taylor expanded in t1 around inf
Simplified47.2%
Taylor expanded in t1 around 0
Simplified40.2%
if -2.40000000000000011e164 < u Initial program 60.5%
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--.f6459.5%
Simplified59.5%
sub0-negN/A
neg-lowering-neg.f6459.5%
Applied egg-rr59.5%
Final simplification57.4%
(FPCore (u v t1) :precision binary64 (if (<= u -1.35e+166) (* v (/ -1.0 u)) (/ v (- 0.0 t1))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -1.35e+166) {
tmp = v * (-1.0 / 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 <= (-1.35d+166)) then
tmp = v * ((-1.0d0) / 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 <= -1.35e+166) {
tmp = v * (-1.0 / u);
} else {
tmp = v / (0.0 - t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -1.35e+166: tmp = v * (-1.0 / u) else: tmp = v / (0.0 - t1) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -1.35e+166) tmp = Float64(v * Float64(-1.0 / 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 <= -1.35e+166) tmp = v * (-1.0 / u); else tmp = v / (0.0 - t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -1.35e+166], N[(v * N[(-1.0 / u), $MachinePrecision]), $MachinePrecision], N[(v / N[(0.0 - t1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.35 \cdot 10^{+166}:\\
\;\;\;\;v \cdot \frac{-1}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{0 - t1}\\
\end{array}
\end{array}
if u < -1.35000000000000006e166Initial program 78.2%
remove-double-negN/A
neg-mul-1N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
distribute-lft-neg-outN/A
remove-double-negN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6499.9%
Applied egg-rr99.9%
Taylor expanded in t1 around 0
Simplified92.9%
Taylor expanded in t1 around inf
Simplified38.1%
if -1.35000000000000006e166 < u Initial program 60.5%
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--.f6459.5%
Simplified59.5%
sub0-negN/A
neg-lowering-neg.f6459.5%
Applied egg-rr59.5%
Final simplification57.2%
(FPCore (u v t1) :precision binary64 (/ -1.0 (/ (+ t1 u) v)))
double code(double u, double v, double t1) {
return -1.0 / ((t1 + u) / v);
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-1.0d0) / ((t1 + u) / v)
end function
public static double code(double u, double v, double t1) {
return -1.0 / ((t1 + u) / v);
}
def code(u, v, t1): return -1.0 / ((t1 + u) / v)
function code(u, v, t1) return Float64(-1.0 / Float64(Float64(t1 + u) / v)) end
function tmp = code(u, v, t1) tmp = -1.0 / ((t1 + u) / v); end
code[u_, v_, t1_] := N[(-1.0 / N[(N[(t1 + u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-1}{\frac{t1 + u}{v}}
\end{array}
Initial program 62.4%
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
distribute-frac-negN/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6497.7%
Applied egg-rr97.7%
Taylor expanded in t1 around inf
Simplified61.1%
(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 62.4%
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
distribute-frac-negN/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6497.7%
Applied egg-rr97.7%
Taylor expanded in t1 around inf
Simplified61.1%
div-invN/A
clear-numN/A
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6460.8%
Applied egg-rr60.8%
Final simplification60.8%
(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 62.4%
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--.f6454.8%
Simplified54.8%
sub0-negN/A
neg-lowering-neg.f6454.8%
Applied egg-rr54.8%
Final simplification54.8%
herbie shell --seed 2024163
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))