
(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 (/ (/ 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 72.2%
*-commutative72.2%
times-frac98.4%
neg-mul-198.4%
associate-/l*98.4%
associate-*r/98.5%
associate-/l*98.5%
associate-/l/98.5%
neg-mul-198.5%
*-lft-identity98.5%
metadata-eval98.5%
times-frac98.5%
neg-mul-198.5%
remove-double-neg98.5%
neg-mul-198.5%
sub0-neg98.5%
associate--r+98.5%
neg-sub098.5%
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 -7.8e+30) (not (<= t1 8.2e-61))) (/ (- v) (+ t1 u)) (* t1 (/ (- v) (* u u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -7.8e+30) || !(t1 <= 8.2e-61)) {
tmp = -v / (t1 + u);
} 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 ((t1 <= (-7.8d+30)) .or. (.not. (t1 <= 8.2d-61))) then
tmp = -v / (t1 + u)
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 ((t1 <= -7.8e+30) || !(t1 <= 8.2e-61)) {
tmp = -v / (t1 + u);
} else {
tmp = t1 * (-v / (u * u));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -7.8e+30) or not (t1 <= 8.2e-61): tmp = -v / (t1 + u) else: tmp = t1 * (-v / (u * u)) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -7.8e+30) || !(t1 <= 8.2e-61)) tmp = Float64(Float64(-v) / Float64(t1 + u)); else tmp = Float64(t1 * Float64(Float64(-v) / Float64(u * u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -7.8e+30) || ~((t1 <= 8.2e-61))) tmp = -v / (t1 + u); else tmp = t1 * (-v / (u * u)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -7.8e+30], N[Not[LessEqual[t1, 8.2e-61]], $MachinePrecision]], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(t1 * N[((-v) / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -7.8 \cdot 10^{+30} \lor \neg \left(t1 \leq 8.2 \cdot 10^{-61}\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;t1 \cdot \frac{-v}{u \cdot u}\\
\end{array}
\end{array}
if t1 < -7.80000000000000021e30 or 8.19999999999999998e-61 < t1 Initial program 61.2%
times-frac100.0%
Simplified100.0%
Taylor expanded in t1 around inf 88.7%
if -7.80000000000000021e30 < t1 < 8.19999999999999998e-61Initial program 84.5%
associate-/l*84.3%
neg-mul-184.3%
*-commutative84.3%
associate-*r/84.2%
associate-/l*84.3%
neg-mul-184.3%
associate-/r*91.3%
Simplified91.3%
Taylor expanded in t1 around 0 73.9%
associate-*r/73.9%
neg-mul-173.9%
unpow273.9%
Simplified73.9%
Final simplification81.7%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -3.95e+31) (not (<= t1 1.1e-60))) (/ (- v) (+ t1 u)) (* v (/ (- t1) (* u u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3.95e+31) || !(t1 <= 1.1e-60)) {
tmp = -v / (t1 + u);
} 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 <= (-3.95d+31)) .or. (.not. (t1 <= 1.1d-60))) then
tmp = -v / (t1 + u)
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 <= -3.95e+31) || !(t1 <= 1.1e-60)) {
tmp = -v / (t1 + u);
} else {
tmp = v * (-t1 / (u * u));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -3.95e+31) or not (t1 <= 1.1e-60): tmp = -v / (t1 + u) else: tmp = v * (-t1 / (u * u)) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -3.95e+31) || !(t1 <= 1.1e-60)) tmp = Float64(Float64(-v) / Float64(t1 + u)); else tmp = Float64(v * Float64(Float64(-t1) / Float64(u * u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -3.95e+31) || ~((t1 <= 1.1e-60))) tmp = -v / (t1 + u); else tmp = v * (-t1 / (u * u)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -3.95e+31], N[Not[LessEqual[t1, 1.1e-60]], $MachinePrecision]], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(v * N[((-t1) / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3.95 \cdot 10^{+31} \lor \neg \left(t1 \leq 1.1 \cdot 10^{-60}\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;v \cdot \frac{-t1}{u \cdot u}\\
\end{array}
\end{array}
if t1 < -3.95000000000000015e31 or 1.0999999999999999e-60 < t1 Initial program 61.2%
times-frac100.0%
Simplified100.0%
Taylor expanded in t1 around inf 88.7%
if -3.95000000000000015e31 < t1 < 1.0999999999999999e-60Initial program 84.5%
*-commutative84.5%
times-frac96.7%
neg-mul-196.7%
associate-/l*96.7%
associate-*r/96.8%
associate-/l*96.8%
associate-/l/96.8%
neg-mul-196.8%
*-lft-identity96.8%
metadata-eval96.8%
times-frac96.8%
neg-mul-196.8%
remove-double-neg96.8%
neg-mul-196.8%
sub0-neg96.8%
associate--r+96.8%
neg-sub096.8%
div-sub96.8%
distribute-frac-neg96.8%
*-inverses96.8%
metadata-eval96.8%
Simplified96.8%
Taylor expanded in t1 around 0 74.7%
mul-1-neg74.7%
associate-/l*73.9%
distribute-neg-frac73.9%
unpow273.9%
Simplified73.9%
frac-2neg73.9%
associate-/r/74.0%
add-sqr-sqrt33.6%
sqrt-unprod48.1%
sqr-neg48.1%
sqrt-unprod22.5%
add-sqr-sqrt43.7%
frac-2neg43.7%
add-sqr-sqrt22.5%
sqrt-unprod48.1%
sqr-neg48.1%
sqrt-unprod33.6%
add-sqr-sqrt74.0%
Applied egg-rr74.0%
Final simplification81.7%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -7.8e+30) (not (<= t1 1.3e-60))) (/ (- v) (+ t1 u)) (* (/ (- t1) u) (/ v u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -7.8e+30) || !(t1 <= 1.3e-60)) {
tmp = -v / (t1 + u);
} 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 <= (-7.8d+30)) .or. (.not. (t1 <= 1.3d-60))) then
tmp = -v / (t1 + u)
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 <= -7.8e+30) || !(t1 <= 1.3e-60)) {
tmp = -v / (t1 + u);
} else {
tmp = (-t1 / u) * (v / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -7.8e+30) or not (t1 <= 1.3e-60): tmp = -v / (t1 + u) else: tmp = (-t1 / u) * (v / u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -7.8e+30) || !(t1 <= 1.3e-60)) tmp = Float64(Float64(-v) / Float64(t1 + u)); 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 <= -7.8e+30) || ~((t1 <= 1.3e-60))) tmp = -v / (t1 + u); else tmp = (-t1 / u) * (v / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -7.8e+30], N[Not[LessEqual[t1, 1.3e-60]], $MachinePrecision]], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(N[((-t1) / u), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -7.8 \cdot 10^{+30} \lor \neg \left(t1 \leq 1.3 \cdot 10^{-60}\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\
\end{array}
\end{array}
if t1 < -7.80000000000000021e30 or 1.2999999999999999e-60 < t1 Initial program 61.2%
times-frac100.0%
Simplified100.0%
Taylor expanded in t1 around inf 88.7%
if -7.80000000000000021e30 < t1 < 1.2999999999999999e-60Initial program 84.5%
times-frac96.7%
Simplified96.7%
Taylor expanded in t1 around 0 79.9%
Taylor expanded in t1 around 0 81.0%
associate-*r/81.0%
neg-mul-181.0%
Simplified81.0%
Final simplification85.1%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -7.8e+30) (not (<= t1 8e-61))) (/ (- v) (+ t1 u)) (/ (/ v (/ u t1)) (- u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -7.8e+30) || !(t1 <= 8e-61)) {
tmp = -v / (t1 + u);
} 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 <= (-7.8d+30)) .or. (.not. (t1 <= 8d-61))) then
tmp = -v / (t1 + u)
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 <= -7.8e+30) || !(t1 <= 8e-61)) {
tmp = -v / (t1 + u);
} else {
tmp = (v / (u / t1)) / -u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -7.8e+30) or not (t1 <= 8e-61): tmp = -v / (t1 + u) else: tmp = (v / (u / t1)) / -u return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -7.8e+30) || !(t1 <= 8e-61)) tmp = Float64(Float64(-v) / Float64(t1 + u)); else tmp = Float64(Float64(v / Float64(u / t1)) / Float64(-u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -7.8e+30) || ~((t1 <= 8e-61))) tmp = -v / (t1 + u); else tmp = (v / (u / t1)) / -u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -7.8e+30], N[Not[LessEqual[t1, 8e-61]], $MachinePrecision]], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(N[(v / N[(u / t1), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -7.8 \cdot 10^{+30} \lor \neg \left(t1 \leq 8 \cdot 10^{-61}\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{v}{\frac{u}{t1}}}{-u}\\
\end{array}
\end{array}
if t1 < -7.80000000000000021e30 or 8.0000000000000003e-61 < t1 Initial program 61.2%
times-frac100.0%
Simplified100.0%
Taylor expanded in t1 around inf 88.7%
if -7.80000000000000021e30 < t1 < 8.0000000000000003e-61Initial program 84.5%
*-commutative84.5%
times-frac96.7%
neg-mul-196.7%
associate-/l*96.7%
associate-*r/96.8%
associate-/l*96.8%
associate-/l/96.8%
neg-mul-196.8%
*-lft-identity96.8%
metadata-eval96.8%
times-frac96.8%
neg-mul-196.8%
remove-double-neg96.8%
neg-mul-196.8%
sub0-neg96.8%
associate--r+96.8%
neg-sub096.8%
div-sub96.8%
distribute-frac-neg96.8%
*-inverses96.8%
metadata-eval96.8%
Simplified96.8%
Taylor expanded in t1 around 0 74.7%
mul-1-neg74.7%
associate-/l*73.9%
distribute-neg-frac73.9%
unpow273.9%
Simplified73.9%
expm1-log1p-u66.6%
expm1-udef46.6%
add-sqr-sqrt23.5%
sqrt-unprod44.7%
sqr-neg44.7%
sqrt-unprod21.3%
add-sqr-sqrt43.9%
div-inv43.9%
clear-num43.9%
Applied egg-rr43.9%
expm1-def43.5%
expm1-log1p43.6%
associate-*r/43.7%
times-frac43.7%
*-commutative43.7%
Simplified43.7%
frac-2neg43.7%
clear-num43.7%
frac-times43.8%
*-commutative43.8%
*-un-lft-identity43.8%
add-sqr-sqrt26.5%
sqrt-unprod48.3%
sqr-neg48.3%
sqrt-unprod34.3%
add-sqr-sqrt77.2%
Applied egg-rr77.2%
associate-/l/81.8%
Simplified81.8%
Final simplification85.4%
(FPCore (u v t1) :precision binary64 (if (or (<= u -4e+45) (not (<= u 1e+208))) (* v (/ t1 (* u u))) (/ (- v) (- t1 u))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -4e+45) || !(u <= 1e+208)) {
tmp = v * (t1 / (u * u));
} else {
tmp = -v / (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 ((u <= (-4d+45)) .or. (.not. (u <= 1d+208))) then
tmp = v * (t1 / (u * u))
else
tmp = -v / (t1 - u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -4e+45) || !(u <= 1e+208)) {
tmp = v * (t1 / (u * u));
} else {
tmp = -v / (t1 - u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -4e+45) or not (u <= 1e+208): tmp = v * (t1 / (u * u)) else: tmp = -v / (t1 - u) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -4e+45) || !(u <= 1e+208)) tmp = Float64(v * Float64(t1 / Float64(u * u))); else tmp = Float64(Float64(-v) / Float64(t1 - u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -4e+45) || ~((u <= 1e+208))) tmp = v * (t1 / (u * u)); else tmp = -v / (t1 - u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -4e+45], N[Not[LessEqual[u, 1e+208]], $MachinePrecision]], N[(v * N[(t1 / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(t1 - u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -4 \cdot 10^{+45} \lor \neg \left(u \leq 10^{+208}\right):\\
\;\;\;\;v \cdot \frac{t1}{u \cdot u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1 - u}\\
\end{array}
\end{array}
if u < -3.9999999999999997e45 or 9.9999999999999998e207 < u Initial program 83.3%
*-commutative83.3%
times-frac97.3%
neg-mul-197.3%
associate-/l*97.3%
associate-*r/97.3%
associate-/l*97.3%
associate-/l/97.3%
neg-mul-197.3%
*-lft-identity97.3%
metadata-eval97.3%
times-frac97.3%
neg-mul-197.3%
remove-double-neg97.3%
neg-mul-197.3%
sub0-neg97.3%
associate--r+97.3%
neg-sub097.3%
div-sub97.3%
distribute-frac-neg97.3%
*-inverses97.3%
metadata-eval97.3%
Simplified97.3%
Taylor expanded in t1 around 0 83.2%
mul-1-neg83.2%
associate-/l*83.5%
distribute-neg-frac83.5%
unpow283.5%
Simplified83.5%
add-sqr-sqrt37.5%
sqrt-unprod76.0%
sqr-neg76.0%
sqrt-unprod43.1%
add-sqr-sqrt76.4%
associate-/r/76.4%
Applied egg-rr76.4%
if -3.9999999999999997e45 < u < 9.9999999999999998e207Initial program 68.2%
times-frac98.8%
Simplified98.8%
Taylor expanded in t1 around inf 73.0%
frac-2neg73.0%
div-inv72.8%
add-sqr-sqrt37.5%
sqrt-unprod39.6%
sqr-neg39.6%
sqrt-unprod11.9%
add-sqr-sqrt23.9%
distribute-neg-in23.9%
add-sqr-sqrt14.0%
sqrt-unprod39.1%
sqr-neg39.1%
sqrt-unprod32.1%
add-sqr-sqrt73.4%
sub-neg73.4%
Applied egg-rr73.4%
associate-*r/73.6%
*-rgt-identity73.6%
Simplified73.6%
Final simplification74.4%
(FPCore (u v t1) :precision binary64 (if (or (<= u -3.2e+51) (not (<= u 1.3e+176))) (/ (- v) u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -3.2e+51) || !(u <= 1.3e+176)) {
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 <= (-3.2d+51)) .or. (.not. (u <= 1.3d+176))) 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 <= -3.2e+51) || !(u <= 1.3e+176)) {
tmp = -v / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -3.2e+51) or not (u <= 1.3e+176): tmp = -v / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -3.2e+51) || !(u <= 1.3e+176)) 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 <= -3.2e+51) || ~((u <= 1.3e+176))) tmp = -v / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -3.2e+51], N[Not[LessEqual[u, 1.3e+176]], $MachinePrecision]], N[((-v) / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.2 \cdot 10^{+51} \lor \neg \left(u \leq 1.3 \cdot 10^{+176}\right):\\
\;\;\;\;\frac{-v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -3.2000000000000002e51 or 1.29999999999999995e176 < u Initial program 82.9%
*-commutative82.9%
times-frac97.4%
neg-mul-197.4%
associate-/l*97.4%
associate-*r/97.4%
associate-/l*97.4%
associate-/l/97.4%
neg-mul-197.4%
*-lft-identity97.4%
metadata-eval97.4%
times-frac97.4%
neg-mul-197.4%
remove-double-neg97.4%
neg-mul-197.4%
sub0-neg97.4%
associate--r+97.4%
neg-sub097.4%
div-sub97.4%
distribute-frac-neg97.4%
*-inverses97.4%
metadata-eval97.4%
Simplified97.4%
Taylor expanded in t1 around 0 92.2%
Taylor expanded in u around 0 39.2%
mul-1-neg39.2%
distribute-frac-neg39.2%
Simplified39.2%
if -3.2000000000000002e51 < u < 1.29999999999999995e176Initial program 68.1%
*-commutative68.1%
times-frac98.8%
neg-mul-198.8%
associate-/l*98.8%
associate-*r/98.9%
associate-/l*98.9%
associate-/l/98.9%
neg-mul-198.9%
*-lft-identity98.9%
metadata-eval98.9%
times-frac98.9%
neg-mul-198.9%
remove-double-neg98.9%
neg-mul-198.9%
sub0-neg98.9%
associate--r+98.9%
neg-sub098.9%
div-sub98.9%
distribute-frac-neg98.9%
*-inverses98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in t1 around inf 71.5%
associate-*r/71.5%
neg-mul-171.5%
Simplified71.5%
Final simplification62.4%
(FPCore (u v t1) :precision binary64 (if (<= u -3.2e+51) (/ (- v) u) (if (<= u 1.45e+176) (/ (- v) t1) (/ v u))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -3.2e+51) {
tmp = -v / u;
} else if (u <= 1.45e+176) {
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 (u <= (-3.2d+51)) then
tmp = -v / u
else if (u <= 1.45d+176) 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 (u <= -3.2e+51) {
tmp = -v / u;
} else if (u <= 1.45e+176) {
tmp = -v / t1;
} else {
tmp = v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -3.2e+51: tmp = -v / u elif u <= 1.45e+176: tmp = -v / t1 else: tmp = v / u return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -3.2e+51) tmp = Float64(Float64(-v) / u); elseif (u <= 1.45e+176) tmp = Float64(Float64(-v) / t1); else tmp = Float64(v / u); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -3.2e+51) tmp = -v / u; elseif (u <= 1.45e+176) tmp = -v / t1; else tmp = v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -3.2e+51], N[((-v) / u), $MachinePrecision], If[LessEqual[u, 1.45e+176], N[((-v) / t1), $MachinePrecision], N[(v / u), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.2 \cdot 10^{+51}:\\
\;\;\;\;\frac{-v}{u}\\
\mathbf{elif}\;u \leq 1.45 \cdot 10^{+176}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\
\end{array}
\end{array}
if u < -3.2000000000000002e51Initial program 93.1%
*-commutative93.1%
times-frac97.8%
neg-mul-197.8%
associate-/l*97.8%
associate-*r/97.8%
associate-/l*97.8%
associate-/l/97.8%
neg-mul-197.8%
*-lft-identity97.8%
metadata-eval97.8%
times-frac97.8%
neg-mul-197.8%
remove-double-neg97.8%
neg-mul-197.8%
sub0-neg97.8%
associate--r+97.8%
neg-sub097.8%
div-sub97.8%
distribute-frac-neg97.8%
*-inverses97.8%
metadata-eval97.8%
Simplified97.8%
Taylor expanded in t1 around 0 93.5%
Taylor expanded in u around 0 33.6%
mul-1-neg33.6%
distribute-frac-neg33.6%
Simplified33.6%
if -3.2000000000000002e51 < u < 1.4500000000000001e176Initial program 68.1%
*-commutative68.1%
times-frac98.8%
neg-mul-198.8%
associate-/l*98.8%
associate-*r/98.9%
associate-/l*98.9%
associate-/l/98.9%
neg-mul-198.9%
*-lft-identity98.9%
metadata-eval98.9%
times-frac98.9%
neg-mul-198.9%
remove-double-neg98.9%
neg-mul-198.9%
sub0-neg98.9%
associate--r+98.9%
neg-sub098.9%
div-sub98.9%
distribute-frac-neg98.9%
*-inverses98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in t1 around inf 71.5%
associate-*r/71.5%
neg-mul-171.5%
Simplified71.5%
if 1.4500000000000001e176 < u Initial program 67.7%
times-frac96.8%
Simplified96.8%
Taylor expanded in t1 around inf 51.5%
frac-2neg51.5%
div-inv51.5%
add-sqr-sqrt26.6%
sqrt-unprod47.7%
sqr-neg47.7%
sqrt-unprod21.5%
add-sqr-sqrt47.2%
distribute-neg-in47.2%
add-sqr-sqrt21.8%
sqrt-unprod47.4%
sqr-neg47.4%
sqrt-unprod28.7%
add-sqr-sqrt51.4%
sub-neg51.4%
Applied egg-rr51.4%
associate-*r/51.4%
*-rgt-identity51.4%
Simplified51.4%
Taylor expanded in t1 around 0 47.6%
associate-*r/47.6%
mul-1-neg47.6%
Simplified47.6%
Final simplification62.5%
(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 72.2%
times-frac98.4%
Simplified98.4%
Taylor expanded in t1 around inf 64.1%
Final simplification64.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 72.2%
times-frac98.4%
Simplified98.4%
Taylor expanded in t1 around inf 64.1%
frac-2neg64.1%
div-inv63.9%
add-sqr-sqrt33.8%
sqrt-unprod39.6%
sqr-neg39.6%
sqrt-unprod12.5%
add-sqr-sqrt26.6%
distribute-neg-in26.6%
add-sqr-sqrt14.5%
sqrt-unprod37.8%
sqr-neg37.8%
sqrt-unprod29.1%
add-sqr-sqrt64.3%
sub-neg64.3%
Applied egg-rr64.3%
associate-*r/64.5%
*-rgt-identity64.5%
Simplified64.5%
Final simplification64.5%
(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 72.2%
*-commutative72.2%
times-frac98.4%
neg-mul-198.4%
associate-/l*98.4%
associate-*r/98.5%
associate-/l*98.5%
associate-/l/98.5%
neg-mul-198.5%
*-lft-identity98.5%
metadata-eval98.5%
times-frac98.5%
neg-mul-198.5%
remove-double-neg98.5%
neg-mul-198.5%
sub0-neg98.5%
associate--r+98.5%
neg-sub098.5%
div-sub98.5%
distribute-frac-neg98.5%
*-inverses98.5%
metadata-eval98.5%
Simplified98.5%
Taylor expanded in t1 around inf 55.6%
associate-*r/55.6%
neg-mul-155.6%
Simplified55.6%
Final simplification55.6%
herbie shell --seed 2023230
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))