
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1): return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 * v) / ((t1 + u) * (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1): return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 * v) / ((t1 + u) * (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}
(FPCore (u v t1) :precision binary64 (/ (* t1 (/ v (+ t1 u))) (- (- u) t1)))
double code(double u, double v, double t1) {
return (t1 * (v / (t1 + u))) / (-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 = (t1 * (v / (t1 + u))) / (-u - t1)
end function
public static double code(double u, double v, double t1) {
return (t1 * (v / (t1 + u))) / (-u - t1);
}
def code(u, v, t1): return (t1 * (v / (t1 + u))) / (-u - t1)
function code(u, v, t1) return Float64(Float64(t1 * Float64(v / Float64(t1 + u))) / Float64(Float64(-u) - t1)) end
function tmp = code(u, v, t1) tmp = (t1 * (v / (t1 + u))) / (-u - t1); end
code[u_, v_, t1_] := N[(N[(t1 * N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t1 \cdot \frac{v}{t1 + u}}{\left(-u\right) - t1}
\end{array}
Initial program 73.1%
*-commutativeN/A
times-fracN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
neg-lowering-neg.f64N/A
+-lowering-+.f6499.0
Applied egg-rr99.0%
Final simplification99.0%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (* v (/ (- t1) (* (+ t1 u) (+ t1 u)))))
(t_2 (/ v (- (* u -2.0) t1))))
(if (<= t1 -5e+112)
t_2
(if (<= t1 -1.7e-150)
t_1
(if (<= t1 2.2e-163)
(- (/ (* t1 (/ v u)) u))
(if (<= t1 3.2e+72) t_1 t_2))))))
double code(double u, double v, double t1) {
double t_1 = v * (-t1 / ((t1 + u) * (t1 + u)));
double t_2 = v / ((u * -2.0) - t1);
double tmp;
if (t1 <= -5e+112) {
tmp = t_2;
} else if (t1 <= -1.7e-150) {
tmp = t_1;
} else if (t1 <= 2.2e-163) {
tmp = -((t1 * (v / u)) / u);
} else if (t1 <= 3.2e+72) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = v * (-t1 / ((t1 + u) * (t1 + u)))
t_2 = v / ((u * (-2.0d0)) - t1)
if (t1 <= (-5d+112)) then
tmp = t_2
else if (t1 <= (-1.7d-150)) then
tmp = t_1
else if (t1 <= 2.2d-163) then
tmp = -((t1 * (v / u)) / u)
else if (t1 <= 3.2d+72) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = v * (-t1 / ((t1 + u) * (t1 + u)));
double t_2 = v / ((u * -2.0) - t1);
double tmp;
if (t1 <= -5e+112) {
tmp = t_2;
} else if (t1 <= -1.7e-150) {
tmp = t_1;
} else if (t1 <= 2.2e-163) {
tmp = -((t1 * (v / u)) / u);
} else if (t1 <= 3.2e+72) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(u, v, t1): t_1 = v * (-t1 / ((t1 + u) * (t1 + u))) t_2 = v / ((u * -2.0) - t1) tmp = 0 if t1 <= -5e+112: tmp = t_2 elif t1 <= -1.7e-150: tmp = t_1 elif t1 <= 2.2e-163: tmp = -((t1 * (v / u)) / u) elif t1 <= 3.2e+72: tmp = t_1 else: tmp = t_2 return tmp
function code(u, v, t1) t_1 = Float64(v * Float64(Float64(-t1) / Float64(Float64(t1 + u) * Float64(t1 + u)))) t_2 = Float64(v / Float64(Float64(u * -2.0) - t1)) tmp = 0.0 if (t1 <= -5e+112) tmp = t_2; elseif (t1 <= -1.7e-150) tmp = t_1; elseif (t1 <= 2.2e-163) tmp = Float64(-Float64(Float64(t1 * Float64(v / u)) / u)); elseif (t1 <= 3.2e+72) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = v * (-t1 / ((t1 + u) * (t1 + u))); t_2 = v / ((u * -2.0) - t1); tmp = 0.0; if (t1 <= -5e+112) tmp = t_2; elseif (t1 <= -1.7e-150) tmp = t_1; elseif (t1 <= 2.2e-163) tmp = -((t1 * (v / u)) / u); elseif (t1 <= 3.2e+72) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v * N[((-t1) / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -5e+112], t$95$2, If[LessEqual[t1, -1.7e-150], t$95$1, If[LessEqual[t1, 2.2e-163], (-N[(N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision]), If[LessEqual[t1, 3.2e+72], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
t_2 := \frac{v}{u \cdot -2 - t1}\\
\mathbf{if}\;t1 \leq -5 \cdot 10^{+112}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t1 \leq -1.7 \cdot 10^{-150}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 2.2 \cdot 10^{-163}:\\
\;\;\;\;-\frac{t1 \cdot \frac{v}{u}}{u}\\
\mathbf{elif}\;t1 \leq 3.2 \cdot 10^{+72}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t1 < -5e112 or 3.2000000000000001e72 < t1 Initial program 46.2%
*-commutativeN/A
times-fracN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
neg-lowering-neg.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
associate-/l*N/A
distribute-frac-neg2N/A
distribute-frac-negN/A
times-fracN/A
associate-*r/N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
frac-2negN/A
remove-double-negN/A
distribute-neg-inN/A
unsub-negN/A
div-subN/A
distribute-frac-negN/A
*-inversesN/A
metadata-evalN/A
--lowering--.f64N/A
/-lowering-/.f6496.5
Applied egg-rr96.5%
Taylor expanded in u around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6492.0
Simplified92.0%
if -5e112 < t1 < -1.7e-150 or 2.20000000000000011e-163 < t1 < 3.2000000000000001e72Initial program 92.2%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6495.1
Applied egg-rr95.1%
if -1.7e-150 < t1 < 2.20000000000000011e-163Initial program 77.6%
*-commutativeN/A
times-fracN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
neg-lowering-neg.f64N/A
+-lowering-+.f6497.0
Applied egg-rr97.0%
Taylor expanded in t1 around 0
/-lowering-/.f6492.6
Simplified92.6%
Taylor expanded in t1 around 0
Simplified92.6%
Final simplification93.4%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (* v (/ (- t1) (* (+ t1 u) (+ t1 u)))))
(t_2 (/ v (- (* u -2.0) t1))))
(if (<= t1 -5.5e+112)
t_2
(if (<= t1 -3.25e-180)
t_1
(if (<= t1 5e-164)
(* (/ v u) (/ t1 (- u)))
(if (<= t1 3.2e+72) t_1 t_2))))))
double code(double u, double v, double t1) {
double t_1 = v * (-t1 / ((t1 + u) * (t1 + u)));
double t_2 = v / ((u * -2.0) - t1);
double tmp;
if (t1 <= -5.5e+112) {
tmp = t_2;
} else if (t1 <= -3.25e-180) {
tmp = t_1;
} else if (t1 <= 5e-164) {
tmp = (v / u) * (t1 / -u);
} else if (t1 <= 3.2e+72) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = v * (-t1 / ((t1 + u) * (t1 + u)))
t_2 = v / ((u * (-2.0d0)) - t1)
if (t1 <= (-5.5d+112)) then
tmp = t_2
else if (t1 <= (-3.25d-180)) then
tmp = t_1
else if (t1 <= 5d-164) then
tmp = (v / u) * (t1 / -u)
else if (t1 <= 3.2d+72) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = v * (-t1 / ((t1 + u) * (t1 + u)));
double t_2 = v / ((u * -2.0) - t1);
double tmp;
if (t1 <= -5.5e+112) {
tmp = t_2;
} else if (t1 <= -3.25e-180) {
tmp = t_1;
} else if (t1 <= 5e-164) {
tmp = (v / u) * (t1 / -u);
} else if (t1 <= 3.2e+72) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(u, v, t1): t_1 = v * (-t1 / ((t1 + u) * (t1 + u))) t_2 = v / ((u * -2.0) - t1) tmp = 0 if t1 <= -5.5e+112: tmp = t_2 elif t1 <= -3.25e-180: tmp = t_1 elif t1 <= 5e-164: tmp = (v / u) * (t1 / -u) elif t1 <= 3.2e+72: tmp = t_1 else: tmp = t_2 return tmp
function code(u, v, t1) t_1 = Float64(v * Float64(Float64(-t1) / Float64(Float64(t1 + u) * Float64(t1 + u)))) t_2 = Float64(v / Float64(Float64(u * -2.0) - t1)) tmp = 0.0 if (t1 <= -5.5e+112) tmp = t_2; elseif (t1 <= -3.25e-180) tmp = t_1; elseif (t1 <= 5e-164) tmp = Float64(Float64(v / u) * Float64(t1 / Float64(-u))); elseif (t1 <= 3.2e+72) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = v * (-t1 / ((t1 + u) * (t1 + u))); t_2 = v / ((u * -2.0) - t1); tmp = 0.0; if (t1 <= -5.5e+112) tmp = t_2; elseif (t1 <= -3.25e-180) tmp = t_1; elseif (t1 <= 5e-164) tmp = (v / u) * (t1 / -u); elseif (t1 <= 3.2e+72) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v * N[((-t1) / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -5.5e+112], t$95$2, If[LessEqual[t1, -3.25e-180], t$95$1, If[LessEqual[t1, 5e-164], N[(N[(v / u), $MachinePrecision] * N[(t1 / (-u)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 3.2e+72], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
t_2 := \frac{v}{u \cdot -2 - t1}\\
\mathbf{if}\;t1 \leq -5.5 \cdot 10^{+112}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t1 \leq -3.25 \cdot 10^{-180}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 5 \cdot 10^{-164}:\\
\;\;\;\;\frac{v}{u} \cdot \frac{t1}{-u}\\
\mathbf{elif}\;t1 \leq 3.2 \cdot 10^{+72}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t1 < -5.50000000000000026e112 or 3.2000000000000001e72 < t1 Initial program 46.2%
*-commutativeN/A
times-fracN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
neg-lowering-neg.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
associate-/l*N/A
distribute-frac-neg2N/A
distribute-frac-negN/A
times-fracN/A
associate-*r/N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
frac-2negN/A
remove-double-negN/A
distribute-neg-inN/A
unsub-negN/A
div-subN/A
distribute-frac-negN/A
*-inversesN/A
metadata-evalN/A
--lowering--.f64N/A
/-lowering-/.f6496.5
Applied egg-rr96.5%
Taylor expanded in u around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6492.0
Simplified92.0%
if -5.50000000000000026e112 < t1 < -3.25000000000000007e-180 or 4.99999999999999962e-164 < t1 < 3.2000000000000001e72Initial program 91.7%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6494.4
Applied egg-rr94.4%
if -3.25000000000000007e-180 < t1 < 4.99999999999999962e-164Initial program 77.3%
Taylor expanded in t1 around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
unpow2N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6478.8
Simplified78.8%
associate-*r/N/A
*-commutativeN/A
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-lowering-neg.f64N/A
/-lowering-/.f6490.6
Applied egg-rr90.6%
Final simplification92.6%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ v (- (* u -2.0) t1))))
(if (<= t1 -2.15e-63)
t_1
(if (<= t1 2.9e-80) (* (/ v u) (/ t1 (- u))) t_1))))
double code(double u, double v, double t1) {
double t_1 = v / ((u * -2.0) - t1);
double tmp;
if (t1 <= -2.15e-63) {
tmp = t_1;
} else if (t1 <= 2.9e-80) {
tmp = (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 = v / ((u * (-2.0d0)) - t1)
if (t1 <= (-2.15d-63)) then
tmp = t_1
else if (t1 <= 2.9d-80) then
tmp = (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 = v / ((u * -2.0) - t1);
double tmp;
if (t1 <= -2.15e-63) {
tmp = t_1;
} else if (t1 <= 2.9e-80) {
tmp = (v / u) * (t1 / -u);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = v / ((u * -2.0) - t1) tmp = 0 if t1 <= -2.15e-63: tmp = t_1 elif t1 <= 2.9e-80: tmp = (v / u) * (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 <= -2.15e-63) tmp = t_1; elseif (t1 <= 2.9e-80) tmp = Float64(Float64(v / u) * Float64(t1 / Float64(-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 <= -2.15e-63) tmp = t_1; elseif (t1 <= 2.9e-80) tmp = (v / u) * (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, -2.15e-63], t$95$1, If[LessEqual[t1, 2.9e-80], N[(N[(v / u), $MachinePrecision] * N[(t1 / (-u)), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{v}{u \cdot -2 - t1}\\
\mathbf{if}\;t1 \leq -2.15 \cdot 10^{-63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 2.9 \cdot 10^{-80}:\\
\;\;\;\;\frac{v}{u} \cdot \frac{t1}{-u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -2.1499999999999999e-63 or 2.89999999999999998e-80 < t1 Initial program 66.0%
*-commutativeN/A
times-fracN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
neg-lowering-neg.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
associate-/l*N/A
distribute-frac-neg2N/A
distribute-frac-negN/A
times-fracN/A
associate-*r/N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
frac-2negN/A
remove-double-negN/A
distribute-neg-inN/A
unsub-negN/A
div-subN/A
distribute-frac-negN/A
*-inversesN/A
metadata-evalN/A
--lowering--.f64N/A
/-lowering-/.f6495.4
Applied egg-rr95.4%
Taylor expanded in u around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6484.8
Simplified84.8%
if -2.1499999999999999e-63 < t1 < 2.89999999999999998e-80Initial program 82.6%
Taylor expanded in t1 around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
unpow2N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6479.2
Simplified79.2%
associate-*r/N/A
*-commutativeN/A
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-lowering-neg.f64N/A
/-lowering-/.f6487.4
Applied egg-rr87.4%
Final simplification85.9%
(FPCore (u v t1) :precision binary64 (if (<= u 4.8e+210) (/ v (* (+ t1 u) (- -1.0 (/ u t1)))) (- (/ (* t1 (/ v u)) u))))
double code(double u, double v, double t1) {
double tmp;
if (u <= 4.8e+210) {
tmp = v / ((t1 + u) * (-1.0 - (u / t1)));
} else {
tmp = -((t1 * (v / u)) / 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 <= 4.8d+210) then
tmp = v / ((t1 + u) * ((-1.0d0) - (u / t1)))
else
tmp = -((t1 * (v / u)) / u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= 4.8e+210) {
tmp = v / ((t1 + u) * (-1.0 - (u / t1)));
} else {
tmp = -((t1 * (v / u)) / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= 4.8e+210: tmp = v / ((t1 + u) * (-1.0 - (u / t1))) else: tmp = -((t1 * (v / u)) / u) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= 4.8e+210) tmp = Float64(v / Float64(Float64(t1 + u) * Float64(-1.0 - Float64(u / t1)))); else tmp = Float64(-Float64(Float64(t1 * Float64(v / u)) / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= 4.8e+210) tmp = v / ((t1 + u) * (-1.0 - (u / t1))); else tmp = -((t1 * (v / u)) / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, 4.8e+210], N[(v / N[(N[(t1 + u), $MachinePrecision] * N[(-1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq 4.8 \cdot 10^{+210}:\\
\;\;\;\;\frac{v}{\left(t1 + u\right) \cdot \left(-1 - \frac{u}{t1}\right)}\\
\mathbf{else}:\\
\;\;\;\;-\frac{t1 \cdot \frac{v}{u}}{u}\\
\end{array}
\end{array}
if u < 4.79999999999999977e210Initial program 72.1%
*-commutativeN/A
times-fracN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
neg-lowering-neg.f64N/A
+-lowering-+.f6498.9
Applied egg-rr98.9%
associate-/l*N/A
distribute-frac-neg2N/A
distribute-frac-negN/A
times-fracN/A
associate-*r/N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
frac-2negN/A
remove-double-negN/A
distribute-neg-inN/A
unsub-negN/A
div-subN/A
distribute-frac-negN/A
*-inversesN/A
metadata-evalN/A
--lowering--.f64N/A
/-lowering-/.f6495.8
Applied egg-rr95.8%
if 4.79999999999999977e210 < u Initial program 82.2%
*-commutativeN/A
times-fracN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
neg-lowering-neg.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
Taylor expanded in t1 around 0
/-lowering-/.f6499.9
Simplified99.9%
Taylor expanded in t1 around 0
Simplified99.9%
Final simplification96.2%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ v (- (* u -2.0) t1))))
(if (<= t1 -2.6e-63)
t_1
(if (<= t1 1.26e-79) (* t1 (/ v (* u (- u)))) t_1))))
double code(double u, double v, double t1) {
double t_1 = v / ((u * -2.0) - t1);
double tmp;
if (t1 <= -2.6e-63) {
tmp = t_1;
} else if (t1 <= 1.26e-79) {
tmp = t1 * (v / (u * -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 <= (-2.6d-63)) then
tmp = t_1
else if (t1 <= 1.26d-79) then
tmp = t1 * (v / (u * -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 <= -2.6e-63) {
tmp = t_1;
} else if (t1 <= 1.26e-79) {
tmp = t1 * (v / (u * -u));
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = v / ((u * -2.0) - t1) tmp = 0 if t1 <= -2.6e-63: tmp = t_1 elif t1 <= 1.26e-79: tmp = t1 * (v / (u * -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 <= -2.6e-63) tmp = t_1; elseif (t1 <= 1.26e-79) tmp = Float64(t1 * Float64(v / Float64(u * Float64(-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 <= -2.6e-63) tmp = t_1; elseif (t1 <= 1.26e-79) tmp = t1 * (v / (u * -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, -2.6e-63], t$95$1, If[LessEqual[t1, 1.26e-79], N[(t1 * N[(v / N[(u * (-u)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{v}{u \cdot -2 - t1}\\
\mathbf{if}\;t1 \leq -2.6 \cdot 10^{-63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 1.26 \cdot 10^{-79}:\\
\;\;\;\;t1 \cdot \frac{v}{u \cdot \left(-u\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -2.6000000000000001e-63 or 1.25999999999999993e-79 < t1 Initial program 66.0%
*-commutativeN/A
times-fracN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
neg-lowering-neg.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
associate-/l*N/A
distribute-frac-neg2N/A
distribute-frac-negN/A
times-fracN/A
associate-*r/N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
frac-2negN/A
remove-double-negN/A
distribute-neg-inN/A
unsub-negN/A
div-subN/A
distribute-frac-negN/A
*-inversesN/A
metadata-evalN/A
--lowering--.f64N/A
/-lowering-/.f6495.4
Applied egg-rr95.4%
Taylor expanded in u around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6484.8
Simplified84.8%
if -2.6000000000000001e-63 < t1 < 1.25999999999999993e-79Initial program 82.6%
Taylor expanded in t1 around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
unpow2N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6479.2
Simplified79.2%
(FPCore (u v t1) :precision binary64 (* (- (/ v (+ t1 u))) (/ t1 (+ t1 u))))
double code(double u, double v, double t1) {
return -(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 = -(v / (t1 + u)) * (t1 / (t1 + u))
end function
public static double code(double u, double v, double t1) {
return -(v / (t1 + u)) * (t1 / (t1 + u));
}
def code(u, v, t1): return -(v / (t1 + u)) * (t1 / (t1 + u))
function code(u, v, t1) return Float64(Float64(-Float64(v / Float64(t1 + u))) * Float64(t1 / Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = -(v / (t1 + u)) * (t1 / (t1 + u)); end
code[u_, v_, t1_] := N[((-N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]) * N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-\frac{v}{t1 + u}\right) \cdot \frac{t1}{t1 + u}
\end{array}
Initial program 73.1%
*-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-lowering-neg.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6498.0
Applied egg-rr98.0%
Final simplification98.0%
(FPCore (u v t1) :precision binary64 (let* ((t_1 (- (/ v u)))) (if (<= u -8.4e+193) t_1 (if (<= u 9.6e+208) (/ v (- t1)) t_1))))
double code(double u, double v, double t1) {
double t_1 = -(v / u);
double tmp;
if (u <= -8.4e+193) {
tmp = t_1;
} else if (u <= 9.6e+208) {
tmp = 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)
if (u <= (-8.4d+193)) then
tmp = t_1
else if (u <= 9.6d+208) then
tmp = 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);
double tmp;
if (u <= -8.4e+193) {
tmp = t_1;
} else if (u <= 9.6e+208) {
tmp = v / -t1;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -(v / u) tmp = 0 if u <= -8.4e+193: tmp = t_1 elif u <= 9.6e+208: tmp = v / -t1 else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(-Float64(v / u)) tmp = 0.0 if (u <= -8.4e+193) tmp = t_1; elseif (u <= 9.6e+208) tmp = Float64(v / Float64(-t1)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -(v / u); tmp = 0.0; if (u <= -8.4e+193) tmp = t_1; elseif (u <= 9.6e+208) tmp = v / -t1; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = (-N[(v / u), $MachinePrecision])}, If[LessEqual[u, -8.4e+193], t$95$1, If[LessEqual[u, 9.6e+208], N[(v / (-t1)), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -\frac{v}{u}\\
\mathbf{if}\;u \leq -8.4 \cdot 10^{+193}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 9.6 \cdot 10^{+208}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -8.4e193 or 9.59999999999999946e208 < u Initial program 82.5%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6482.9
Applied egg-rr82.9%
Taylor expanded in t1 around 0
Simplified82.9%
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-lowering-neg.f6436.7
Simplified36.7%
if -8.4e193 < u < 9.59999999999999946e208Initial program 71.2%
Taylor expanded in t1 around inf
associate-*r/N/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-lowering-neg.f6462.4
Simplified62.4%
Final simplification58.0%
(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 73.1%
*-commutativeN/A
times-fracN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
neg-lowering-neg.f64N/A
+-lowering-+.f6499.0
Applied egg-rr99.0%
associate-/l*N/A
distribute-frac-neg2N/A
distribute-frac-negN/A
times-fracN/A
associate-*r/N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
frac-2negN/A
remove-double-negN/A
distribute-neg-inN/A
unsub-negN/A
div-subN/A
distribute-frac-negN/A
*-inversesN/A
metadata-evalN/A
--lowering--.f64N/A
/-lowering-/.f6494.4
Applied egg-rr94.4%
Taylor expanded in u around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6459.1
Simplified59.1%
(FPCore (u v t1) :precision binary64 (- (/ v (+ t1 u))))
double code(double u, double v, double t1) {
return -(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 = -(v / (t1 + u))
end function
public static double code(double u, double v, double t1) {
return -(v / (t1 + u));
}
def code(u, v, t1): return -(v / (t1 + u))
function code(u, v, t1) return Float64(-Float64(v / Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = -(v / (t1 + u)); end
code[u_, v_, t1_] := (-N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision])
\begin{array}{l}
\\
-\frac{v}{t1 + u}
\end{array}
Initial program 73.1%
*-commutativeN/A
times-fracN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
neg-lowering-neg.f64N/A
+-lowering-+.f6499.0
Applied egg-rr99.0%
Taylor expanded in t1 around inf
Simplified58.7%
Final simplification58.7%
(FPCore (u v t1) :precision binary64 (- (/ v u)))
double code(double u, double v, double t1) {
return -(v / 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 / u)
end function
public static double code(double u, double v, double t1) {
return -(v / u);
}
def code(u, v, t1): return -(v / u)
function code(u, v, t1) return Float64(-Float64(v / u)) end
function tmp = code(u, v, t1) tmp = -(v / u); end
code[u_, v_, t1_] := (-N[(v / u), $MachinePrecision])
\begin{array}{l}
\\
-\frac{v}{u}
\end{array}
Initial program 73.1%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6476.6
Applied egg-rr76.6%
Taylor expanded in t1 around 0
Simplified45.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-lowering-neg.f6413.9
Simplified13.9%
Final simplification13.9%
herbie shell --seed 2024199
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))