
(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 (/ (- 0.0 (/ t1 (+ t1 u))) (/ (+ t1 u) v)))
double code(double u, double v, double t1) {
return (0.0 - (t1 / (t1 + u))) / ((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 = (0.0d0 - (t1 / (t1 + u))) / ((t1 + u) / v)
end function
public static double code(double u, double v, double t1) {
return (0.0 - (t1 / (t1 + u))) / ((t1 + u) / v);
}
def code(u, v, t1): return (0.0 - (t1 / (t1 + u))) / ((t1 + u) / v)
function code(u, v, t1) return Float64(Float64(0.0 - Float64(t1 / Float64(t1 + u))) / Float64(Float64(t1 + u) / v)) end
function tmp = code(u, v, t1) tmp = (0.0 - (t1 / (t1 + u))) / ((t1 + u) / v); end
code[u_, v_, t1_] := N[(N[(0.0 - N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0 - \frac{t1}{t1 + u}}{\frac{t1 + u}{v}}
\end{array}
Initial program 73.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.8%
Applied egg-rr97.8%
(FPCore (u v t1)
:precision binary64
(if (<= t1 -1.6e+39)
(/ (/ v (+ t1 u)) -1.0)
(if (<= t1 1.75e-100)
(/ (- 0.0 (/ t1 u)) (/ u v))
(/ (/ v t1) (- -1.0 (/ u t1))))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.6e+39) {
tmp = (v / (t1 + u)) / -1.0;
} else if (t1 <= 1.75e-100) {
tmp = (0.0 - (t1 / u)) / (u / v);
} else {
tmp = (v / t1) / (-1.0 - (u / 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 (t1 <= (-1.6d+39)) then
tmp = (v / (t1 + u)) / (-1.0d0)
else if (t1 <= 1.75d-100) then
tmp = (0.0d0 - (t1 / u)) / (u / v)
else
tmp = (v / t1) / ((-1.0d0) - (u / t1))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.6e+39) {
tmp = (v / (t1 + u)) / -1.0;
} else if (t1 <= 1.75e-100) {
tmp = (0.0 - (t1 / u)) / (u / v);
} else {
tmp = (v / t1) / (-1.0 - (u / t1));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -1.6e+39: tmp = (v / (t1 + u)) / -1.0 elif t1 <= 1.75e-100: tmp = (0.0 - (t1 / u)) / (u / v) else: tmp = (v / t1) / (-1.0 - (u / t1)) return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -1.6e+39) tmp = Float64(Float64(v / Float64(t1 + u)) / -1.0); elseif (t1 <= 1.75e-100) tmp = Float64(Float64(0.0 - Float64(t1 / u)) / Float64(u / v)); else tmp = Float64(Float64(v / t1) / Float64(-1.0 - Float64(u / t1))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -1.6e+39) tmp = (v / (t1 + u)) / -1.0; elseif (t1 <= 1.75e-100) tmp = (0.0 - (t1 / u)) / (u / v); else tmp = (v / t1) / (-1.0 - (u / t1)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -1.6e+39], N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / -1.0), $MachinePrecision], If[LessEqual[t1, 1.75e-100], N[(N[(0.0 - N[(t1 / u), $MachinePrecision]), $MachinePrecision] / N[(u / v), $MachinePrecision]), $MachinePrecision], N[(N[(v / t1), $MachinePrecision] / N[(-1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.6 \cdot 10^{+39}:\\
\;\;\;\;\frac{\frac{v}{t1 + u}}{-1}\\
\mathbf{elif}\;t1 \leq 1.75 \cdot 10^{-100}:\\
\;\;\;\;\frac{0 - \frac{t1}{u}}{\frac{u}{v}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{v}{t1}}{-1 - \frac{u}{t1}}\\
\end{array}
\end{array}
if t1 < -1.59999999999999996e39Initial program 61.4%
*-commutativeN/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
distribute-frac-neg2N/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64100.0%
Applied egg-rr100.0%
Taylor expanded in t1 around inf
Simplified88.6%
if -1.59999999999999996e39 < t1 < 1.75e-100Initial program 77.9%
*-commutativeN/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
distribute-frac-neg2N/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6495.1%
Applied egg-rr95.1%
Taylor expanded in t1 around 0
Simplified74.0%
Taylor expanded in t1 around 0
Simplified79.1%
div-invN/A
clear-numN/A
associate-*l/N/A
div-invN/A
/-lowering-/.f64N/A
distribute-neg-fracN/A
clear-numN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f6480.7%
Applied egg-rr80.7%
if 1.75e-100 < t1 Initial program 73.9%
*-commutativeN/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
distribute-frac-neg2N/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6499.8%
Applied egg-rr99.8%
Taylor expanded in t1 around inf
+-lowering-+.f64N/A
/-lowering-/.f6499.8%
Simplified99.8%
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6499.8%
Applied egg-rr99.8%
Taylor expanded in t1 around inf
/-lowering-/.f6478.6%
Simplified78.6%
Final simplification81.5%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (/ v (+ t1 u)) -1.0)))
(if (<= t1 -1.6e+39)
t_1
(if (<= t1 1.76e-99) (/ (- 0.0 (/ t1 u)) (/ u v)) t_1))))
double code(double u, double v, double t1) {
double t_1 = (v / (t1 + u)) / -1.0;
double tmp;
if (t1 <= -1.6e+39) {
tmp = t_1;
} else if (t1 <= 1.76e-99) {
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 = (v / (t1 + u)) / (-1.0d0)
if (t1 <= (-1.6d+39)) then
tmp = t_1
else if (t1 <= 1.76d-99) 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 = (v / (t1 + u)) / -1.0;
double tmp;
if (t1 <= -1.6e+39) {
tmp = t_1;
} else if (t1 <= 1.76e-99) {
tmp = (0.0 - (t1 / u)) / (u / v);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = (v / (t1 + u)) / -1.0 tmp = 0 if t1 <= -1.6e+39: tmp = t_1 elif t1 <= 1.76e-99: tmp = (0.0 - (t1 / u)) / (u / v) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(v / Float64(t1 + u)) / -1.0) tmp = 0.0 if (t1 <= -1.6e+39) tmp = t_1; elseif (t1 <= 1.76e-99) 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 = (v / (t1 + u)) / -1.0; tmp = 0.0; if (t1 <= -1.6e+39) tmp = t_1; elseif (t1 <= 1.76e-99) 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[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / -1.0), $MachinePrecision]}, If[LessEqual[t1, -1.6e+39], t$95$1, If[LessEqual[t1, 1.76e-99], 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 := \frac{\frac{v}{t1 + u}}{-1}\\
\mathbf{if}\;t1 \leq -1.6 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 1.76 \cdot 10^{-99}:\\
\;\;\;\;\frac{0 - \frac{t1}{u}}{\frac{u}{v}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -1.59999999999999996e39 or 1.75999999999999991e-99 < t1 Initial program 69.4%
*-commutativeN/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
distribute-frac-neg2N/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6499.9%
Applied egg-rr99.9%
Taylor expanded in t1 around inf
Simplified81.5%
if -1.59999999999999996e39 < t1 < 1.75999999999999991e-99Initial program 77.9%
*-commutativeN/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
distribute-frac-neg2N/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6495.1%
Applied egg-rr95.1%
Taylor expanded in t1 around 0
Simplified74.0%
Taylor expanded in t1 around 0
Simplified79.1%
div-invN/A
clear-numN/A
associate-*l/N/A
div-invN/A
/-lowering-/.f64N/A
distribute-neg-fracN/A
clear-numN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f6480.7%
Applied egg-rr80.7%
Final simplification81.1%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (/ v (+ t1 u)) -1.0)))
(if (<= t1 -1.6e+39)
t_1
(if (<= t1 3.9e-99) (/ (/ v u) (/ u (- 0.0 t1))) t_1))))
double code(double u, double v, double t1) {
double t_1 = (v / (t1 + u)) / -1.0;
double tmp;
if (t1 <= -1.6e+39) {
tmp = t_1;
} else if (t1 <= 3.9e-99) {
tmp = (v / u) / (u / (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 / (t1 + u)) / (-1.0d0)
if (t1 <= (-1.6d+39)) then
tmp = t_1
else if (t1 <= 3.9d-99) then
tmp = (v / u) / (u / (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 / (t1 + u)) / -1.0;
double tmp;
if (t1 <= -1.6e+39) {
tmp = t_1;
} else if (t1 <= 3.9e-99) {
tmp = (v / u) / (u / (0.0 - t1));
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = (v / (t1 + u)) / -1.0 tmp = 0 if t1 <= -1.6e+39: tmp = t_1 elif t1 <= 3.9e-99: tmp = (v / u) / (u / (0.0 - t1)) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(v / Float64(t1 + u)) / -1.0) tmp = 0.0 if (t1 <= -1.6e+39) tmp = t_1; elseif (t1 <= 3.9e-99) tmp = Float64(Float64(v / u) / Float64(u / Float64(0.0 - t1))); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = (v / (t1 + u)) / -1.0; tmp = 0.0; if (t1 <= -1.6e+39) tmp = t_1; elseif (t1 <= 3.9e-99) tmp = (v / u) / (u / (0.0 - t1)); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / -1.0), $MachinePrecision]}, If[LessEqual[t1, -1.6e+39], t$95$1, If[LessEqual[t1, 3.9e-99], N[(N[(v / u), $MachinePrecision] / N[(u / N[(0.0 - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{v}{t1 + u}}{-1}\\
\mathbf{if}\;t1 \leq -1.6 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 3.9 \cdot 10^{-99}:\\
\;\;\;\;\frac{\frac{v}{u}}{\frac{u}{0 - t1}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -1.59999999999999996e39 or 3.89999999999999987e-99 < t1 Initial program 69.4%
*-commutativeN/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
distribute-frac-neg2N/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6499.9%
Applied egg-rr99.9%
Taylor expanded in t1 around inf
Simplified81.5%
if -1.59999999999999996e39 < t1 < 3.89999999999999987e-99Initial program 77.9%
*-commutativeN/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
distribute-frac-neg2N/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6495.1%
Applied egg-rr95.1%
Taylor expanded in t1 around 0
Simplified74.0%
Taylor expanded in t1 around 0
Simplified79.1%
Final simplification80.4%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (* t1 (/ v (- 0.0 (* u u)))))) (if (<= u -5.2e+21) t_1 (if (<= u 5e+66) (- 0.0 (/ v t1)) t_1))))
double code(double u, double v, double t1) {
double t_1 = t1 * (v / (0.0 - (u * u)));
double tmp;
if (u <= -5.2e+21) {
tmp = t_1;
} else if (u <= 5e+66) {
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 = t1 * (v / (0.0d0 - (u * u)))
if (u <= (-5.2d+21)) then
tmp = t_1
else if (u <= 5d+66) 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 = t1 * (v / (0.0 - (u * u)));
double tmp;
if (u <= -5.2e+21) {
tmp = t_1;
} else if (u <= 5e+66) {
tmp = 0.0 - (v / t1);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = t1 * (v / (0.0 - (u * u))) tmp = 0 if u <= -5.2e+21: tmp = t_1 elif u <= 5e+66: tmp = 0.0 - (v / t1) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(t1 * Float64(v / Float64(0.0 - Float64(u * u)))) tmp = 0.0 if (u <= -5.2e+21) tmp = t_1; elseif (u <= 5e+66) tmp = Float64(0.0 - Float64(v / t1)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = t1 * (v / (0.0 - (u * u))); tmp = 0.0; if (u <= -5.2e+21) tmp = t_1; elseif (u <= 5e+66) tmp = 0.0 - (v / t1); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(t1 * N[(v / N[(0.0 - N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -5.2e+21], t$95$1, If[LessEqual[u, 5e+66], N[(0.0 - N[(v / t1), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t1 \cdot \frac{v}{0 - u \cdot u}\\
\mathbf{if}\;u \leq -5.2 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 5 \cdot 10^{+66}:\\
\;\;\;\;0 - \frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -5.2e21 or 4.99999999999999991e66 < u Initial program 85.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-+.f6483.8%
Applied egg-rr83.8%
Taylor expanded in t1 around 0
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6481.9%
Simplified81.9%
if -5.2e21 < u < 4.99999999999999991e66Initial program 65.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--.f6474.2%
Simplified74.2%
neg-sub0N/A
neg-lowering-neg.f6474.2%
Applied egg-rr74.2%
Final simplification77.3%
(FPCore (u v t1) :precision binary64 (if (<= u -7.5e+188) (/ (* v -0.5) u) (if (<= u 1.7e+121) (- 0.0 (/ v t1)) (/ -1.0 (/ u v)))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -7.5e+188) {
tmp = (v * -0.5) / u;
} else if (u <= 1.7e+121) {
tmp = 0.0 - (v / t1);
} else {
tmp = -1.0 / (u / v);
}
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 <= (-7.5d+188)) then
tmp = (v * (-0.5d0)) / u
else if (u <= 1.7d+121) then
tmp = 0.0d0 - (v / t1)
else
tmp = (-1.0d0) / (u / v)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -7.5e+188) {
tmp = (v * -0.5) / u;
} else if (u <= 1.7e+121) {
tmp = 0.0 - (v / t1);
} else {
tmp = -1.0 / (u / v);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -7.5e+188: tmp = (v * -0.5) / u elif u <= 1.7e+121: tmp = 0.0 - (v / t1) else: tmp = -1.0 / (u / v) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -7.5e+188) tmp = Float64(Float64(v * -0.5) / u); elseif (u <= 1.7e+121) tmp = Float64(0.0 - Float64(v / t1)); else tmp = Float64(-1.0 / Float64(u / v)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -7.5e+188) tmp = (v * -0.5) / u; elseif (u <= 1.7e+121) tmp = 0.0 - (v / t1); else tmp = -1.0 / (u / v); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -7.5e+188], N[(N[(v * -0.5), $MachinePrecision] / u), $MachinePrecision], If[LessEqual[u, 1.7e+121], N[(0.0 - N[(v / t1), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(u / v), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -7.5 \cdot 10^{+188}:\\
\;\;\;\;\frac{v \cdot -0.5}{u}\\
\mathbf{elif}\;u \leq 1.7 \cdot 10^{+121}:\\
\;\;\;\;0 - \frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{u}{v}}\\
\end{array}
\end{array}
if u < -7.4999999999999996e188Initial program 77.2%
Taylor expanded in t1 around 0
+-commutativeN/A
unpow2N/A
associate-*r*N/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6477.2%
Simplified77.2%
Taylor expanded in t1 around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6443.3%
Simplified43.3%
if -7.4999999999999996e188 < u < 1.70000000000000005e121Initial program 70.1%
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--.f6464.8%
Simplified64.8%
neg-sub0N/A
neg-lowering-neg.f6464.8%
Applied egg-rr64.8%
if 1.70000000000000005e121 < u Initial program 86.2%
*-commutativeN/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
distribute-frac-neg2N/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6497.7%
Applied egg-rr97.7%
Taylor expanded in t1 around 0
Simplified95.6%
div-invN/A
clear-numN/A
associate-*l/N/A
div-invN/A
/-lowering-/.f64N/A
distribute-neg-fracN/A
clear-numN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f6496.2%
Applied egg-rr96.2%
Taylor expanded in t1 around inf
Simplified43.1%
Final simplification59.3%
(FPCore (u v t1) :precision binary64 (if (<= u -4e+187) (/ v (- 0.0 u)) (if (<= u 7.8e+120) (- 0.0 (/ v t1)) (/ -1.0 (/ u v)))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -4e+187) {
tmp = v / (0.0 - u);
} else if (u <= 7.8e+120) {
tmp = 0.0 - (v / t1);
} else {
tmp = -1.0 / (u / v);
}
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 <= (-4d+187)) then
tmp = v / (0.0d0 - u)
else if (u <= 7.8d+120) then
tmp = 0.0d0 - (v / t1)
else
tmp = (-1.0d0) / (u / v)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -4e+187) {
tmp = v / (0.0 - u);
} else if (u <= 7.8e+120) {
tmp = 0.0 - (v / t1);
} else {
tmp = -1.0 / (u / v);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -4e+187: tmp = v / (0.0 - u) elif u <= 7.8e+120: tmp = 0.0 - (v / t1) else: tmp = -1.0 / (u / v) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -4e+187) tmp = Float64(v / Float64(0.0 - u)); elseif (u <= 7.8e+120) tmp = Float64(0.0 - Float64(v / t1)); else tmp = Float64(-1.0 / Float64(u / v)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -4e+187) tmp = v / (0.0 - u); elseif (u <= 7.8e+120) tmp = 0.0 - (v / t1); else tmp = -1.0 / (u / v); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -4e+187], N[(v / N[(0.0 - u), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 7.8e+120], N[(0.0 - N[(v / t1), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(u / v), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -4 \cdot 10^{+187}:\\
\;\;\;\;\frac{v}{0 - u}\\
\mathbf{elif}\;u \leq 7.8 \cdot 10^{+120}:\\
\;\;\;\;0 - \frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{u}{v}}\\
\end{array}
\end{array}
if u < -3.99999999999999963e187Initial program 77.2%
Taylor expanded in t1 around inf
Simplified56.0%
Taylor expanded in t1 around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f6443.3%
Simplified43.3%
if -3.99999999999999963e187 < u < 7.7999999999999997e120Initial program 70.1%
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--.f6464.8%
Simplified64.8%
neg-sub0N/A
neg-lowering-neg.f6464.8%
Applied egg-rr64.8%
if 7.7999999999999997e120 < u Initial program 86.2%
*-commutativeN/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
distribute-frac-neg2N/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6497.7%
Applied egg-rr97.7%
Taylor expanded in t1 around 0
Simplified95.6%
div-invN/A
clear-numN/A
associate-*l/N/A
div-invN/A
/-lowering-/.f64N/A
distribute-neg-fracN/A
clear-numN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f6496.2%
Applied egg-rr96.2%
Taylor expanded in t1 around inf
Simplified43.1%
Final simplification59.3%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (/ v (- 0.0 u)))) (if (<= u -6e+186) t_1 (if (<= u 1.15e+121) (- 0.0 (/ v t1)) t_1))))
double code(double u, double v, double t1) {
double t_1 = v / (0.0 - u);
double tmp;
if (u <= -6e+186) {
tmp = t_1;
} else if (u <= 1.15e+121) {
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 / (0.0d0 - u)
if (u <= (-6d+186)) then
tmp = t_1
else if (u <= 1.15d+121) 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 / (0.0 - u);
double tmp;
if (u <= -6e+186) {
tmp = t_1;
} else if (u <= 1.15e+121) {
tmp = 0.0 - (v / t1);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = v / (0.0 - u) tmp = 0 if u <= -6e+186: tmp = t_1 elif u <= 1.15e+121: tmp = 0.0 - (v / t1) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(v / Float64(0.0 - u)) tmp = 0.0 if (u <= -6e+186) tmp = t_1; elseif (u <= 1.15e+121) 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 / (0.0 - u); tmp = 0.0; if (u <= -6e+186) tmp = t_1; elseif (u <= 1.15e+121) 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[(0.0 - u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -6e+186], t$95$1, If[LessEqual[u, 1.15e+121], N[(0.0 - N[(v / t1), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{v}{0 - u}\\
\mathbf{if}\;u \leq -6 \cdot 10^{+186}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 1.15 \cdot 10^{+121}:\\
\;\;\;\;0 - \frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -5.99999999999999964e186 or 1.1499999999999999e121 < u Initial program 83.2%
Taylor expanded in t1 around inf
Simplified49.1%
Taylor expanded in t1 around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f6441.9%
Simplified41.9%
if -5.99999999999999964e186 < u < 1.1499999999999999e121Initial program 70.1%
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--.f6464.8%
Simplified64.8%
neg-sub0N/A
neg-lowering-neg.f6464.8%
Applied egg-rr64.8%
Final simplification59.0%
(FPCore (u v t1) :precision binary64 (/ (/ v (+ t1 u)) (- -1.0 (/ u t1))))
double code(double u, double v, double t1) {
return (v / (t1 + u)) / (-1.0 - (u / t1));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (v / (t1 + u)) / ((-1.0d0) - (u / t1))
end function
public static double code(double u, double v, double t1) {
return (v / (t1 + u)) / (-1.0 - (u / t1));
}
def code(u, v, t1): return (v / (t1 + u)) / (-1.0 - (u / t1))
function code(u, v, t1) return Float64(Float64(v / Float64(t1 + u)) / Float64(-1.0 - Float64(u / t1))) end
function tmp = code(u, v, t1) tmp = (v / (t1 + u)) / (-1.0 - (u / t1)); end
code[u_, v_, t1_] := N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{v}{t1 + u}}{-1 - \frac{u}{t1}}
\end{array}
Initial program 73.4%
*-commutativeN/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
distribute-frac-neg2N/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6497.6%
Applied egg-rr97.6%
Taylor expanded in t1 around inf
+-lowering-+.f64N/A
/-lowering-/.f6497.6%
Simplified97.6%
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6497.6%
Applied egg-rr97.6%
(FPCore (u v t1) :precision binary64 (/ (/ v (+ t1 u)) -1.0))
double code(double u, double v, double t1) {
return (v / (t1 + u)) / -1.0;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (v / (t1 + u)) / (-1.0d0)
end function
public static double code(double u, double v, double t1) {
return (v / (t1 + u)) / -1.0;
}
def code(u, v, t1): return (v / (t1 + u)) / -1.0
function code(u, v, t1) return Float64(Float64(v / Float64(t1 + u)) / -1.0) end
function tmp = code(u, v, t1) tmp = (v / (t1 + u)) / -1.0; end
code[u_, v_, t1_] := N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / -1.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{v}{t1 + u}}{-1}
\end{array}
Initial program 73.4%
*-commutativeN/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
distribute-frac-neg2N/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6497.6%
Applied egg-rr97.6%
Taylor expanded in t1 around inf
Simplified60.1%
(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 73.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.8%
Applied egg-rr97.8%
Taylor expanded in t1 around inf
Simplified59.8%
(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 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--.f6451.1%
Simplified51.1%
neg-sub0N/A
neg-lowering-neg.f6451.1%
Applied egg-rr51.1%
Final simplification51.1%
herbie shell --seed 2024158
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))