
(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 10 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 74.6%
*-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-+.f6499.1%
Applied egg-rr99.1%
sub0-negN/A
neg-lowering-neg.f6499.1%
Applied egg-rr99.1%
Final simplification99.1%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ v (- (* u -2.0) t1))))
(if (<= t1 -1.8e+128)
t_1
(if (<= t1 -2.55e-135)
(* t1 (/ v (* (+ t1 u) (- (- 0.0 t1) u))))
(if (<= t1 1.4e+69) (* (/ v u) (/ (- 0.0 t1) u)) t_1)))))
double code(double u, double v, double t1) {
double t_1 = v / ((u * -2.0) - t1);
double tmp;
if (t1 <= -1.8e+128) {
tmp = t_1;
} else if (t1 <= -2.55e-135) {
tmp = t1 * (v / ((t1 + u) * ((0.0 - t1) - u)));
} else if (t1 <= 1.4e+69) {
tmp = (v / u) * ((0.0 - 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 = v / ((u * (-2.0d0)) - t1)
if (t1 <= (-1.8d+128)) then
tmp = t_1
else if (t1 <= (-2.55d-135)) then
tmp = t1 * (v / ((t1 + u) * ((0.0d0 - t1) - u)))
else if (t1 <= 1.4d+69) then
tmp = (v / u) * ((0.0d0 - 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 = v / ((u * -2.0) - t1);
double tmp;
if (t1 <= -1.8e+128) {
tmp = t_1;
} else if (t1 <= -2.55e-135) {
tmp = t1 * (v / ((t1 + u) * ((0.0 - t1) - u)));
} else if (t1 <= 1.4e+69) {
tmp = (v / u) * ((0.0 - t1) / u);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = v / ((u * -2.0) - t1) tmp = 0 if t1 <= -1.8e+128: tmp = t_1 elif t1 <= -2.55e-135: tmp = t1 * (v / ((t1 + u) * ((0.0 - t1) - u))) elif t1 <= 1.4e+69: tmp = (v / u) * ((0.0 - t1) / u) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(v / Float64(Float64(u * -2.0) - t1)) tmp = 0.0 if (t1 <= -1.8e+128) tmp = t_1; elseif (t1 <= -2.55e-135) tmp = Float64(t1 * Float64(v / Float64(Float64(t1 + u) * Float64(Float64(0.0 - t1) - u)))); elseif (t1 <= 1.4e+69) tmp = Float64(Float64(v / u) * Float64(Float64(0.0 - t1) / u)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = v / ((u * -2.0) - t1); tmp = 0.0; if (t1 <= -1.8e+128) tmp = t_1; elseif (t1 <= -2.55e-135) tmp = t1 * (v / ((t1 + u) * ((0.0 - t1) - u))); elseif (t1 <= 1.4e+69) tmp = (v / u) * ((0.0 - t1) / u); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -1.8e+128], t$95$1, If[LessEqual[t1, -2.55e-135], N[(t1 * N[(v / N[(N[(t1 + u), $MachinePrecision] * N[(N[(0.0 - t1), $MachinePrecision] - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 1.4e+69], N[(N[(v / u), $MachinePrecision] * N[(N[(0.0 - t1), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{v}{u \cdot -2 - t1}\\
\mathbf{if}\;t1 \leq -1.8 \cdot 10^{+128}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq -2.55 \cdot 10^{-135}:\\
\;\;\;\;t1 \cdot \frac{v}{\left(t1 + u\right) \cdot \left(\left(0 - t1\right) - u\right)}\\
\mathbf{elif}\;t1 \leq 1.4 \cdot 10^{+69}:\\
\;\;\;\;\frac{v}{u} \cdot \frac{0 - t1}{u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -1.80000000000000014e128 or 1.39999999999999991e69 < t1 Initial program 55.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-+.f64100.0%
Applied egg-rr100.0%
clear-numN/A
frac-timesN/A
frac-2negN/A
*-rgt-identityN/A
sub0-negN/A
remove-double-negN/A
/-lowering-/.f64N/A
neg-lowering-neg.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6496.6%
Applied egg-rr96.6%
Taylor expanded in u around 0
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6488.2%
Simplified88.2%
if -1.80000000000000014e128 < t1 < -2.5500000000000001e-135Initial program 88.1%
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-+.f6490.1%
Applied egg-rr90.1%
if -2.5500000000000001e-135 < t1 < 1.39999999999999991e69Initial program 82.5%
Taylor expanded in t1 around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6473.8%
Simplified73.8%
sub0-negN/A
neg-lowering-neg.f64N/A
*-commutativeN/A
associate-*l/N/A
remove-double-negN/A
distribute-lft-neg-outN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
remove-double-negN/A
*-lowering-*.f6480.7%
Applied egg-rr80.7%
associate-/l/N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6483.2%
Applied egg-rr83.2%
Final simplification86.2%
(FPCore (u v t1) :precision binary64 (if (<= u -3.5e-76) (- 0.0 (/ (/ t1 (+ t1 u)) (/ u v))) (if (<= u 9e-51) (- 0.0 (/ v t1)) (- 0.0 (/ t1 (/ u (/ v u)))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -3.5e-76) {
tmp = 0.0 - ((t1 / (t1 + u)) / (u / v));
} else if (u <= 9e-51) {
tmp = 0.0 - (v / t1);
} else {
tmp = 0.0 - (t1 / (u / (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 <= (-3.5d-76)) then
tmp = 0.0d0 - ((t1 / (t1 + u)) / (u / v))
else if (u <= 9d-51) then
tmp = 0.0d0 - (v / t1)
else
tmp = 0.0d0 - (t1 / (u / (v / u)))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -3.5e-76) {
tmp = 0.0 - ((t1 / (t1 + u)) / (u / v));
} else if (u <= 9e-51) {
tmp = 0.0 - (v / t1);
} else {
tmp = 0.0 - (t1 / (u / (v / u)));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -3.5e-76: tmp = 0.0 - ((t1 / (t1 + u)) / (u / v)) elif u <= 9e-51: tmp = 0.0 - (v / t1) else: tmp = 0.0 - (t1 / (u / (v / u))) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -3.5e-76) tmp = Float64(0.0 - Float64(Float64(t1 / Float64(t1 + u)) / Float64(u / v))); elseif (u <= 9e-51) tmp = Float64(0.0 - Float64(v / t1)); else tmp = Float64(0.0 - Float64(t1 / Float64(u / Float64(v / u)))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -3.5e-76) tmp = 0.0 - ((t1 / (t1 + u)) / (u / v)); elseif (u <= 9e-51) tmp = 0.0 - (v / t1); else tmp = 0.0 - (t1 / (u / (v / u))); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -3.5e-76], N[(0.0 - N[(N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 9e-51], N[(0.0 - N[(v / t1), $MachinePrecision]), $MachinePrecision], N[(0.0 - N[(t1 / N[(u / N[(v / u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.5 \cdot 10^{-76}:\\
\;\;\;\;0 - \frac{\frac{t1}{t1 + u}}{\frac{u}{v}}\\
\mathbf{elif}\;u \leq 9 \cdot 10^{-51}:\\
\;\;\;\;0 - \frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;0 - \frac{t1}{\frac{u}{\frac{v}{u}}}\\
\end{array}
\end{array}
if u < -3.49999999999999997e-76Initial program 77.4%
Taylor expanded in t1 around 0
Simplified71.0%
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-/.f6479.4%
Applied egg-rr79.4%
if -3.49999999999999997e-76 < u < 8.99999999999999948e-51Initial program 62.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--.f6484.2%
Simplified84.2%
neg-sub0N/A
neg-lowering-neg.f6484.2%
Applied egg-rr84.2%
if 8.99999999999999948e-51 < u Initial program 83.8%
Taylor expanded in t1 around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6473.5%
Simplified73.5%
sub0-negN/A
neg-lowering-neg.f64N/A
*-commutativeN/A
associate-*l/N/A
remove-double-negN/A
distribute-lft-neg-outN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
remove-double-negN/A
*-lowering-*.f6477.9%
Applied egg-rr77.9%
associate-/l/N/A
*-commutativeN/A
associate-/l*N/A
associate-/l/N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6482.8%
Applied egg-rr82.8%
Final simplification82.1%
(FPCore (u v t1) :precision binary64 (if (<= u -2.9e-75) (/ (/ t1 u) (/ u (- 0.0 v))) (if (<= u 2.05e-51) (- 0.0 (/ v t1)) (- 0.0 (/ t1 (/ u (/ v u)))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -2.9e-75) {
tmp = (t1 / u) / (u / (0.0 - v));
} else if (u <= 2.05e-51) {
tmp = 0.0 - (v / t1);
} else {
tmp = 0.0 - (t1 / (u / (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 <= (-2.9d-75)) then
tmp = (t1 / u) / (u / (0.0d0 - v))
else if (u <= 2.05d-51) then
tmp = 0.0d0 - (v / t1)
else
tmp = 0.0d0 - (t1 / (u / (v / u)))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -2.9e-75) {
tmp = (t1 / u) / (u / (0.0 - v));
} else if (u <= 2.05e-51) {
tmp = 0.0 - (v / t1);
} else {
tmp = 0.0 - (t1 / (u / (v / u)));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -2.9e-75: tmp = (t1 / u) / (u / (0.0 - v)) elif u <= 2.05e-51: tmp = 0.0 - (v / t1) else: tmp = 0.0 - (t1 / (u / (v / u))) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -2.9e-75) tmp = Float64(Float64(t1 / u) / Float64(u / Float64(0.0 - v))); elseif (u <= 2.05e-51) tmp = Float64(0.0 - Float64(v / t1)); else tmp = Float64(0.0 - Float64(t1 / Float64(u / Float64(v / u)))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -2.9e-75) tmp = (t1 / u) / (u / (0.0 - v)); elseif (u <= 2.05e-51) tmp = 0.0 - (v / t1); else tmp = 0.0 - (t1 / (u / (v / u))); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -2.9e-75], N[(N[(t1 / u), $MachinePrecision] / N[(u / N[(0.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 2.05e-51], N[(0.0 - N[(v / t1), $MachinePrecision]), $MachinePrecision], N[(0.0 - N[(t1 / N[(u / N[(v / u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.9 \cdot 10^{-75}:\\
\;\;\;\;\frac{\frac{t1}{u}}{\frac{u}{0 - v}}\\
\mathbf{elif}\;u \leq 2.05 \cdot 10^{-51}:\\
\;\;\;\;0 - \frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;0 - \frac{t1}{\frac{u}{\frac{v}{u}}}\\
\end{array}
\end{array}
if u < -2.9000000000000002e-75Initial program 77.4%
Taylor expanded in t1 around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6467.1%
Simplified67.1%
sub0-negN/A
neg-lowering-neg.f64N/A
*-commutativeN/A
associate-*l/N/A
remove-double-negN/A
distribute-lft-neg-outN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
remove-double-negN/A
*-lowering-*.f6474.9%
Applied egg-rr74.9%
clear-numN/A
associate-/l*N/A
associate-/r*N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6479.4%
Applied egg-rr79.4%
if -2.9000000000000002e-75 < u < 2.04999999999999987e-51Initial program 62.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--.f6484.2%
Simplified84.2%
neg-sub0N/A
neg-lowering-neg.f6484.2%
Applied egg-rr84.2%
if 2.04999999999999987e-51 < u Initial program 83.8%
Taylor expanded in t1 around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6473.5%
Simplified73.5%
sub0-negN/A
neg-lowering-neg.f64N/A
*-commutativeN/A
associate-*l/N/A
remove-double-negN/A
distribute-lft-neg-outN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
remove-double-negN/A
*-lowering-*.f6477.9%
Applied egg-rr77.9%
associate-/l/N/A
*-commutativeN/A
associate-/l*N/A
associate-/l/N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6482.8%
Applied egg-rr82.8%
Final simplification82.1%
(FPCore (u v t1) :precision binary64 (if (<= u -2.95e-75) (* (/ v u) (/ (- 0.0 t1) u)) (if (<= u 3.3e-51) (- 0.0 (/ v t1)) (- 0.0 (/ t1 (/ u (/ v u)))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -2.95e-75) {
tmp = (v / u) * ((0.0 - t1) / u);
} else if (u <= 3.3e-51) {
tmp = 0.0 - (v / t1);
} else {
tmp = 0.0 - (t1 / (u / (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 <= (-2.95d-75)) then
tmp = (v / u) * ((0.0d0 - t1) / u)
else if (u <= 3.3d-51) then
tmp = 0.0d0 - (v / t1)
else
tmp = 0.0d0 - (t1 / (u / (v / u)))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -2.95e-75) {
tmp = (v / u) * ((0.0 - t1) / u);
} else if (u <= 3.3e-51) {
tmp = 0.0 - (v / t1);
} else {
tmp = 0.0 - (t1 / (u / (v / u)));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -2.95e-75: tmp = (v / u) * ((0.0 - t1) / u) elif u <= 3.3e-51: tmp = 0.0 - (v / t1) else: tmp = 0.0 - (t1 / (u / (v / u))) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -2.95e-75) tmp = Float64(Float64(v / u) * Float64(Float64(0.0 - t1) / u)); elseif (u <= 3.3e-51) tmp = Float64(0.0 - Float64(v / t1)); else tmp = Float64(0.0 - Float64(t1 / Float64(u / Float64(v / u)))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -2.95e-75) tmp = (v / u) * ((0.0 - t1) / u); elseif (u <= 3.3e-51) tmp = 0.0 - (v / t1); else tmp = 0.0 - (t1 / (u / (v / u))); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -2.95e-75], N[(N[(v / u), $MachinePrecision] * N[(N[(0.0 - t1), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 3.3e-51], N[(0.0 - N[(v / t1), $MachinePrecision]), $MachinePrecision], N[(0.0 - N[(t1 / N[(u / N[(v / u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.95 \cdot 10^{-75}:\\
\;\;\;\;\frac{v}{u} \cdot \frac{0 - t1}{u}\\
\mathbf{elif}\;u \leq 3.3 \cdot 10^{-51}:\\
\;\;\;\;0 - \frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;0 - \frac{t1}{\frac{u}{\frac{v}{u}}}\\
\end{array}
\end{array}
if u < -2.95e-75Initial program 77.4%
Taylor expanded in t1 around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6467.1%
Simplified67.1%
sub0-negN/A
neg-lowering-neg.f64N/A
*-commutativeN/A
associate-*l/N/A
remove-double-negN/A
distribute-lft-neg-outN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
remove-double-negN/A
*-lowering-*.f6474.9%
Applied egg-rr74.9%
associate-/l/N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6478.3%
Applied egg-rr78.3%
if -2.95e-75 < u < 3.29999999999999973e-51Initial program 62.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--.f6484.2%
Simplified84.2%
neg-sub0N/A
neg-lowering-neg.f6484.2%
Applied egg-rr84.2%
if 3.29999999999999973e-51 < u Initial program 83.8%
Taylor expanded in t1 around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6473.5%
Simplified73.5%
sub0-negN/A
neg-lowering-neg.f64N/A
*-commutativeN/A
associate-*l/N/A
remove-double-negN/A
distribute-lft-neg-outN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
remove-double-negN/A
*-lowering-*.f6477.9%
Applied egg-rr77.9%
associate-/l/N/A
*-commutativeN/A
associate-/l*N/A
associate-/l/N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6482.8%
Applied egg-rr82.8%
Final simplification81.7%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (* (/ v u) (/ (- 0.0 t1) u)))) (if (<= u -3.6e-75) t_1 (if (<= u 5.6e-78) (- 0.0 (/ v t1)) t_1))))
double code(double u, double v, double t1) {
double t_1 = (v / u) * ((0.0 - t1) / u);
double tmp;
if (u <= -3.6e-75) {
tmp = t_1;
} else if (u <= 5.6e-78) {
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 / u) * ((0.0d0 - t1) / u)
if (u <= (-3.6d-75)) then
tmp = t_1
else if (u <= 5.6d-78) 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 / u) * ((0.0 - t1) / u);
double tmp;
if (u <= -3.6e-75) {
tmp = t_1;
} else if (u <= 5.6e-78) {
tmp = 0.0 - (v / t1);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = (v / u) * ((0.0 - t1) / u) tmp = 0 if u <= -3.6e-75: tmp = t_1 elif u <= 5.6e-78: tmp = 0.0 - (v / t1) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(v / u) * Float64(Float64(0.0 - t1) / u)) tmp = 0.0 if (u <= -3.6e-75) tmp = t_1; elseif (u <= 5.6e-78) 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 / u) * ((0.0 - t1) / u); tmp = 0.0; if (u <= -3.6e-75) tmp = t_1; elseif (u <= 5.6e-78) tmp = 0.0 - (v / t1); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(v / u), $MachinePrecision] * N[(N[(0.0 - t1), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -3.6e-75], t$95$1, If[LessEqual[u, 5.6e-78], N[(0.0 - N[(v / t1), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{v}{u} \cdot \frac{0 - t1}{u}\\
\mathbf{if}\;u \leq -3.6 \cdot 10^{-75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 5.6 \cdot 10^{-78}:\\
\;\;\;\;0 - \frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -3.6e-75 or 5.60000000000000047e-78 < u Initial program 80.2%
Taylor expanded in t1 around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6470.0%
Simplified70.0%
sub0-negN/A
neg-lowering-neg.f64N/A
*-commutativeN/A
associate-*l/N/A
remove-double-negN/A
distribute-lft-neg-outN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
remove-double-negN/A
*-lowering-*.f6476.2%
Applied egg-rr76.2%
associate-/l/N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6479.6%
Applied egg-rr79.6%
if -3.6e-75 < u < 5.60000000000000047e-78Initial program 62.3%
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--.f6486.0%
Simplified86.0%
neg-sub0N/A
neg-lowering-neg.f6486.0%
Applied egg-rr86.0%
Final simplification81.6%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (- 0.0 (/ v u)))) (if (<= u -1.42e+156) t_1 (if (<= u 1.5e+136) (- 0.0 (/ v t1)) t_1))))
double code(double u, double v, double t1) {
double t_1 = 0.0 - (v / u);
double tmp;
if (u <= -1.42e+156) {
tmp = t_1;
} else if (u <= 1.5e+136) {
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 = 0.0d0 - (v / u)
if (u <= (-1.42d+156)) then
tmp = t_1
else if (u <= 1.5d+136) 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 = 0.0 - (v / u);
double tmp;
if (u <= -1.42e+156) {
tmp = t_1;
} else if (u <= 1.5e+136) {
tmp = 0.0 - (v / t1);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = 0.0 - (v / u) tmp = 0 if u <= -1.42e+156: tmp = t_1 elif u <= 1.5e+136: tmp = 0.0 - (v / t1) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(0.0 - Float64(v / u)) tmp = 0.0 if (u <= -1.42e+156) tmp = t_1; elseif (u <= 1.5e+136) tmp = Float64(0.0 - Float64(v / t1)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = 0.0 - (v / u); tmp = 0.0; if (u <= -1.42e+156) tmp = t_1; elseif (u <= 1.5e+136) tmp = 0.0 - (v / t1); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(0.0 - N[(v / u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -1.42e+156], t$95$1, If[LessEqual[u, 1.5e+136], N[(0.0 - N[(v / t1), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0 - \frac{v}{u}\\
\mathbf{if}\;u \leq -1.42 \cdot 10^{+156}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 1.5 \cdot 10^{+136}:\\
\;\;\;\;0 - \frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -1.41999999999999998e156 or 1.49999999999999989e136 < u Initial program 76.7%
Taylor expanded in t1 around 0
Simplified76.7%
Taylor expanded in t1 around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f6441.6%
Simplified41.6%
if -1.41999999999999998e156 < u < 1.49999999999999989e136Initial program 73.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--.f6460.8%
Simplified60.8%
neg-sub0N/A
neg-lowering-neg.f6460.8%
Applied egg-rr60.8%
Final simplification54.3%
(FPCore (u v t1) :precision binary64 (/ v (- (* u -2.0) t1)))
double code(double u, double v, double t1) {
return v / ((u * -2.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 / ((u * (-2.0d0)) - t1)
end function
public static double code(double u, double v, double t1) {
return v / ((u * -2.0) - t1);
}
def code(u, v, t1): return v / ((u * -2.0) - t1)
function code(u, v, t1) return Float64(v / Float64(Float64(u * -2.0) - t1)) end
function tmp = code(u, v, t1) tmp = v / ((u * -2.0) - t1); end
code[u_, v_, t1_] := N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{u \cdot -2 - t1}
\end{array}
Initial program 74.6%
*-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-+.f6499.1%
Applied egg-rr99.1%
clear-numN/A
frac-timesN/A
frac-2negN/A
*-rgt-identityN/A
sub0-negN/A
remove-double-negN/A
/-lowering-/.f64N/A
neg-lowering-neg.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6495.5%
Applied egg-rr95.5%
Taylor expanded in u around 0
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6456.6%
Simplified56.6%
(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 74.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-+.f6471.8%
Applied egg-rr71.8%
Taylor expanded in t1 around inf
Simplified42.0%
Taylor expanded in v around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6456.4%
Simplified56.4%
sub0-negN/A
neg-lowering-neg.f64N/A
+-commutativeN/A
/-lowering-/.f64N/A
+-lowering-+.f6456.4%
Applied egg-rr56.4%
Final simplification56.4%
(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 74.6%
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--.f6447.0%
Simplified47.0%
neg-sub0N/A
neg-lowering-neg.f6447.0%
Applied egg-rr47.0%
Final simplification47.0%
herbie shell --seed 2024155
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))