
(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 (+ 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 71.0%
*-commutative71.0%
times-frac98.5%
neg-mul-198.5%
associate-/l*98.4%
associate-*r/98.4%
associate-/l*98.4%
associate-/l/98.4%
neg-mul-198.4%
*-lft-identity98.4%
metadata-eval98.4%
times-frac98.4%
neg-mul-198.4%
remove-double-neg98.4%
neg-mul-198.4%
sub0-neg98.4%
associate--r+98.4%
neg-sub098.4%
div-sub98.5%
distribute-frac-neg98.5%
*-inverses98.5%
metadata-eval98.5%
Simplified98.5%
Final simplification98.5%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -2.85e-64) (not (<= t1 1e-47))) (/ (- v) t1) (* (/ t1 u) (/ (- v) u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -2.85e-64) || !(t1 <= 1e-47)) {
tmp = -v / t1;
} else {
tmp = (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 ((t1 <= (-2.85d-64)) .or. (.not. (t1 <= 1d-47))) then
tmp = -v / t1
else
tmp = (t1 / u) * (-v / u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -2.85e-64) || !(t1 <= 1e-47)) {
tmp = -v / t1;
} else {
tmp = (t1 / u) * (-v / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -2.85e-64) or not (t1 <= 1e-47): tmp = -v / t1 else: tmp = (t1 / u) * (-v / u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -2.85e-64) || !(t1 <= 1e-47)) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(t1 / u) * Float64(Float64(-v) / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -2.85e-64) || ~((t1 <= 1e-47))) tmp = -v / t1; else tmp = (t1 / u) * (-v / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -2.85e-64], N[Not[LessEqual[t1, 1e-47]], $MachinePrecision]], N[((-v) / t1), $MachinePrecision], N[(N[(t1 / u), $MachinePrecision] * N[((-v) / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.85 \cdot 10^{-64} \lor \neg \left(t1 \leq 10^{-47}\right):\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u}\\
\end{array}
\end{array}
if t1 < -2.8500000000000001e-64 or 9.9999999999999997e-48 < t1 Initial program 60.6%
associate-/l*61.6%
neg-mul-161.6%
*-commutative61.6%
associate-*r/61.5%
associate-/l*61.5%
neg-mul-161.5%
associate-/r*80.7%
Simplified80.7%
Taylor expanded in t1 around inf 79.3%
associate-*r/79.3%
neg-mul-179.3%
Simplified79.3%
if -2.8500000000000001e-64 < t1 < 9.9999999999999997e-48Initial program 84.7%
*-commutative84.7%
times-frac96.5%
neg-mul-196.5%
associate-/l*96.5%
associate-*r/96.5%
associate-/l*96.5%
associate-/l/96.5%
neg-mul-196.5%
*-lft-identity96.5%
metadata-eval96.5%
times-frac96.5%
neg-mul-196.5%
remove-double-neg96.5%
neg-mul-196.5%
sub0-neg96.5%
associate--r+96.5%
neg-sub096.5%
div-sub96.5%
distribute-frac-neg96.5%
*-inverses96.5%
metadata-eval96.5%
Simplified96.5%
Taylor expanded in v around 0 97.0%
mul-1-neg97.0%
Simplified97.0%
Taylor expanded in t1 around 0 79.1%
unpow279.1%
associate-*r/82.6%
Simplified82.6%
associate-/r*82.1%
div-inv82.1%
clear-num82.1%
Applied egg-rr82.1%
Final simplification80.5%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -5.5e-63) (not (<= t1 3.5e-48))) (/ (- v) t1) (* (- v) (/ (/ t1 u) u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -5.5e-63) || !(t1 <= 3.5e-48)) {
tmp = -v / t1;
} else {
tmp = -v * ((t1 / 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 ((t1 <= (-5.5d-63)) .or. (.not. (t1 <= 3.5d-48))) then
tmp = -v / t1
else
tmp = -v * ((t1 / u) / u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -5.5e-63) || !(t1 <= 3.5e-48)) {
tmp = -v / t1;
} else {
tmp = -v * ((t1 / u) / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -5.5e-63) or not (t1 <= 3.5e-48): tmp = -v / t1 else: tmp = -v * ((t1 / u) / u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -5.5e-63) || !(t1 <= 3.5e-48)) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(-v) * Float64(Float64(t1 / u) / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -5.5e-63) || ~((t1 <= 3.5e-48))) tmp = -v / t1; else tmp = -v * ((t1 / u) / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -5.5e-63], N[Not[LessEqual[t1, 3.5e-48]], $MachinePrecision]], N[((-v) / t1), $MachinePrecision], N[((-v) * N[(N[(t1 / u), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -5.5 \cdot 10^{-63} \lor \neg \left(t1 \leq 3.5 \cdot 10^{-48}\right):\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\left(-v\right) \cdot \frac{\frac{t1}{u}}{u}\\
\end{array}
\end{array}
if t1 < -5.50000000000000043e-63 or 3.49999999999999991e-48 < t1 Initial program 60.6%
associate-/l*61.6%
neg-mul-161.6%
*-commutative61.6%
associate-*r/61.5%
associate-/l*61.5%
neg-mul-161.5%
associate-/r*80.7%
Simplified80.7%
Taylor expanded in t1 around inf 79.3%
associate-*r/79.3%
neg-mul-179.3%
Simplified79.3%
if -5.50000000000000043e-63 < t1 < 3.49999999999999991e-48Initial program 84.7%
*-commutative84.7%
times-frac96.5%
neg-mul-196.5%
associate-/l*96.5%
associate-*r/96.5%
associate-/l*96.5%
associate-/l/96.5%
neg-mul-196.5%
*-lft-identity96.5%
metadata-eval96.5%
times-frac96.5%
neg-mul-196.5%
remove-double-neg96.5%
neg-mul-196.5%
sub0-neg96.5%
associate--r+96.5%
neg-sub096.5%
div-sub96.5%
distribute-frac-neg96.5%
*-inverses96.5%
metadata-eval96.5%
Simplified96.5%
Taylor expanded in v around 0 97.0%
mul-1-neg97.0%
Simplified97.0%
Taylor expanded in t1 around 0 79.1%
unpow279.1%
associate-*r/82.6%
Simplified82.6%
clear-num82.5%
associate-/r/82.6%
*-commutative82.6%
associate-/r*82.6%
clear-num82.6%
Applied egg-rr82.6%
Final simplification80.7%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -2.15e-63) (not (<= t1 3e-46))) (/ (- v) t1) (/ (- v) (* u (/ u t1)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -2.15e-63) || !(t1 <= 3e-46)) {
tmp = -v / t1;
} else {
tmp = -v / (u * (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 <= (-2.15d-63)) .or. (.not. (t1 <= 3d-46))) then
tmp = -v / t1
else
tmp = -v / (u * (u / t1))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -2.15e-63) || !(t1 <= 3e-46)) {
tmp = -v / t1;
} else {
tmp = -v / (u * (u / t1));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -2.15e-63) or not (t1 <= 3e-46): tmp = -v / t1 else: tmp = -v / (u * (u / t1)) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -2.15e-63) || !(t1 <= 3e-46)) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(-v) / Float64(u * Float64(u / t1))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -2.15e-63) || ~((t1 <= 3e-46))) tmp = -v / t1; else tmp = -v / (u * (u / t1)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -2.15e-63], N[Not[LessEqual[t1, 3e-46]], $MachinePrecision]], N[((-v) / t1), $MachinePrecision], N[((-v) / N[(u * N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.15 \cdot 10^{-63} \lor \neg \left(t1 \leq 3 \cdot 10^{-46}\right):\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{u \cdot \frac{u}{t1}}\\
\end{array}
\end{array}
if t1 < -2.1499999999999999e-63 or 2.99999999999999987e-46 < t1 Initial program 60.6%
associate-/l*61.6%
neg-mul-161.6%
*-commutative61.6%
associate-*r/61.5%
associate-/l*61.5%
neg-mul-161.5%
associate-/r*80.7%
Simplified80.7%
Taylor expanded in t1 around inf 79.3%
associate-*r/79.3%
neg-mul-179.3%
Simplified79.3%
if -2.1499999999999999e-63 < t1 < 2.99999999999999987e-46Initial program 84.7%
*-commutative84.7%
times-frac96.5%
neg-mul-196.5%
associate-/l*96.5%
associate-*r/96.5%
associate-/l*96.5%
associate-/l/96.5%
neg-mul-196.5%
*-lft-identity96.5%
metadata-eval96.5%
times-frac96.5%
neg-mul-196.5%
remove-double-neg96.5%
neg-mul-196.5%
sub0-neg96.5%
associate--r+96.5%
neg-sub096.5%
div-sub96.5%
distribute-frac-neg96.5%
*-inverses96.5%
metadata-eval96.5%
Simplified96.5%
Taylor expanded in v around 0 97.0%
mul-1-neg97.0%
Simplified97.0%
Taylor expanded in t1 around 0 79.1%
unpow279.1%
associate-*r/82.6%
Simplified82.6%
Final simplification80.7%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -2.6e-64) (not (<= t1 1.55e-47))) (/ (- v) (+ t1 (* u 2.0))) (/ (- v) (* u (/ u t1)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -2.6e-64) || !(t1 <= 1.55e-47)) {
tmp = -v / (t1 + (u * 2.0));
} else {
tmp = -v / (u * (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 <= (-2.6d-64)) .or. (.not. (t1 <= 1.55d-47))) then
tmp = -v / (t1 + (u * 2.0d0))
else
tmp = -v / (u * (u / t1))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -2.6e-64) || !(t1 <= 1.55e-47)) {
tmp = -v / (t1 + (u * 2.0));
} else {
tmp = -v / (u * (u / t1));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -2.6e-64) or not (t1 <= 1.55e-47): tmp = -v / (t1 + (u * 2.0)) else: tmp = -v / (u * (u / t1)) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -2.6e-64) || !(t1 <= 1.55e-47)) tmp = Float64(Float64(-v) / Float64(t1 + Float64(u * 2.0))); else tmp = Float64(Float64(-v) / Float64(u * Float64(u / t1))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -2.6e-64) || ~((t1 <= 1.55e-47))) tmp = -v / (t1 + (u * 2.0)); else tmp = -v / (u * (u / t1)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -2.6e-64], N[Not[LessEqual[t1, 1.55e-47]], $MachinePrecision]], N[((-v) / N[(t1 + N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(u * N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.6 \cdot 10^{-64} \lor \neg \left(t1 \leq 1.55 \cdot 10^{-47}\right):\\
\;\;\;\;\frac{-v}{t1 + u \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{u \cdot \frac{u}{t1}}\\
\end{array}
\end{array}
if t1 < -2.6e-64 or 1.5499999999999999e-47 < t1 Initial program 60.6%
*-commutative60.6%
times-frac99.9%
neg-mul-199.9%
associate-/l*99.9%
associate-*r/99.9%
associate-/l*99.9%
associate-/l/99.9%
neg-mul-199.9%
*-lft-identity99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub0-neg99.9%
associate--r+99.9%
neg-sub099.9%
div-sub99.9%
distribute-frac-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in v around 0 96.1%
mul-1-neg96.1%
Simplified96.1%
Taylor expanded in t1 around inf 84.7%
*-commutative84.7%
Simplified84.7%
if -2.6e-64 < t1 < 1.5499999999999999e-47Initial program 84.7%
*-commutative84.7%
times-frac96.5%
neg-mul-196.5%
associate-/l*96.5%
associate-*r/96.5%
associate-/l*96.5%
associate-/l/96.5%
neg-mul-196.5%
*-lft-identity96.5%
metadata-eval96.5%
times-frac96.5%
neg-mul-196.5%
remove-double-neg96.5%
neg-mul-196.5%
sub0-neg96.5%
associate--r+96.5%
neg-sub096.5%
div-sub96.5%
distribute-frac-neg96.5%
*-inverses96.5%
metadata-eval96.5%
Simplified96.5%
Taylor expanded in v around 0 97.0%
mul-1-neg97.0%
Simplified97.0%
Taylor expanded in t1 around 0 79.1%
unpow279.1%
associate-*r/82.6%
Simplified82.6%
Final simplification83.8%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -3.3e-63) (not (<= t1 2.2e-46))) (/ (- v) (+ t1 (* u 2.0))) (/ (- v) (/ u (/ t1 u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3.3e-63) || !(t1 <= 2.2e-46)) {
tmp = -v / (t1 + (u * 2.0));
} else {
tmp = -v / (u / (t1 / u));
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if ((t1 <= (-3.3d-63)) .or. (.not. (t1 <= 2.2d-46))) then
tmp = -v / (t1 + (u * 2.0d0))
else
tmp = -v / (u / (t1 / u))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3.3e-63) || !(t1 <= 2.2e-46)) {
tmp = -v / (t1 + (u * 2.0));
} else {
tmp = -v / (u / (t1 / u));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -3.3e-63) or not (t1 <= 2.2e-46): tmp = -v / (t1 + (u * 2.0)) else: tmp = -v / (u / (t1 / u)) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -3.3e-63) || !(t1 <= 2.2e-46)) tmp = Float64(Float64(-v) / Float64(t1 + Float64(u * 2.0))); else tmp = Float64(Float64(-v) / Float64(u / Float64(t1 / u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -3.3e-63) || ~((t1 <= 2.2e-46))) tmp = -v / (t1 + (u * 2.0)); else tmp = -v / (u / (t1 / u)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -3.3e-63], N[Not[LessEqual[t1, 2.2e-46]], $MachinePrecision]], N[((-v) / N[(t1 + N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(u / N[(t1 / u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3.3 \cdot 10^{-63} \lor \neg \left(t1 \leq 2.2 \cdot 10^{-46}\right):\\
\;\;\;\;\frac{-v}{t1 + u \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{\frac{u}{\frac{t1}{u}}}\\
\end{array}
\end{array}
if t1 < -3.29999999999999994e-63 or 2.2000000000000001e-46 < t1 Initial program 60.6%
*-commutative60.6%
times-frac99.9%
neg-mul-199.9%
associate-/l*99.9%
associate-*r/99.9%
associate-/l*99.9%
associate-/l/99.9%
neg-mul-199.9%
*-lft-identity99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub0-neg99.9%
associate--r+99.9%
neg-sub099.9%
div-sub99.9%
distribute-frac-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in v around 0 96.1%
mul-1-neg96.1%
Simplified96.1%
Taylor expanded in t1 around inf 84.7%
*-commutative84.7%
Simplified84.7%
if -3.29999999999999994e-63 < t1 < 2.2000000000000001e-46Initial program 84.7%
*-commutative84.7%
times-frac96.5%
neg-mul-196.5%
associate-/l*96.5%
associate-*r/96.5%
associate-/l*96.5%
associate-/l/96.5%
neg-mul-196.5%
*-lft-identity96.5%
metadata-eval96.5%
times-frac96.5%
neg-mul-196.5%
remove-double-neg96.5%
neg-mul-196.5%
sub0-neg96.5%
associate--r+96.5%
neg-sub096.5%
div-sub96.5%
distribute-frac-neg96.5%
*-inverses96.5%
metadata-eval96.5%
Simplified96.5%
Taylor expanded in v around 0 97.0%
mul-1-neg97.0%
Simplified97.0%
Taylor expanded in t1 around 0 79.1%
unpow279.1%
associate-*r/82.6%
Simplified82.6%
associate-*r/79.1%
associate-/l*82.6%
Applied egg-rr82.6%
Final simplification83.8%
(FPCore (u v t1) :precision binary64 (if (or (<= u -1.05e+57) (not (<= u 2.55e+175))) (* v (/ t1 (* u u))) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.05e+57) || !(u <= 2.55e+175)) {
tmp = v * (t1 / (u * u));
} else {
tmp = -v / 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.05d+57)) .or. (.not. (u <= 2.55d+175))) then
tmp = v * (t1 / (u * u))
else
tmp = -v / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.05e+57) || !(u <= 2.55e+175)) {
tmp = v * (t1 / (u * u));
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -1.05e+57) or not (u <= 2.55e+175): tmp = v * (t1 / (u * u)) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -1.05e+57) || !(u <= 2.55e+175)) tmp = Float64(v * Float64(t1 / Float64(u * u))); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -1.05e+57) || ~((u <= 2.55e+175))) tmp = v * (t1 / (u * u)); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.05e+57], N[Not[LessEqual[u, 2.55e+175]], $MachinePrecision]], N[(v * N[(t1 / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.05 \cdot 10^{+57} \lor \neg \left(u \leq 2.55 \cdot 10^{+175}\right):\\
\;\;\;\;v \cdot \frac{t1}{u \cdot u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -1.04999999999999995e57 or 2.55000000000000003e175 < u Initial program 80.7%
associate-/l*81.1%
neg-mul-181.1%
*-commutative81.1%
associate-*r/81.1%
associate-/l*81.1%
neg-mul-181.1%
associate-/r*92.9%
Simplified92.9%
Taylor expanded in t1 around 0 79.6%
mul-1-neg79.6%
associate-/l*79.9%
distribute-neg-frac79.9%
unpow279.9%
Simplified79.9%
associate-/r/79.9%
add-sqr-sqrt33.2%
sqrt-unprod66.5%
sqr-neg66.5%
sqrt-unprod44.4%
add-sqr-sqrt76.3%
Applied egg-rr76.3%
if -1.04999999999999995e57 < u < 2.55000000000000003e175Initial program 66.4%
associate-/l*66.8%
neg-mul-166.8%
*-commutative66.8%
associate-*r/66.3%
associate-/l*66.3%
neg-mul-166.3%
associate-/r*79.9%
Simplified79.9%
Taylor expanded in t1 around inf 74.2%
associate-*r/74.2%
neg-mul-174.2%
Simplified74.2%
Final simplification74.9%
(FPCore (u v t1) :precision binary64 (if (or (<= u -4.8e+158) (not (<= u 2.65e+231))) (/ (* v (- 0.5)) u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -4.8e+158) || !(u <= 2.65e+231)) {
tmp = (v * -0.5) / u;
} else {
tmp = -v / 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 <= (-4.8d+158)) .or. (.not. (u <= 2.65d+231))) then
tmp = (v * -0.5d0) / u
else
tmp = -v / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -4.8e+158) || !(u <= 2.65e+231)) {
tmp = (v * -0.5) / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -4.8e+158) or not (u <= 2.65e+231): tmp = (v * -0.5) / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -4.8e+158) || !(u <= 2.65e+231)) tmp = Float64(Float64(v * Float64(-0.5)) / u); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -4.8e+158) || ~((u <= 2.65e+231))) tmp = (v * -0.5) / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -4.8e+158], N[Not[LessEqual[u, 2.65e+231]], $MachinePrecision]], N[(N[(v * (-0.5)), $MachinePrecision] / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -4.8 \cdot 10^{+158} \lor \neg \left(u \leq 2.65 \cdot 10^{+231}\right):\\
\;\;\;\;\frac{v \cdot \left(-0.5\right)}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -4.80000000000000016e158 or 2.6499999999999999e231 < u Initial program 82.1%
*-commutative82.1%
times-frac99.9%
neg-mul-199.9%
associate-/l*99.9%
associate-*r/99.9%
associate-/l*99.9%
associate-/l/99.9%
neg-mul-199.9%
*-lft-identity99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub0-neg99.9%
associate--r+99.9%
neg-sub099.9%
div-sub99.9%
distribute-frac-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in v around 0 88.3%
mul-1-neg88.3%
Simplified88.3%
distribute-rgt-in88.3%
*-un-lft-identity88.3%
associate-+l+88.3%
Applied egg-rr88.3%
Taylor expanded in t1 around 0 82.3%
unpow282.3%
associate-*l/83.0%
distribute-rgt-out83.0%
Simplified83.0%
Taylor expanded in u around 0 49.1%
associate-*r/49.1%
Simplified49.1%
if -4.80000000000000016e158 < u < 2.6499999999999999e231Initial program 68.2%
associate-/l*68.7%
neg-mul-168.7%
*-commutative68.7%
associate-*r/68.3%
associate-/l*68.3%
neg-mul-168.3%
associate-/r*81.7%
Simplified81.7%
Taylor expanded in t1 around inf 66.4%
associate-*r/66.4%
neg-mul-166.4%
Simplified66.4%
Final simplification63.0%
(FPCore (u v t1) :precision binary64 (if (or (<= u -8.5e+159) (not (<= u 1.05e+229))) (/ (- v) u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -8.5e+159) || !(u <= 1.05e+229)) {
tmp = -v / u;
} else {
tmp = -v / 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 <= (-8.5d+159)) .or. (.not. (u <= 1.05d+229))) then
tmp = -v / u
else
tmp = -v / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -8.5e+159) || !(u <= 1.05e+229)) {
tmp = -v / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -8.5e+159) or not (u <= 1.05e+229): tmp = -v / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -8.5e+159) || !(u <= 1.05e+229)) tmp = Float64(Float64(-v) / u); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -8.5e+159) || ~((u <= 1.05e+229))) tmp = -v / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -8.5e+159], N[Not[LessEqual[u, 1.05e+229]], $MachinePrecision]], N[((-v) / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -8.5 \cdot 10^{+159} \lor \neg \left(u \leq 1.05 \cdot 10^{+229}\right):\\
\;\;\;\;\frac{-v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -8.50000000000000076e159 or 1.04999999999999994e229 < u Initial program 82.1%
*-commutative82.1%
times-frac99.9%
neg-mul-199.9%
associate-/l*99.9%
associate-*r/99.9%
associate-/l*99.9%
associate-/l/99.9%
neg-mul-199.9%
*-lft-identity99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub0-neg99.9%
associate--r+99.9%
neg-sub099.9%
div-sub99.9%
distribute-frac-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t1 around inf 59.4%
Taylor expanded in t1 around 0 49.0%
associate-*r/49.0%
neg-mul-149.0%
Simplified49.0%
if -8.50000000000000076e159 < u < 1.04999999999999994e229Initial program 68.2%
associate-/l*68.7%
neg-mul-168.7%
*-commutative68.7%
associate-*r/68.3%
associate-/l*68.3%
neg-mul-168.3%
associate-/r*81.7%
Simplified81.7%
Taylor expanded in t1 around inf 66.4%
associate-*r/66.4%
neg-mul-166.4%
Simplified66.4%
Final simplification63.0%
(FPCore (u v t1) :precision binary64 (/ (- v) t1))
double code(double u, double v, double t1) {
return -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 = -v / t1
end function
public static double code(double u, double v, double t1) {
return -v / t1;
}
def code(u, v, t1): return -v / t1
function code(u, v, t1) return Float64(Float64(-v) / t1) end
function tmp = code(u, v, t1) tmp = -v / t1; end
code[u_, v_, t1_] := N[((-v) / t1), $MachinePrecision]
\begin{array}{l}
\\
\frac{-v}{t1}
\end{array}
Initial program 71.0%
associate-/l*71.4%
neg-mul-171.4%
*-commutative71.4%
associate-*r/71.1%
associate-/l*71.1%
neg-mul-171.1%
associate-/r*84.1%
Simplified84.1%
Taylor expanded in t1 around inf 57.1%
associate-*r/57.1%
neg-mul-157.1%
Simplified57.1%
Final simplification57.1%
herbie shell --seed 2023238
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))