
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1): return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 * v) / ((t1 + u) * (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1): return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 * v) / ((t1 + u) * (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}
(FPCore (u v t1) :precision binary64 (* (/ (- t1) (+ t1 u)) (/ v (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 / (t1 + u)) * (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 = (-t1 / (t1 + u)) * (v / (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 / (t1 + u)) * (v / (t1 + u));
}
def code(u, v, t1): return (-t1 / (t1 + u)) * (v / (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) / Float64(t1 + u)) * Float64(v / Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 / (t1 + u)) * (v / (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}
\end{array}
Initial program 75.9%
times-frac97.9%
Simplified97.9%
Final simplification97.9%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -2100000000.0) (not (<= t1 4.8e+42))) (/ v (- (* u -2.0) t1)) (* (/ (- t1) u) (/ v u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -2100000000.0) || !(t1 <= 4.8e+42)) {
tmp = v / ((u * -2.0) - 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 <= (-2100000000.0d0)) .or. (.not. (t1 <= 4.8d+42))) then
tmp = v / ((u * (-2.0d0)) - 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 <= -2100000000.0) || !(t1 <= 4.8e+42)) {
tmp = v / ((u * -2.0) - t1);
} else {
tmp = (-t1 / u) * (v / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -2100000000.0) or not (t1 <= 4.8e+42): tmp = v / ((u * -2.0) - t1) else: tmp = (-t1 / u) * (v / u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -2100000000.0) || !(t1 <= 4.8e+42)) tmp = Float64(v / Float64(Float64(u * -2.0) - t1)); else tmp = Float64(Float64(Float64(-t1) / u) * Float64(v / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -2100000000.0) || ~((t1 <= 4.8e+42))) tmp = v / ((u * -2.0) - t1); else tmp = (-t1 / u) * (v / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -2100000000.0], N[Not[LessEqual[t1, 4.8e+42]], $MachinePrecision]], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], N[(N[((-t1) / u), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2100000000 \lor \neg \left(t1 \leq 4.8 \cdot 10^{+42}\right):\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\
\end{array}
\end{array}
if t1 < -2.1e9 or 4.7999999999999997e42 < t1 Initial program 65.9%
associate-/r*80.0%
*-commutative80.0%
associate-/l*99.9%
associate-/l/96.9%
+-commutative96.9%
remove-double-neg96.9%
unsub-neg96.9%
div-sub96.9%
sub-neg96.9%
*-inverses96.9%
metadata-eval96.9%
Simplified96.9%
Taylor expanded in t1 around inf 87.8%
mul-1-neg87.8%
unsub-neg87.8%
*-commutative87.8%
Simplified87.8%
if -2.1e9 < t1 < 4.7999999999999997e42Initial program 83.7%
times-frac96.4%
Simplified96.4%
Taylor expanded in t1 around 0 75.7%
Taylor expanded in t1 around 0 78.0%
associate-*r/78.0%
mul-1-neg78.0%
Simplified78.0%
Final simplification82.3%
(FPCore (u v t1) :precision binary64 (if (or (<= u -3.9e+191) (not (<= u 4.8e+217))) (/ t1 (* t1 (/ u v))) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -3.9e+191) || !(u <= 4.8e+217)) {
tmp = t1 / (t1 * (u / v));
} 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 <= (-3.9d+191)) .or. (.not. (u <= 4.8d+217))) then
tmp = t1 / (t1 * (u / v))
else
tmp = -v / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -3.9e+191) || !(u <= 4.8e+217)) {
tmp = t1 / (t1 * (u / v));
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -3.9e+191) or not (u <= 4.8e+217): tmp = t1 / (t1 * (u / v)) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -3.9e+191) || !(u <= 4.8e+217)) tmp = Float64(t1 / Float64(t1 * Float64(u / v))); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -3.9e+191) || ~((u <= 4.8e+217))) tmp = t1 / (t1 * (u / v)); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -3.9e+191], N[Not[LessEqual[u, 4.8e+217]], $MachinePrecision]], N[(t1 / N[(t1 * N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.9 \cdot 10^{+191} \lor \neg \left(u \leq 4.8 \cdot 10^{+217}\right):\\
\;\;\;\;\frac{t1}{t1 \cdot \frac{u}{v}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -3.9e191 or 4.7999999999999996e217 < u Initial program 82.8%
times-frac97.8%
Simplified97.8%
*-commutative97.8%
clear-num97.8%
frac-2neg97.8%
frac-times96.5%
*-un-lft-identity96.5%
remove-double-neg96.5%
distribute-neg-in96.5%
add-sqr-sqrt47.6%
sqrt-unprod91.9%
sqr-neg91.9%
sqrt-unprod47.8%
add-sqr-sqrt95.4%
sub-neg95.4%
Applied egg-rr95.4%
Taylor expanded in t1 around 0 95.4%
Taylor expanded in u around 0 46.6%
associate-*r/46.5%
Simplified46.5%
if -3.9e191 < u < 4.7999999999999996e217Initial program 74.6%
times-frac98.0%
Simplified98.0%
Taylor expanded in t1 around inf 59.7%
associate-*r/59.7%
neg-mul-159.7%
Simplified59.7%
Final simplification57.5%
(FPCore (u v t1) :precision binary64 (if (or (<= u -9.5e+33) (not (<= u 1.9e+40))) (/ t1 (/ u (/ v u))) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -9.5e+33) || !(u <= 1.9e+40)) {
tmp = t1 / (u / (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 <= (-9.5d+33)) .or. (.not. (u <= 1.9d+40))) then
tmp = t1 / (u / (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 <= -9.5e+33) || !(u <= 1.9e+40)) {
tmp = t1 / (u / (v / u));
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -9.5e+33) or not (u <= 1.9e+40): tmp = t1 / (u / (v / u)) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -9.5e+33) || !(u <= 1.9e+40)) tmp = Float64(t1 / Float64(u / 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 <= -9.5e+33) || ~((u <= 1.9e+40))) tmp = t1 / (u / (v / u)); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -9.5e+33], N[Not[LessEqual[u, 1.9e+40]], $MachinePrecision]], N[(t1 / N[(u / N[(v / u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -9.5 \cdot 10^{+33} \lor \neg \left(u \leq 1.9 \cdot 10^{+40}\right):\\
\;\;\;\;\frac{t1}{\frac{u}{\frac{v}{u}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -9.5000000000000003e33 or 1.90000000000000002e40 < u Initial program 81.3%
times-frac97.2%
Simplified97.2%
Taylor expanded in t1 around 0 83.8%
Taylor expanded in t1 around 0 83.0%
associate-*r/83.0%
mul-1-neg83.0%
Simplified83.0%
associate-*l/85.5%
associate-/l*85.8%
add-sqr-sqrt49.4%
sqrt-unprod60.7%
sqr-neg60.7%
sqrt-unprod24.1%
add-sqr-sqrt63.4%
Applied egg-rr63.4%
if -9.5000000000000003e33 < u < 1.90000000000000002e40Initial program 71.4%
times-frac98.5%
Simplified98.5%
Taylor expanded in t1 around inf 75.6%
associate-*r/75.6%
neg-mul-175.6%
Simplified75.6%
Final simplification70.1%
(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(v / Float64(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[(v / N[(N[(t1 + u), $MachinePrecision] * N[(-1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{\left(t1 + u\right) \cdot \left(-1 - \frac{u}{t1}\right)}
\end{array}
Initial program 75.9%
associate-/r*85.7%
*-commutative85.7%
associate-/l*97.6%
associate-/l/95.5%
+-commutative95.5%
remove-double-neg95.5%
unsub-neg95.5%
div-sub95.5%
sub-neg95.5%
*-inverses95.5%
metadata-eval95.5%
Simplified95.5%
Taylor expanded in v around 0 95.5%
associate-/r*97.9%
fma-neg97.9%
metadata-eval97.9%
Simplified97.9%
Taylor expanded in v around 0 95.5%
associate-/r*97.9%
mul-1-neg97.9%
neg-sub097.9%
associate--r+97.9%
+-commutative97.9%
associate--r+97.9%
metadata-eval97.9%
Simplified97.9%
expm1-log1p-u84.2%
expm1-udef52.7%
associate-/l/53.4%
*-commutative53.4%
Applied egg-rr53.4%
expm1-def81.7%
expm1-log1p95.5%
+-commutative95.5%
Simplified95.5%
Final simplification95.5%
(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 75.9%
associate-/r*85.7%
*-commutative85.7%
associate-/l*97.6%
associate-/l/95.5%
+-commutative95.5%
remove-double-neg95.5%
unsub-neg95.5%
div-sub95.5%
sub-neg95.5%
*-inverses95.5%
metadata-eval95.5%
Simplified95.5%
Taylor expanded in v around 0 95.5%
associate-/r*97.9%
fma-neg97.9%
metadata-eval97.9%
Simplified97.9%
Taylor expanded in v around 0 95.5%
associate-/r*97.9%
mul-1-neg97.9%
neg-sub097.9%
associate--r+97.9%
+-commutative97.9%
associate--r+97.9%
metadata-eval97.9%
Simplified97.9%
Final simplification97.9%
(FPCore (u v t1) :precision binary64 (if (or (<= u -1.6e+191) (not (<= u 6.2e+216))) (* (/ v u) -0.5) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.6e+191) || !(u <= 6.2e+216)) {
tmp = (v / u) * -0.5;
} 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.6d+191)) .or. (.not. (u <= 6.2d+216))) then
tmp = (v / u) * (-0.5d0)
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.6e+191) || !(u <= 6.2e+216)) {
tmp = (v / u) * -0.5;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -1.6e+191) or not (u <= 6.2e+216): tmp = (v / u) * -0.5 else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -1.6e+191) || !(u <= 6.2e+216)) tmp = Float64(Float64(v / u) * -0.5); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -1.6e+191) || ~((u <= 6.2e+216))) tmp = (v / u) * -0.5; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.6e+191], N[Not[LessEqual[u, 6.2e+216]], $MachinePrecision]], N[(N[(v / u), $MachinePrecision] * -0.5), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.6 \cdot 10^{+191} \lor \neg \left(u \leq 6.2 \cdot 10^{+216}\right):\\
\;\;\;\;\frac{v}{u} \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -1.6000000000000001e191 or 6.20000000000000007e216 < u Initial program 82.8%
associate-/r*92.9%
*-commutative92.9%
associate-/l*97.7%
associate-/l/89.9%
+-commutative89.9%
remove-double-neg89.9%
unsub-neg89.9%
div-sub89.9%
sub-neg89.9%
*-inverses89.9%
metadata-eval89.9%
Simplified89.9%
Taylor expanded in t1 around inf 41.2%
mul-1-neg41.2%
unsub-neg41.2%
*-commutative41.2%
Simplified41.2%
Taylor expanded in u around inf 41.2%
if -1.6000000000000001e191 < u < 6.20000000000000007e216Initial program 74.6%
times-frac98.0%
Simplified98.0%
Taylor expanded in t1 around inf 59.7%
associate-*r/59.7%
neg-mul-159.7%
Simplified59.7%
Final simplification56.6%
(FPCore (u v t1) :precision binary64 (if (<= u -2.1e+191) (/ -0.5 (/ u v)) (if (<= u 6.5e+216) (/ (- v) t1) (* (/ v u) -0.5))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -2.1e+191) {
tmp = -0.5 / (u / v);
} else if (u <= 6.5e+216) {
tmp = -v / t1;
} else {
tmp = (v / u) * -0.5;
}
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.1d+191)) then
tmp = (-0.5d0) / (u / v)
else if (u <= 6.5d+216) then
tmp = -v / t1
else
tmp = (v / u) * (-0.5d0)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -2.1e+191) {
tmp = -0.5 / (u / v);
} else if (u <= 6.5e+216) {
tmp = -v / t1;
} else {
tmp = (v / u) * -0.5;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -2.1e+191: tmp = -0.5 / (u / v) elif u <= 6.5e+216: tmp = -v / t1 else: tmp = (v / u) * -0.5 return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -2.1e+191) tmp = Float64(-0.5 / Float64(u / v)); elseif (u <= 6.5e+216) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(v / u) * -0.5); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -2.1e+191) tmp = -0.5 / (u / v); elseif (u <= 6.5e+216) tmp = -v / t1; else tmp = (v / u) * -0.5; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -2.1e+191], N[(-0.5 / N[(u / v), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 6.5e+216], N[((-v) / t1), $MachinePrecision], N[(N[(v / u), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.1 \cdot 10^{+191}:\\
\;\;\;\;\frac{-0.5}{\frac{u}{v}}\\
\mathbf{elif}\;u \leq 6.5 \cdot 10^{+216}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u} \cdot -0.5\\
\end{array}
\end{array}
if u < -2.1000000000000001e191Initial program 81.8%
associate-/r*90.6%
*-commutative90.6%
associate-/l*95.7%
associate-/l/86.8%
+-commutative86.8%
remove-double-neg86.8%
unsub-neg86.8%
div-sub86.8%
sub-neg86.8%
*-inverses86.8%
metadata-eval86.8%
Simplified86.8%
Taylor expanded in t1 around inf 40.6%
mul-1-neg40.6%
unsub-neg40.6%
*-commutative40.6%
Simplified40.6%
Taylor expanded in u around inf 40.6%
associate-*r/40.6%
associate-/l*41.6%
Simplified41.6%
if -2.1000000000000001e191 < u < 6.50000000000000029e216Initial program 74.6%
times-frac98.0%
Simplified98.0%
Taylor expanded in t1 around inf 59.7%
associate-*r/59.7%
neg-mul-159.7%
Simplified59.7%
if 6.50000000000000029e216 < u Initial program 83.9%
associate-/r*95.2%
*-commutative95.2%
associate-/l*99.7%
associate-/l/93.0%
+-commutative93.0%
remove-double-neg93.0%
unsub-neg93.0%
div-sub93.0%
sub-neg93.0%
*-inverses93.0%
metadata-eval93.0%
Simplified93.0%
Taylor expanded in t1 around inf 41.8%
mul-1-neg41.8%
unsub-neg41.8%
*-commutative41.8%
Simplified41.8%
Taylor expanded in u around inf 41.8%
Final simplification56.7%
(FPCore (u v t1) :precision binary64 (if (or (<= u -1.9e+191) (not (<= u 1.85e+217))) (/ v u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.9e+191) || !(u <= 1.85e+217)) {
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 <= (-1.9d+191)) .or. (.not. (u <= 1.85d+217))) 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 <= -1.9e+191) || !(u <= 1.85e+217)) {
tmp = v / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -1.9e+191) or not (u <= 1.85e+217): tmp = v / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -1.9e+191) || !(u <= 1.85e+217)) tmp = 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 <= -1.9e+191) || ~((u <= 1.85e+217))) tmp = v / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.9e+191], N[Not[LessEqual[u, 1.85e+217]], $MachinePrecision]], N[(v / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.9 \cdot 10^{+191} \lor \neg \left(u \leq 1.85 \cdot 10^{+217}\right):\\
\;\;\;\;\frac{v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -1.8999999999999999e191 or 1.85000000000000005e217 < u Initial program 82.8%
times-frac97.8%
Simplified97.8%
Taylor expanded in t1 around 0 96.2%
frac-2neg96.2%
clear-num96.2%
frac-times95.4%
remove-double-neg95.4%
*-commutative95.4%
*-un-lft-identity95.4%
distribute-neg-in95.4%
add-sqr-sqrt47.6%
sqrt-unprod91.9%
sqr-neg91.9%
sqrt-unprod47.8%
add-sqr-sqrt95.4%
sub-neg95.4%
Applied egg-rr95.4%
*-commutative95.4%
associate-/r*98.2%
associate-/l*92.3%
*-commutative92.3%
Simplified92.3%
Taylor expanded in t1 around inf 40.6%
if -1.8999999999999999e191 < u < 1.85000000000000005e217Initial program 74.6%
times-frac98.0%
Simplified98.0%
Taylor expanded in t1 around inf 59.7%
associate-*r/59.7%
neg-mul-159.7%
Simplified59.7%
Final simplification56.6%
(FPCore (u v t1) :precision binary64 (if (or (<= u -1.7e+191) (not (<= u 3e+219))) (/ (- v) u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.7e+191) || !(u <= 3e+219)) {
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 <= (-1.7d+191)) .or. (.not. (u <= 3d+219))) 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 <= -1.7e+191) || !(u <= 3e+219)) {
tmp = -v / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -1.7e+191) or not (u <= 3e+219): tmp = -v / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -1.7e+191) || !(u <= 3e+219)) 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 <= -1.7e+191) || ~((u <= 3e+219))) tmp = -v / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.7e+191], N[Not[LessEqual[u, 3e+219]], $MachinePrecision]], N[((-v) / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.7 \cdot 10^{+191} \lor \neg \left(u \leq 3 \cdot 10^{+219}\right):\\
\;\;\;\;\frac{-v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -1.70000000000000004e191 or 2.9999999999999997e219 < u Initial program 82.8%
times-frac97.8%
Simplified97.8%
Taylor expanded in t1 around 0 96.2%
Taylor expanded in t1 around inf 41.2%
associate-*r/41.2%
neg-mul-141.2%
Simplified41.2%
if -1.70000000000000004e191 < u < 2.9999999999999997e219Initial program 74.6%
times-frac98.0%
Simplified98.0%
Taylor expanded in t1 around inf 59.7%
associate-*r/59.7%
neg-mul-159.7%
Simplified59.7%
Final simplification56.6%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -2.9e+116) (not (<= t1 9.6e+150))) (/ v t1) (/ v u)))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -2.9e+116) || !(t1 <= 9.6e+150)) {
tmp = v / t1;
} else {
tmp = 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.9d+116)) .or. (.not. (t1 <= 9.6d+150))) then
tmp = v / t1
else
tmp = v / u
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -2.9e+116) || !(t1 <= 9.6e+150)) {
tmp = v / t1;
} else {
tmp = v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -2.9e+116) or not (t1 <= 9.6e+150): tmp = v / t1 else: tmp = v / u return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -2.9e+116) || !(t1 <= 9.6e+150)) tmp = Float64(v / t1); else tmp = Float64(v / u); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -2.9e+116) || ~((t1 <= 9.6e+150))) tmp = v / t1; else tmp = v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -2.9e+116], N[Not[LessEqual[t1, 9.6e+150]], $MachinePrecision]], N[(v / t1), $MachinePrecision], N[(v / u), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.9 \cdot 10^{+116} \lor \neg \left(t1 \leq 9.6 \cdot 10^{+150}\right):\\
\;\;\;\;\frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\
\end{array}
\end{array}
if t1 < -2.9000000000000001e116 or 9.60000000000000011e150 < t1 Initial program 57.0%
times-frac100.0%
Simplified100.0%
*-commutative100.0%
clear-num96.3%
frac-2neg96.3%
frac-times71.3%
*-un-lft-identity71.3%
remove-double-neg71.3%
distribute-neg-in71.3%
add-sqr-sqrt48.7%
sqrt-unprod53.8%
sqr-neg53.8%
sqrt-unprod17.4%
add-sqr-sqrt49.9%
sub-neg49.9%
Applied egg-rr49.9%
Taylor expanded in t1 around inf 42.2%
if -2.9000000000000001e116 < t1 < 9.60000000000000011e150Initial program 82.5%
times-frac97.3%
Simplified97.3%
Taylor expanded in t1 around 0 65.2%
frac-2neg65.2%
clear-num65.2%
frac-times63.0%
remove-double-neg63.0%
*-commutative63.0%
*-un-lft-identity63.0%
distribute-neg-in63.0%
add-sqr-sqrt30.2%
sqrt-unprod64.5%
sqr-neg64.5%
sqrt-unprod33.7%
add-sqr-sqrt63.4%
sub-neg63.4%
Applied egg-rr63.4%
*-commutative63.4%
associate-/r*65.8%
associate-/l*63.9%
*-commutative63.9%
Simplified63.9%
Taylor expanded in t1 around inf 16.5%
Final simplification23.1%
(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(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 75.9%
times-frac97.9%
Simplified97.9%
*-commutative97.9%
clear-num96.6%
frac-2neg96.6%
frac-times85.2%
*-un-lft-identity85.2%
remove-double-neg85.2%
distribute-neg-in85.2%
add-sqr-sqrt45.4%
sqrt-unprod69.9%
sqr-neg69.9%
sqrt-unprod28.7%
add-sqr-sqrt58.9%
sub-neg58.9%
Applied egg-rr58.9%
Taylor expanded in t1 around inf 14.0%
Final simplification14.0%
herbie shell --seed 2023322
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))