
(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 77.0%
times-frac96.6%
Simplified96.6%
Final simplification96.6%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -3.55e-124) (not (<= t1 2.4e-34))) (/ v (- (* u -2.0) t1)) (/ (/ v (/ u t1)) (- t1 u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3.55e-124) || !(t1 <= 2.4e-34)) {
tmp = v / ((u * -2.0) - t1);
} else {
tmp = (v / (u / t1)) / (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.55d-124)) .or. (.not. (t1 <= 2.4d-34))) then
tmp = v / ((u * (-2.0d0)) - t1)
else
tmp = (v / (u / t1)) / (t1 - u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3.55e-124) || !(t1 <= 2.4e-34)) {
tmp = v / ((u * -2.0) - t1);
} else {
tmp = (v / (u / t1)) / (t1 - u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -3.55e-124) or not (t1 <= 2.4e-34): tmp = v / ((u * -2.0) - t1) else: tmp = (v / (u / t1)) / (t1 - u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -3.55e-124) || !(t1 <= 2.4e-34)) tmp = Float64(v / Float64(Float64(u * -2.0) - t1)); else tmp = Float64(Float64(v / Float64(u / t1)) / Float64(t1 - u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -3.55e-124) || ~((t1 <= 2.4e-34))) tmp = v / ((u * -2.0) - t1); else tmp = (v / (u / t1)) / (t1 - u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -3.55e-124], N[Not[LessEqual[t1, 2.4e-34]], $MachinePrecision]], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], N[(N[(v / N[(u / t1), $MachinePrecision]), $MachinePrecision] / N[(t1 - u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3.55 \cdot 10^{-124} \lor \neg \left(t1 \leq 2.4 \cdot 10^{-34}\right):\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{v}{\frac{u}{t1}}}{t1 - u}\\
\end{array}
\end{array}
if t1 < -3.55000000000000019e-124 or 2.39999999999999991e-34 < t1 Initial program 73.5%
associate-/r*86.1%
*-commutative86.1%
associate-/l*99.9%
associate-/l/97.6%
+-commutative97.6%
remove-double-neg97.6%
unsub-neg97.6%
div-sub97.6%
sub-neg97.6%
*-inverses97.6%
metadata-eval97.6%
Simplified97.6%
Taylor expanded in t1 around inf 81.4%
mul-1-neg81.4%
unsub-neg81.4%
*-commutative81.4%
Simplified81.4%
if -3.55000000000000019e-124 < t1 < 2.39999999999999991e-34Initial program 83.9%
times-frac90.1%
Simplified90.1%
Taylor expanded in t1 around 0 79.8%
associate-*r/79.8%
mul-1-neg79.8%
Simplified79.8%
associate-*r/85.1%
frac-2neg85.1%
Applied egg-rr86.0%
Final simplification82.9%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -7.3e-124) (not (<= t1 3.8e-35))) (/ v (- (* u -2.0) t1)) (/ (/ (* t1 v) u) (- t1 u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -7.3e-124) || !(t1 <= 3.8e-35)) {
tmp = v / ((u * -2.0) - t1);
} else {
tmp = ((t1 * 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.3d-124)) .or. (.not. (t1 <= 3.8d-35))) then
tmp = v / ((u * (-2.0d0)) - t1)
else
tmp = ((t1 * 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.3e-124) || !(t1 <= 3.8e-35)) {
tmp = v / ((u * -2.0) - t1);
} else {
tmp = ((t1 * v) / u) / (t1 - u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -7.3e-124) or not (t1 <= 3.8e-35): tmp = v / ((u * -2.0) - t1) else: tmp = ((t1 * v) / u) / (t1 - u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -7.3e-124) || !(t1 <= 3.8e-35)) tmp = Float64(v / Float64(Float64(u * -2.0) - t1)); else tmp = Float64(Float64(Float64(t1 * v) / u) / Float64(t1 - u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -7.3e-124) || ~((t1 <= 3.8e-35))) tmp = v / ((u * -2.0) - t1); else tmp = ((t1 * v) / u) / (t1 - u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -7.3e-124], N[Not[LessEqual[t1, 3.8e-35]], $MachinePrecision]], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t1 * v), $MachinePrecision] / u), $MachinePrecision] / N[(t1 - u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -7.3 \cdot 10^{-124} \lor \neg \left(t1 \leq 3.8 \cdot 10^{-35}\right):\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{t1 \cdot v}{u}}{t1 - u}\\
\end{array}
\end{array}
if t1 < -7.3e-124 or 3.8000000000000001e-35 < t1 Initial program 73.5%
associate-/r*86.1%
*-commutative86.1%
associate-/l*99.9%
associate-/l/97.6%
+-commutative97.6%
remove-double-neg97.6%
unsub-neg97.6%
div-sub97.6%
sub-neg97.6%
*-inverses97.6%
metadata-eval97.6%
Simplified97.6%
Taylor expanded in t1 around inf 81.4%
mul-1-neg81.4%
unsub-neg81.4%
*-commutative81.4%
Simplified81.4%
if -7.3e-124 < t1 < 3.8000000000000001e-35Initial program 83.9%
times-frac90.1%
Simplified90.1%
Taylor expanded in t1 around 0 79.8%
associate-*r/79.8%
mul-1-neg79.8%
Simplified79.8%
associate-*r/85.1%
frac-2neg85.1%
Applied egg-rr86.0%
Taylor expanded in v around 0 86.7%
Final simplification83.2%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -4.1e-110) (not (<= t1 4.6e-42))) (/ v (- (* u -2.0) t1)) (* (/ (- t1) u) (/ v u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -4.1e-110) || !(t1 <= 4.6e-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 <= (-4.1d-110)) .or. (.not. (t1 <= 4.6d-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 <= -4.1e-110) || !(t1 <= 4.6e-42)) {
tmp = v / ((u * -2.0) - t1);
} else {
tmp = (-t1 / u) * (v / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -4.1e-110) or not (t1 <= 4.6e-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 <= -4.1e-110) || !(t1 <= 4.6e-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 <= -4.1e-110) || ~((t1 <= 4.6e-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, -4.1e-110], N[Not[LessEqual[t1, 4.6e-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 -4.1 \cdot 10^{-110} \lor \neg \left(t1 \leq 4.6 \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 < -4.09999999999999983e-110 or 4.60000000000000008e-42 < t1 Initial program 73.2%
associate-/r*86.0%
*-commutative86.0%
associate-/l*99.9%
associate-/l/97.6%
+-commutative97.6%
remove-double-neg97.6%
unsub-neg97.6%
div-sub97.6%
sub-neg97.6%
*-inverses97.6%
metadata-eval97.6%
Simplified97.6%
Taylor expanded in t1 around inf 81.1%
mul-1-neg81.1%
unsub-neg81.1%
*-commutative81.1%
Simplified81.1%
if -4.09999999999999983e-110 < t1 < 4.60000000000000008e-42Initial program 84.3%
times-frac90.3%
Simplified90.3%
Taylor expanded in t1 around 0 80.3%
associate-*r/80.3%
mul-1-neg80.3%
Simplified80.3%
Taylor expanded in t1 around 0 83.6%
Final simplification82.0%
(FPCore (u v t1) :precision binary64 (if (<= u -9.5e+174) (/ (* v -0.5) u) (if (<= u 4.9e+159) (/ (- v) t1) (* v (/ 1.0 (+ t1 u))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -9.5e+174) {
tmp = (v * -0.5) / u;
} else if (u <= 4.9e+159) {
tmp = -v / t1;
} else {
tmp = v * (1.0 / (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 <= (-9.5d+174)) then
tmp = (v * (-0.5d0)) / u
else if (u <= 4.9d+159) then
tmp = -v / t1
else
tmp = v * (1.0d0 / (t1 + u))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -9.5e+174) {
tmp = (v * -0.5) / u;
} else if (u <= 4.9e+159) {
tmp = -v / t1;
} else {
tmp = v * (1.0 / (t1 + u));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -9.5e+174: tmp = (v * -0.5) / u elif u <= 4.9e+159: tmp = -v / t1 else: tmp = v * (1.0 / (t1 + u)) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -9.5e+174) tmp = Float64(Float64(v * -0.5) / u); elseif (u <= 4.9e+159) tmp = Float64(Float64(-v) / t1); else tmp = Float64(v * Float64(1.0 / Float64(t1 + u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -9.5e+174) tmp = (v * -0.5) / u; elseif (u <= 4.9e+159) tmp = -v / t1; else tmp = v * (1.0 / (t1 + u)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -9.5e+174], N[(N[(v * -0.5), $MachinePrecision] / u), $MachinePrecision], If[LessEqual[u, 4.9e+159], N[((-v) / t1), $MachinePrecision], N[(v * N[(1.0 / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -9.5 \cdot 10^{+174}:\\
\;\;\;\;\frac{v \cdot -0.5}{u}\\
\mathbf{elif}\;u \leq 4.9 \cdot 10^{+159}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;v \cdot \frac{1}{t1 + u}\\
\end{array}
\end{array}
if u < -9.4999999999999992e174Initial program 85.2%
associate-/r*96.9%
*-commutative96.9%
associate-/l*99.8%
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 52.7%
mul-1-neg52.7%
unsub-neg52.7%
*-commutative52.7%
Simplified52.7%
Taylor expanded in u around inf 45.1%
associate-*r/45.1%
Simplified45.1%
if -9.4999999999999992e174 < u < 4.8999999999999996e159Initial program 75.3%
times-frac95.5%
Simplified95.5%
Taylor expanded in t1 around inf 65.2%
associate-*r/65.2%
neg-mul-165.2%
Simplified65.2%
if 4.8999999999999996e159 < u Initial program 79.7%
times-frac99.8%
Simplified99.8%
clear-num99.8%
frac-times86.6%
*-un-lft-identity86.6%
frac-2neg86.6%
distribute-neg-in86.6%
add-sqr-sqrt54.0%
sqrt-unprod86.6%
sqr-neg86.6%
sqrt-unprod32.7%
add-sqr-sqrt86.6%
sub-neg86.6%
remove-double-neg86.6%
Applied egg-rr86.6%
Taylor expanded in t1 around inf 42.5%
div-inv42.5%
*-commutative42.5%
*-un-lft-identity42.5%
+-commutative42.5%
Applied egg-rr42.5%
Final simplification60.2%
(FPCore (u v t1) :precision binary64 (if (or (<= u -4.5e+185) (not (<= u 3.2e+204))) (/ v u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -4.5e+185) || !(u <= 3.2e+204)) {
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 <= (-4.5d+185)) .or. (.not. (u <= 3.2d+204))) 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 <= -4.5e+185) || !(u <= 3.2e+204)) {
tmp = v / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -4.5e+185) or not (u <= 3.2e+204): tmp = v / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -4.5e+185) || !(u <= 3.2e+204)) 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 <= -4.5e+185) || ~((u <= 3.2e+204))) tmp = v / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -4.5e+185], N[Not[LessEqual[u, 3.2e+204]], $MachinePrecision]], N[(v / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -4.5 \cdot 10^{+185} \lor \neg \left(u \leq 3.2 \cdot 10^{+204}\right):\\
\;\;\;\;\frac{v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -4.5000000000000002e185 or 3.2e204 < u Initial program 86.8%
times-frac99.9%
Simplified99.9%
clear-num99.8%
frac-times94.3%
*-un-lft-identity94.3%
frac-2neg94.3%
distribute-neg-in94.3%
add-sqr-sqrt54.2%
sqrt-unprod88.9%
sqr-neg88.9%
sqrt-unprod38.3%
add-sqr-sqrt90.6%
sub-neg90.6%
remove-double-neg90.6%
Applied egg-rr90.6%
Taylor expanded in t1 around inf 45.8%
Taylor expanded in t1 around 0 46.0%
if -4.5000000000000002e185 < u < 3.2e204Initial program 74.7%
times-frac95.7%
Simplified95.7%
Taylor expanded in t1 around inf 63.6%
associate-*r/63.6%
neg-mul-163.6%
Simplified63.6%
Final simplification60.2%
(FPCore (u v t1) :precision binary64 (if (<= u -5.4e+173) (/ (* v -0.5) u) (if (<= u 3.7e+204) (/ (- v) t1) (/ v u))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -5.4e+173) {
tmp = (v * -0.5) / u;
} else if (u <= 3.7e+204) {
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 <= (-5.4d+173)) then
tmp = (v * (-0.5d0)) / u
else if (u <= 3.7d+204) 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 <= -5.4e+173) {
tmp = (v * -0.5) / u;
} else if (u <= 3.7e+204) {
tmp = -v / t1;
} else {
tmp = v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -5.4e+173: tmp = (v * -0.5) / u elif u <= 3.7e+204: tmp = -v / t1 else: tmp = v / u return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -5.4e+173) tmp = Float64(Float64(v * -0.5) / u); elseif (u <= 3.7e+204) 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 <= -5.4e+173) tmp = (v * -0.5) / u; elseif (u <= 3.7e+204) tmp = -v / t1; else tmp = v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -5.4e+173], N[(N[(v * -0.5), $MachinePrecision] / u), $MachinePrecision], If[LessEqual[u, 3.7e+204], N[((-v) / t1), $MachinePrecision], N[(v / u), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -5.4 \cdot 10^{+173}:\\
\;\;\;\;\frac{v \cdot -0.5}{u}\\
\mathbf{elif}\;u \leq 3.7 \cdot 10^{+204}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\
\end{array}
\end{array}
if u < -5.4000000000000002e173Initial program 85.2%
associate-/r*96.9%
*-commutative96.9%
associate-/l*99.8%
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 52.7%
mul-1-neg52.7%
unsub-neg52.7%
*-commutative52.7%
Simplified52.7%
Taylor expanded in u around inf 45.1%
associate-*r/45.1%
Simplified45.1%
if -5.4000000000000002e173 < u < 3.7e204Initial program 74.6%
times-frac95.7%
Simplified95.7%
Taylor expanded in t1 around inf 64.3%
associate-*r/64.3%
neg-mul-164.3%
Simplified64.3%
if 3.7e204 < u Initial program 87.2%
times-frac99.9%
Simplified99.9%
clear-num99.9%
frac-times91.6%
*-un-lft-identity91.6%
frac-2neg91.6%
distribute-neg-in91.6%
add-sqr-sqrt50.3%
sqrt-unprod91.6%
sqr-neg91.6%
sqrt-unprod41.4%
add-sqr-sqrt91.6%
sub-neg91.6%
remove-double-neg91.6%
Applied egg-rr91.6%
Taylor expanded in t1 around inf 44.0%
Taylor expanded in t1 around 0 44.0%
Final simplification60.2%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -8.5e+151) (not (<= t1 4.6e+150))) (/ v t1) (/ v u)))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -8.5e+151) || !(t1 <= 4.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 <= (-8.5d+151)) .or. (.not. (t1 <= 4.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 <= -8.5e+151) || !(t1 <= 4.6e+150)) {
tmp = v / t1;
} else {
tmp = v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -8.5e+151) or not (t1 <= 4.6e+150): tmp = v / t1 else: tmp = v / u return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -8.5e+151) || !(t1 <= 4.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 <= -8.5e+151) || ~((t1 <= 4.6e+150))) tmp = v / t1; else tmp = v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -8.5e+151], N[Not[LessEqual[t1, 4.6e+150]], $MachinePrecision]], N[(v / t1), $MachinePrecision], N[(v / u), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -8.5 \cdot 10^{+151} \lor \neg \left(t1 \leq 4.6 \cdot 10^{+150}\right):\\
\;\;\;\;\frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\
\end{array}
\end{array}
if t1 < -8.50000000000000051e151 or 4.60000000000000002e150 < t1 Initial program 46.1%
times-frac99.9%
Simplified99.9%
clear-num99.9%
frac-times98.4%
*-un-lft-identity98.4%
frac-2neg98.4%
distribute-neg-in98.4%
add-sqr-sqrt50.6%
sqrt-unprod47.3%
sqr-neg47.3%
sqrt-unprod21.5%
add-sqr-sqrt47.9%
sub-neg47.9%
remove-double-neg47.9%
Applied egg-rr47.9%
Taylor expanded in t1 around inf 42.0%
if -8.50000000000000051e151 < t1 < 4.60000000000000002e150Initial program 87.1%
times-frac95.5%
Simplified95.5%
clear-num95.4%
frac-times93.6%
*-un-lft-identity93.6%
frac-2neg93.6%
distribute-neg-in93.6%
add-sqr-sqrt50.8%
sqrt-unprod72.1%
sqr-neg72.1%
sqrt-unprod22.7%
add-sqr-sqrt54.0%
sub-neg54.0%
remove-double-neg54.0%
Applied egg-rr54.0%
Taylor expanded in t1 around inf 13.7%
Taylor expanded in t1 around 0 14.7%
Final simplification21.4%
(FPCore (u v t1) :precision binary64 (/ v (- (* u -2.0) t1)))
double code(double u, double v, double t1) {
return v / ((u * -2.0) - t1);
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = v / ((u * (-2.0d0)) - t1)
end function
public static double code(double u, double v, double t1) {
return v / ((u * -2.0) - t1);
}
def code(u, v, t1): return v / ((u * -2.0) - t1)
function code(u, v, t1) return Float64(v / Float64(Float64(u * -2.0) - t1)) end
function tmp = code(u, v, t1) tmp = v / ((u * -2.0) - t1); end
code[u_, v_, t1_] := N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{u \cdot -2 - t1}
\end{array}
Initial program 77.0%
associate-/r*89.3%
*-commutative89.3%
associate-/l*98.4%
associate-/l/94.8%
+-commutative94.8%
remove-double-neg94.8%
unsub-neg94.8%
div-sub94.7%
sub-neg94.7%
*-inverses94.7%
metadata-eval94.7%
Simplified94.7%
Taylor expanded in t1 around inf 61.8%
mul-1-neg61.8%
unsub-neg61.8%
*-commutative61.8%
Simplified61.8%
Final simplification61.8%
(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 77.0%
times-frac96.6%
Simplified96.6%
clear-num96.5%
frac-times94.8%
*-un-lft-identity94.8%
frac-2neg94.8%
distribute-neg-in94.8%
add-sqr-sqrt50.8%
sqrt-unprod66.0%
sqr-neg66.0%
sqrt-unprod22.4%
add-sqr-sqrt52.5%
sub-neg52.5%
remove-double-neg52.5%
Applied egg-rr52.5%
Taylor expanded in t1 around inf 13.1%
Final simplification13.1%
herbie shell --seed 2024019
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))