
(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 (* (/ (- 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 72.6%
times-frac97.9%
Simplified97.9%
Final simplification97.9%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -6.5e+72) (not (<= t1 1.25e-26))) (/ v (- (* u -2.0) t1)) (* (/ v u) (/ (- t1) u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -6.5e+72) || !(t1 <= 1.25e-26)) {
tmp = v / ((u * -2.0) - t1);
} 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 <= (-6.5d+72)) .or. (.not. (t1 <= 1.25d-26))) then
tmp = v / ((u * (-2.0d0)) - t1)
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 <= -6.5e+72) || !(t1 <= 1.25e-26)) {
tmp = v / ((u * -2.0) - t1);
} else {
tmp = (v / u) * (-t1 / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -6.5e+72) or not (t1 <= 1.25e-26): tmp = v / ((u * -2.0) - t1) else: tmp = (v / u) * (-t1 / u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -6.5e+72) || !(t1 <= 1.25e-26)) tmp = Float64(v / Float64(Float64(u * -2.0) - t1)); else tmp = Float64(Float64(v / u) * Float64(Float64(-t1) / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -6.5e+72) || ~((t1 <= 1.25e-26))) tmp = v / ((u * -2.0) - t1); else tmp = (v / u) * (-t1 / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -6.5e+72], N[Not[LessEqual[t1, 1.25e-26]], $MachinePrecision]], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], N[(N[(v / u), $MachinePrecision] * N[((-t1) / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -6.5 \cdot 10^{+72} \lor \neg \left(t1 \leq 1.25 \cdot 10^{-26}\right):\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u} \cdot \frac{-t1}{u}\\
\end{array}
\end{array}
if t1 < -6.5000000000000001e72 or 1.25000000000000005e-26 < t1 Initial program 55.1%
associate-/r*69.5%
*-commutative69.5%
associate-/l*100.0%
associate-/l/95.0%
+-commutative95.0%
remove-double-neg95.0%
unsub-neg95.0%
div-sub95.0%
sub-neg95.0%
*-inverses95.0%
metadata-eval95.0%
Simplified95.0%
Taylor expanded in t1 around inf 87.7%
mul-1-neg87.7%
unsub-neg87.7%
*-commutative87.7%
Simplified87.7%
if -6.5000000000000001e72 < t1 < 1.25000000000000005e-26Initial program 85.3%
times-frac96.4%
Simplified96.4%
Taylor expanded in t1 around 0 75.0%
Taylor expanded in t1 around 0 77.8%
associate-*r/77.8%
mul-1-neg77.8%
Simplified77.8%
Final simplification82.0%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -6.5e+72) (not (<= t1 2.5e-25))) (/ v (- (* u -2.0) t1)) (/ (* t1 (/ v u)) (- u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -6.5e+72) || !(t1 <= 2.5e-25)) {
tmp = v / ((u * -2.0) - 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 ((t1 <= (-6.5d+72)) .or. (.not. (t1 <= 2.5d-25))) then
tmp = v / ((u * (-2.0d0)) - 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 ((t1 <= -6.5e+72) || !(t1 <= 2.5e-25)) {
tmp = v / ((u * -2.0) - t1);
} else {
tmp = (t1 * (v / u)) / -u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -6.5e+72) or not (t1 <= 2.5e-25): tmp = v / ((u * -2.0) - t1) else: tmp = (t1 * (v / u)) / -u return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -6.5e+72) || !(t1 <= 2.5e-25)) tmp = Float64(v / Float64(Float64(u * -2.0) - t1)); else tmp = Float64(Float64(t1 * Float64(v / u)) / Float64(-u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -6.5e+72) || ~((t1 <= 2.5e-25))) tmp = v / ((u * -2.0) - t1); else tmp = (t1 * (v / u)) / -u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -6.5e+72], N[Not[LessEqual[t1, 2.5e-25]], $MachinePrecision]], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], N[(N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -6.5 \cdot 10^{+72} \lor \neg \left(t1 \leq 2.5 \cdot 10^{-25}\right):\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1 \cdot \frac{v}{u}}{-u}\\
\end{array}
\end{array}
if t1 < -6.5000000000000001e72 or 2.49999999999999981e-25 < t1 Initial program 55.1%
associate-/r*69.5%
*-commutative69.5%
associate-/l*100.0%
associate-/l/95.0%
+-commutative95.0%
remove-double-neg95.0%
unsub-neg95.0%
div-sub95.0%
sub-neg95.0%
*-inverses95.0%
metadata-eval95.0%
Simplified95.0%
Taylor expanded in t1 around inf 87.7%
mul-1-neg87.7%
unsub-neg87.7%
*-commutative87.7%
Simplified87.7%
if -6.5000000000000001e72 < t1 < 2.49999999999999981e-25Initial program 85.3%
times-frac96.4%
Simplified96.4%
Taylor expanded in t1 around 0 75.0%
Taylor expanded in t1 around 0 77.8%
associate-*r/77.8%
mul-1-neg77.8%
Simplified77.8%
frac-2neg77.8%
remove-double-neg77.8%
associate-*l/79.0%
Applied egg-rr79.0%
Final simplification82.6%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -2.45e+73) (not (<= t1 4.8e-25))) (/ v (- (* u -2.0) t1)) (/ (* v (/ t1 u)) (- u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -2.45e+73) || !(t1 <= 4.8e-25)) {
tmp = v / ((u * -2.0) - 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 <= (-2.45d+73)) .or. (.not. (t1 <= 4.8d-25))) then
tmp = v / ((u * (-2.0d0)) - 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 <= -2.45e+73) || !(t1 <= 4.8e-25)) {
tmp = v / ((u * -2.0) - t1);
} else {
tmp = (v * (t1 / u)) / -u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -2.45e+73) or not (t1 <= 4.8e-25): tmp = v / ((u * -2.0) - t1) else: tmp = (v * (t1 / u)) / -u return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -2.45e+73) || !(t1 <= 4.8e-25)) tmp = Float64(v / Float64(Float64(u * -2.0) - t1)); else tmp = Float64(Float64(v * Float64(t1 / u)) / Float64(-u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -2.45e+73) || ~((t1 <= 4.8e-25))) tmp = v / ((u * -2.0) - t1); else tmp = (v * (t1 / u)) / -u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -2.45e+73], N[Not[LessEqual[t1, 4.8e-25]], $MachinePrecision]], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], N[(N[(v * N[(t1 / u), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.45 \cdot 10^{+73} \lor \neg \left(t1 \leq 4.8 \cdot 10^{-25}\right):\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v \cdot \frac{t1}{u}}{-u}\\
\end{array}
\end{array}
if t1 < -2.45e73 or 4.80000000000000018e-25 < t1 Initial program 55.1%
associate-/r*69.5%
*-commutative69.5%
associate-/l*100.0%
associate-/l/95.0%
+-commutative95.0%
remove-double-neg95.0%
unsub-neg95.0%
div-sub95.0%
sub-neg95.0%
*-inverses95.0%
metadata-eval95.0%
Simplified95.0%
Taylor expanded in t1 around inf 87.7%
mul-1-neg87.7%
unsub-neg87.7%
*-commutative87.7%
Simplified87.7%
if -2.45e73 < t1 < 4.80000000000000018e-25Initial program 85.3%
times-frac96.4%
Simplified96.4%
Taylor expanded in t1 around 0 75.0%
Taylor expanded in t1 around 0 77.8%
associate-*r/77.8%
mul-1-neg77.8%
Simplified77.8%
frac-2neg77.8%
remove-double-neg77.8%
associate-*l/79.0%
Applied egg-rr79.0%
Taylor expanded in t1 around 0 74.9%
associate-*l/79.3%
*-commutative79.3%
Simplified79.3%
Final simplification82.8%
(FPCore (u v t1) :precision binary64 (if (or (<= u -5.5e+160) (not (<= u 3.4e+69))) (* (/ t1 u) (/ v u)) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -5.5e+160) || !(u <= 3.4e+69)) {
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 <= (-5.5d+160)) .or. (.not. (u <= 3.4d+69))) 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 <= -5.5e+160) || !(u <= 3.4e+69)) {
tmp = (t1 / u) * (v / u);
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -5.5e+160) or not (u <= 3.4e+69): tmp = (t1 / u) * (v / u) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -5.5e+160) || !(u <= 3.4e+69)) tmp = Float64(Float64(t1 / 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 <= -5.5e+160) || ~((u <= 3.4e+69))) tmp = (t1 / u) * (v / u); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -5.5e+160], N[Not[LessEqual[u, 3.4e+69]], $MachinePrecision]], N[(N[(t1 / u), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -5.5 \cdot 10^{+160} \lor \neg \left(u \leq 3.4 \cdot 10^{+69}\right):\\
\;\;\;\;\frac{t1}{u} \cdot \frac{v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -5.5e160 or 3.39999999999999986e69 < u Initial program 74.8%
times-frac97.0%
Simplified97.0%
Taylor expanded in t1 around 0 85.0%
Taylor expanded in t1 around 0 85.0%
associate-*r/85.0%
mul-1-neg85.0%
Simplified85.0%
associate-*l/87.8%
associate-/l*84.5%
add-sqr-sqrt55.2%
sqrt-unprod65.3%
sqr-neg65.3%
sqrt-unprod23.4%
add-sqr-sqrt64.8%
Applied egg-rr64.8%
associate-/r/62.5%
*-commutative62.5%
Applied egg-rr62.5%
if -5.5e160 < u < 3.39999999999999986e69Initial program 71.5%
times-frac98.3%
Simplified98.3%
Taylor expanded in t1 around inf 66.8%
associate-*r/66.8%
neg-mul-166.8%
Simplified66.8%
Final simplification65.4%
(FPCore (u v t1) :precision binary64 (if (or (<= u -6.8e+80) (not (<= u 5.1e+64))) (/ t1 (/ u (/ v u))) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -6.8e+80) || !(u <= 5.1e+64)) {
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 <= (-6.8d+80)) .or. (.not. (u <= 5.1d+64))) 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 <= -6.8e+80) || !(u <= 5.1e+64)) {
tmp = t1 / (u / (v / u));
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -6.8e+80) or not (u <= 5.1e+64): tmp = t1 / (u / (v / u)) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -6.8e+80) || !(u <= 5.1e+64)) 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 <= -6.8e+80) || ~((u <= 5.1e+64))) tmp = t1 / (u / (v / u)); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -6.8e+80], N[Not[LessEqual[u, 5.1e+64]], $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 -6.8 \cdot 10^{+80} \lor \neg \left(u \leq 5.1 \cdot 10^{+64}\right):\\
\;\;\;\;\frac{t1}{\frac{u}{\frac{v}{u}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -6.79999999999999984e80 or 5.10000000000000024e64 < u Initial program 74.9%
times-frac97.5%
Simplified97.5%
Taylor expanded in t1 around 0 82.5%
Taylor expanded in t1 around 0 82.4%
associate-*r/82.4%
mul-1-neg82.4%
Simplified82.4%
associate-*l/84.7%
associate-/l*83.9%
add-sqr-sqrt51.5%
sqrt-unprod61.6%
sqr-neg61.6%
sqrt-unprod26.6%
add-sqr-sqrt65.0%
Applied egg-rr65.0%
if -6.79999999999999984e80 < u < 5.10000000000000024e64Initial program 71.0%
times-frac98.1%
Simplified98.1%
Taylor expanded in t1 around inf 68.2%
associate-*r/68.2%
neg-mul-168.2%
Simplified68.2%
Final simplification66.9%
(FPCore (u v t1) :precision binary64 (if (or (<= u -6.5e+160) (not (<= u 1.6e+142))) (/ (- v) u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -6.5e+160) || !(u <= 1.6e+142)) {
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 <= (-6.5d+160)) .or. (.not. (u <= 1.6d+142))) 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 <= -6.5e+160) || !(u <= 1.6e+142)) {
tmp = -v / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -6.5e+160) or not (u <= 1.6e+142): tmp = -v / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -6.5e+160) || !(u <= 1.6e+142)) 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 <= -6.5e+160) || ~((u <= 1.6e+142))) tmp = -v / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -6.5e+160], N[Not[LessEqual[u, 1.6e+142]], $MachinePrecision]], N[((-v) / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -6.5 \cdot 10^{+160} \lor \neg \left(u \leq 1.6 \cdot 10^{+142}\right):\\
\;\;\;\;\frac{-v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -6.4999999999999995e160 or 1.60000000000000003e142 < u Initial program 71.0%
times-frac97.0%
Simplified97.0%
Taylor expanded in t1 around 0 87.4%
Taylor expanded in t1 around inf 39.1%
associate-*r/39.1%
neg-mul-139.1%
Simplified39.1%
if -6.4999999999999995e160 < u < 1.60000000000000003e142Initial program 73.1%
times-frac98.2%
Simplified98.2%
Taylor expanded in t1 around inf 62.9%
associate-*r/62.9%
neg-mul-162.9%
Simplified62.9%
Final simplification56.7%
(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.6%
associate-/r*81.3%
*-commutative81.3%
associate-/l*98.2%
associate-/l/94.5%
+-commutative94.5%
remove-double-neg94.5%
unsub-neg94.5%
div-sub94.5%
sub-neg94.5%
*-inverses94.5%
metadata-eval94.5%
Simplified94.5%
Taylor expanded in v around 0 94.5%
sub-neg94.5%
mul-1-neg94.5%
distribute-neg-in94.5%
associate-/r*97.3%
+-commutative97.3%
distribute-neg-in97.3%
metadata-eval97.3%
sub-neg97.3%
Simplified97.3%
Final simplification97.3%
(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.6%
times-frac97.9%
Simplified97.9%
Taylor expanded in t1 around inf 52.1%
associate-*r/52.1%
neg-mul-152.1%
Simplified52.1%
Final simplification52.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 72.6%
times-frac97.9%
Simplified97.9%
add-sqr-sqrt51.4%
*-un-lft-identity51.4%
times-frac51.4%
Applied egg-rr51.4%
/-rgt-identity51.4%
associate-*r/51.4%
add-sqr-sqrt97.9%
clear-num96.9%
Applied egg-rr96.9%
associate-/r/97.7%
Simplified97.7%
Taylor expanded in t1 around inf 54.1%
Taylor expanded in u around inf 12.5%
Final simplification12.5%
herbie shell --seed 2024014
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))