
(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 13 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 67.9%
times-frac99.0%
Simplified99.0%
Final simplification99.0%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ t1 u))) (t_2 (/ (* (- t1) (/ v u)) u)))
(if (<= t1 -5.6e+49)
t_1
(if (<= t1 -1.15e-176)
t_2
(if (<= t1 1.26e-228)
(/ v (/ (- u) (/ t1 u)))
(if (<= t1 1100000000.0) t_2 t_1))))))
double code(double u, double v, double t1) {
double t_1 = -v / (t1 + u);
double t_2 = (-t1 * (v / u)) / u;
double tmp;
if (t1 <= -5.6e+49) {
tmp = t_1;
} else if (t1 <= -1.15e-176) {
tmp = t_2;
} else if (t1 <= 1.26e-228) {
tmp = v / (-u / (t1 / u));
} else if (t1 <= 1100000000.0) {
tmp = t_2;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = -v / (t1 + u)
t_2 = (-t1 * (v / u)) / u
if (t1 <= (-5.6d+49)) then
tmp = t_1
else if (t1 <= (-1.15d-176)) then
tmp = t_2
else if (t1 <= 1.26d-228) then
tmp = v / (-u / (t1 / u))
else if (t1 <= 1100000000.0d0) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -v / (t1 + u);
double t_2 = (-t1 * (v / u)) / u;
double tmp;
if (t1 <= -5.6e+49) {
tmp = t_1;
} else if (t1 <= -1.15e-176) {
tmp = t_2;
} else if (t1 <= 1.26e-228) {
tmp = v / (-u / (t1 / u));
} else if (t1 <= 1100000000.0) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (t1 + u) t_2 = (-t1 * (v / u)) / u tmp = 0 if t1 <= -5.6e+49: tmp = t_1 elif t1 <= -1.15e-176: tmp = t_2 elif t1 <= 1.26e-228: tmp = v / (-u / (t1 / u)) elif t1 <= 1100000000.0: tmp = t_2 else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(t1 + u)) t_2 = Float64(Float64(Float64(-t1) * Float64(v / u)) / u) tmp = 0.0 if (t1 <= -5.6e+49) tmp = t_1; elseif (t1 <= -1.15e-176) tmp = t_2; elseif (t1 <= 1.26e-228) tmp = Float64(v / Float64(Float64(-u) / Float64(t1 / u))); elseif (t1 <= 1100000000.0) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (t1 + u); t_2 = (-t1 * (v / u)) / u; tmp = 0.0; if (t1 <= -5.6e+49) tmp = t_1; elseif (t1 <= -1.15e-176) tmp = t_2; elseif (t1 <= 1.26e-228) tmp = v / (-u / (t1 / u)); elseif (t1 <= 1100000000.0) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[((-t1) * N[(v / u), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision]}, If[LessEqual[t1, -5.6e+49], t$95$1, If[LessEqual[t1, -1.15e-176], t$95$2, If[LessEqual[t1, 1.26e-228], N[(v / N[((-u) / N[(t1 / u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 1100000000.0], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u}\\
t_2 := \frac{\left(-t1\right) \cdot \frac{v}{u}}{u}\\
\mathbf{if}\;t1 \leq -5.6 \cdot 10^{+49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t1 \leq -1.15 \cdot 10^{-176}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t1 \leq 1.26 \cdot 10^{-228}:\\
\;\;\;\;\frac{v}{\frac{-u}{\frac{t1}{u}}}\\
\mathbf{elif}\;t1 \leq 1100000000:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t1 < -5.5999999999999996e49 or 1.1e9 < t1 Initial program 52.6%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around inf 86.1%
if -5.5999999999999996e49 < t1 < -1.1500000000000001e-176 or 1.25999999999999997e-228 < t1 < 1.1e9Initial program 85.1%
associate-/l*82.0%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in t1 around 0 63.8%
unpow263.8%
Simplified63.8%
frac-2neg63.8%
div-inv62.8%
remove-double-neg62.8%
associate-/l*68.2%
distribute-neg-frac68.2%
Applied egg-rr68.2%
associate-/r/68.2%
associate-*l/68.3%
*-lft-identity68.3%
Simplified68.3%
Taylor expanded in t1 around 0 63.7%
unpow263.7%
associate-/l*63.8%
associate-*r/69.2%
associate-*r/69.2%
neg-mul-169.2%
associate-*r/63.8%
associate-/l*69.2%
associate-/l*70.5%
Simplified70.5%
if -1.1500000000000001e-176 < t1 < 1.25999999999999997e-228Initial program 79.7%
associate-/l*77.5%
associate-/l*85.0%
Simplified85.0%
Taylor expanded in t1 around 0 77.5%
unpow277.5%
Simplified77.5%
associate-/r/86.6%
add-sqr-sqrt32.5%
sqrt-unprod47.3%
sqr-neg47.3%
sqrt-unprod28.7%
add-sqr-sqrt46.8%
Applied egg-rr46.8%
associate-*l/46.9%
associate-/r*47.1%
associate-*r/47.1%
add-sqr-sqrt33.9%
sqrt-prod54.8%
sqr-neg54.8%
sqrt-unprod25.9%
add-sqr-sqrt82.9%
neg-mul-182.9%
associate-/r*82.9%
Applied egg-rr82.9%
associate-/l/82.9%
associate-*r/85.2%
associate-*l/87.5%
*-commutative87.5%
associate-/l*99.7%
*-commutative99.7%
neg-mul-199.7%
Simplified99.7%
Final simplification82.8%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1250000000.0) (not (<= t1 15500000.0))) (/ (- v) (+ t1 u)) (* t1 (/ (- v) (* u u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1250000000.0) || !(t1 <= 15500000.0)) {
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 <= (-1250000000.0d0)) .or. (.not. (t1 <= 15500000.0d0))) 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 <= -1250000000.0) || !(t1 <= 15500000.0)) {
tmp = -v / (t1 + u);
} else {
tmp = t1 * (-v / (u * u));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1250000000.0) or not (t1 <= 15500000.0): tmp = -v / (t1 + u) else: tmp = t1 * (-v / (u * u)) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1250000000.0) || !(t1 <= 15500000.0)) 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 <= -1250000000.0) || ~((t1 <= 15500000.0))) tmp = -v / (t1 + u); else tmp = t1 * (-v / (u * u)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1250000000.0], N[Not[LessEqual[t1, 15500000.0]], $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 -1250000000 \lor \neg \left(t1 \leq 15500000\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;t1 \cdot \frac{-v}{u \cdot u}\\
\end{array}
\end{array}
if t1 < -1.25e9 or 1.55e7 < t1 Initial program 54.2%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around inf 84.3%
if -1.25e9 < t1 < 1.55e7Initial program 83.9%
associate-/l*80.8%
neg-mul-180.8%
*-commutative80.8%
associate-*r/79.1%
associate-/l*79.2%
neg-mul-179.2%
associate-/r*87.9%
Simplified87.9%
Taylor expanded in t1 around 0 68.2%
associate-*r/68.2%
neg-mul-168.2%
unpow268.2%
Simplified68.2%
Final simplification76.8%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.6e+53) (not (<= t1 800000000000.0))) (/ (- v) (+ t1 u)) (* t1 (/ (/ v u) (- u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.6e+53) || !(t1 <= 800000000000.0)) {
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 <= (-1.6d+53)) .or. (.not. (t1 <= 800000000000.0d0))) 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 <= -1.6e+53) || !(t1 <= 800000000000.0)) {
tmp = -v / (t1 + u);
} else {
tmp = t1 * ((v / u) / -u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1.6e+53) or not (t1 <= 800000000000.0): tmp = -v / (t1 + u) else: tmp = t1 * ((v / u) / -u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.6e+53) || !(t1 <= 800000000000.0)) tmp = Float64(Float64(-v) / Float64(t1 + u)); else tmp = Float64(t1 * Float64(Float64(v / u) / Float64(-u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -1.6e+53) || ~((t1 <= 800000000000.0))) tmp = -v / (t1 + u); else tmp = t1 * ((v / u) / -u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.6e+53], N[Not[LessEqual[t1, 800000000000.0]], $MachinePrecision]], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(t1 * N[(N[(v / u), $MachinePrecision] / (-u)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.6 \cdot 10^{+53} \lor \neg \left(t1 \leq 800000000000\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;t1 \cdot \frac{\frac{v}{u}}{-u}\\
\end{array}
\end{array}
if t1 < -1.6e53 or 8e11 < t1 Initial program 52.6%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around inf 86.1%
if -1.6e53 < t1 < 8e11Initial program 83.4%
associate-/l*80.6%
associate-/l*90.7%
Simplified90.7%
Taylor expanded in t1 around 0 68.0%
unpow268.0%
Simplified68.0%
frac-2neg68.0%
div-inv66.6%
remove-double-neg66.6%
associate-/l*72.6%
distribute-neg-frac72.6%
Applied egg-rr72.6%
associate-/r/72.7%
associate-*l/72.7%
*-lft-identity72.7%
Simplified72.7%
Final simplification79.5%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -2.7e+56) (not (<= t1 27000000.0))) (/ (- v) (+ t1 u)) (/ (- t1) (* u (/ u v)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -2.7e+56) || !(t1 <= 27000000.0)) {
tmp = -v / (t1 + u);
} else {
tmp = -t1 / (u * (u / v));
}
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.7d+56)) .or. (.not. (t1 <= 27000000.0d0))) then
tmp = -v / (t1 + u)
else
tmp = -t1 / (u * (u / v))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -2.7e+56) || !(t1 <= 27000000.0)) {
tmp = -v / (t1 + u);
} else {
tmp = -t1 / (u * (u / v));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -2.7e+56) or not (t1 <= 27000000.0): tmp = -v / (t1 + u) else: tmp = -t1 / (u * (u / v)) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -2.7e+56) || !(t1 <= 27000000.0)) tmp = Float64(Float64(-v) / Float64(t1 + u)); else tmp = Float64(Float64(-t1) / Float64(u * Float64(u / v))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -2.7e+56) || ~((t1 <= 27000000.0))) tmp = -v / (t1 + u); else tmp = -t1 / (u * (u / v)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -2.7e+56], N[Not[LessEqual[t1, 27000000.0]], $MachinePrecision]], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[((-t1) / N[(u * N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.7 \cdot 10^{+56} \lor \neg \left(t1 \leq 27000000\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-t1}{u \cdot \frac{u}{v}}\\
\end{array}
\end{array}
if t1 < -2.7000000000000001e56 or 2.7e7 < t1 Initial program 52.6%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around inf 86.1%
if -2.7000000000000001e56 < t1 < 2.7e7Initial program 83.4%
associate-/l*80.6%
associate-/l*90.7%
Simplified90.7%
Taylor expanded in t1 around 0 68.0%
unpow268.0%
Simplified68.0%
Taylor expanded in u around 0 68.0%
unpow268.0%
associate-*r/74.1%
Simplified74.1%
Final simplification80.2%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -3.7e+50) (not (<= t1 200000000.0))) (/ (- v) (+ t1 u)) (/ (/ v u) (- (/ u t1)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3.7e+50) || !(t1 <= 200000000.0)) {
tmp = -v / (t1 + u);
} else {
tmp = (v / u) / -(u / t1);
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if ((t1 <= (-3.7d+50)) .or. (.not. (t1 <= 200000000.0d0))) then
tmp = -v / (t1 + u)
else
tmp = (v / u) / -(u / t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3.7e+50) || !(t1 <= 200000000.0)) {
tmp = -v / (t1 + u);
} else {
tmp = (v / u) / -(u / t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -3.7e+50) or not (t1 <= 200000000.0): tmp = -v / (t1 + u) else: tmp = (v / u) / -(u / t1) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -3.7e+50) || !(t1 <= 200000000.0)) tmp = Float64(Float64(-v) / Float64(t1 + u)); else tmp = Float64(Float64(v / u) / Float64(-Float64(u / t1))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -3.7e+50) || ~((t1 <= 200000000.0))) tmp = -v / (t1 + u); else tmp = (v / u) / -(u / t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -3.7e+50], N[Not[LessEqual[t1, 200000000.0]], $MachinePrecision]], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(N[(v / u), $MachinePrecision] / (-N[(u / t1), $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3.7 \cdot 10^{+50} \lor \neg \left(t1 \leq 200000000\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{v}{u}}{-\frac{u}{t1}}\\
\end{array}
\end{array}
if t1 < -3.7000000000000001e50 or 2e8 < t1 Initial program 52.6%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around inf 86.1%
if -3.7000000000000001e50 < t1 < 2e8Initial program 83.4%
*-commutative83.4%
times-frac98.2%
neg-mul-198.2%
associate-/l*97.5%
associate-*r/97.5%
associate-/l*97.5%
associate-/l/97.5%
neg-mul-197.5%
*-lft-identity97.5%
metadata-eval97.5%
times-frac97.5%
neg-mul-197.5%
remove-double-neg97.5%
neg-mul-197.5%
sub0-neg97.5%
associate--r+97.5%
neg-sub097.5%
div-sub97.5%
distribute-frac-neg97.5%
*-inverses97.5%
metadata-eval97.5%
Simplified97.5%
Taylor expanded in t1 around 0 75.9%
Taylor expanded in u around inf 77.2%
mul-1-neg77.2%
distribute-neg-frac77.2%
Simplified77.2%
Final simplification81.7%
(FPCore (u v t1) :precision binary64 (if (<= t1 -2.6e+51) (/ (/ v t1) (- -1.0 (/ u t1))) (if (<= t1 120000000.0) (/ (/ v u) (- (/ u t1))) (/ (- v) (+ t1 u)))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -2.6e+51) {
tmp = (v / t1) / (-1.0 - (u / t1));
} else if (t1 <= 120000000.0) {
tmp = (v / u) / -(u / t1);
} 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 (t1 <= (-2.6d+51)) then
tmp = (v / t1) / ((-1.0d0) - (u / t1))
else if (t1 <= 120000000.0d0) then
tmp = (v / u) / -(u / t1)
else
tmp = -v / (t1 + u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -2.6e+51) {
tmp = (v / t1) / (-1.0 - (u / t1));
} else if (t1 <= 120000000.0) {
tmp = (v / u) / -(u / t1);
} else {
tmp = -v / (t1 + u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -2.6e+51: tmp = (v / t1) / (-1.0 - (u / t1)) elif t1 <= 120000000.0: tmp = (v / u) / -(u / t1) else: tmp = -v / (t1 + u) return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -2.6e+51) tmp = Float64(Float64(v / t1) / Float64(-1.0 - Float64(u / t1))); elseif (t1 <= 120000000.0) tmp = Float64(Float64(v / u) / Float64(-Float64(u / t1))); else tmp = Float64(Float64(-v) / Float64(t1 + u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -2.6e+51) tmp = (v / t1) / (-1.0 - (u / t1)); elseif (t1 <= 120000000.0) tmp = (v / u) / -(u / t1); else tmp = -v / (t1 + u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -2.6e+51], N[(N[(v / t1), $MachinePrecision] / N[(-1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 120000000.0], N[(N[(v / u), $MachinePrecision] / (-N[(u / t1), $MachinePrecision])), $MachinePrecision], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.6 \cdot 10^{+51}:\\
\;\;\;\;\frac{\frac{v}{t1}}{-1 - \frac{u}{t1}}\\
\mathbf{elif}\;t1 \leq 120000000:\\
\;\;\;\;\frac{\frac{v}{u}}{-\frac{u}{t1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\end{array}
\end{array}
if t1 < -2.6000000000000001e51Initial program 44.4%
*-commutative44.4%
times-frac99.9%
neg-mul-199.9%
associate-/l*99.9%
associate-*r/99.9%
associate-/l*99.9%
associate-/l/99.9%
neg-mul-199.9%
*-lft-identity99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
remove-double-neg99.9%
neg-mul-199.9%
sub0-neg99.9%
associate--r+99.9%
neg-sub099.9%
div-sub100.0%
distribute-frac-neg100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in t1 around inf 88.3%
if -2.6000000000000001e51 < t1 < 1.2e8Initial program 83.4%
*-commutative83.4%
times-frac98.2%
neg-mul-198.2%
associate-/l*97.5%
associate-*r/97.5%
associate-/l*97.5%
associate-/l/97.5%
neg-mul-197.5%
*-lft-identity97.5%
metadata-eval97.5%
times-frac97.5%
neg-mul-197.5%
remove-double-neg97.5%
neg-mul-197.5%
sub0-neg97.5%
associate--r+97.5%
neg-sub097.5%
div-sub97.5%
distribute-frac-neg97.5%
*-inverses97.5%
metadata-eval97.5%
Simplified97.5%
Taylor expanded in t1 around 0 75.9%
Taylor expanded in u around inf 77.2%
mul-1-neg77.2%
distribute-neg-frac77.2%
Simplified77.2%
if 1.2e8 < t1 Initial program 59.7%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around inf 84.2%
Final simplification81.7%
(FPCore (u v t1) :precision binary64 (if (or (<= u -4.1e+161) (not (<= u 1.9e+123))) (* v (/ t1 (* u u))) (/ (- v) (+ t1 u))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -4.1e+161) || !(u <= 1.9e+123)) {
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 <= (-4.1d+161)) .or. (.not. (u <= 1.9d+123))) 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 <= -4.1e+161) || !(u <= 1.9e+123)) {
tmp = v * (t1 / (u * u));
} else {
tmp = -v / (t1 + u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -4.1e+161) or not (u <= 1.9e+123): tmp = v * (t1 / (u * u)) else: tmp = -v / (t1 + u) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -4.1e+161) || !(u <= 1.9e+123)) 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 <= -4.1e+161) || ~((u <= 1.9e+123))) tmp = v * (t1 / (u * u)); else tmp = -v / (t1 + u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -4.1e+161], N[Not[LessEqual[u, 1.9e+123]], $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.1 \cdot 10^{+161} \lor \neg \left(u \leq 1.9 \cdot 10^{+123}\right):\\
\;\;\;\;v \cdot \frac{t1}{u \cdot u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\end{array}
\end{array}
if u < -4.1000000000000001e161 or 1.89999999999999997e123 < u Initial program 73.3%
associate-/l*75.2%
associate-/l*91.2%
Simplified91.2%
Taylor expanded in t1 around 0 75.2%
unpow275.2%
Simplified75.2%
associate-/r/73.9%
add-sqr-sqrt36.8%
sqrt-unprod61.4%
sqr-neg61.4%
sqrt-unprod37.2%
add-sqr-sqrt72.6%
Applied egg-rr72.6%
if -4.1000000000000001e161 < u < 1.89999999999999997e123Initial program 65.8%
times-frac98.8%
Simplified98.8%
Taylor expanded in t1 around inf 72.1%
Final simplification72.2%
(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 67.9%
*-commutative67.9%
times-frac99.0%
neg-mul-199.0%
associate-/l*98.7%
associate-*r/98.7%
associate-/l*98.7%
associate-/l/98.7%
neg-mul-198.7%
*-lft-identity98.7%
metadata-eval98.7%
times-frac98.7%
neg-mul-198.7%
remove-double-neg98.7%
neg-mul-198.7%
sub0-neg98.7%
associate--r+98.7%
neg-sub098.7%
div-sub98.7%
distribute-frac-neg98.7%
*-inverses98.7%
metadata-eval98.7%
Simplified98.7%
Final simplification98.7%
(FPCore (u v t1) :precision binary64 (if (<= u -2.6e+209) (/ v u) (if (<= u 2.05e+125) (/ (- v) t1) (/ v u))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -2.6e+209) {
tmp = v / u;
} else if (u <= 2.05e+125) {
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 <= (-2.6d+209)) then
tmp = v / u
else if (u <= 2.05d+125) 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 <= -2.6e+209) {
tmp = v / u;
} else if (u <= 2.05e+125) {
tmp = -v / t1;
} else {
tmp = v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -2.6e+209: tmp = v / u elif u <= 2.05e+125: tmp = -v / t1 else: tmp = v / u return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -2.6e+209) tmp = Float64(v / u); elseif (u <= 2.05e+125) 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 <= -2.6e+209) tmp = v / u; elseif (u <= 2.05e+125) tmp = -v / t1; else tmp = v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -2.6e+209], N[(v / u), $MachinePrecision], If[LessEqual[u, 2.05e+125], N[((-v) / t1), $MachinePrecision], N[(v / u), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.6 \cdot 10^{+209}:\\
\;\;\;\;\frac{v}{u}\\
\mathbf{elif}\;u \leq 2.05 \cdot 10^{+125}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\
\end{array}
\end{array}
if u < -2.6e209 or 2.04999999999999996e125 < u Initial program 76.2%
associate-/l*78.1%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in t1 around 0 91.1%
frac-2neg91.1%
div-inv91.1%
remove-double-neg91.1%
div-inv91.1%
distribute-lft-neg-in91.1%
distribute-neg-in91.1%
add-sqr-sqrt47.6%
sqrt-unprod88.6%
sqr-neg88.6%
sqrt-unprod43.4%
add-sqr-sqrt91.0%
sub-neg91.0%
clear-num91.0%
Applied egg-rr91.0%
associate-*r/91.0%
*-rgt-identity91.0%
*-commutative91.0%
associate-/r*96.1%
associate-/r/96.2%
associate-*l/86.1%
*-commutative86.1%
associate-*r/96.2%
Simplified96.2%
Taylor expanded in t1 around inf 42.3%
if -2.6e209 < u < 2.04999999999999996e125Initial program 65.2%
times-frac98.8%
Simplified98.8%
Taylor expanded in t1 around inf 68.4%
associate-*r/68.4%
neg-mul-168.4%
Simplified68.4%
Final simplification62.0%
(FPCore (u v t1) :precision binary64 (if (<= u -1.08e+222) (/ (- v) u) (if (<= u 2.1e+125) (/ (- v) t1) (/ v u))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -1.08e+222) {
tmp = -v / u;
} else if (u <= 2.1e+125) {
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 <= (-1.08d+222)) then
tmp = -v / u
else if (u <= 2.1d+125) 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 <= -1.08e+222) {
tmp = -v / u;
} else if (u <= 2.1e+125) {
tmp = -v / t1;
} else {
tmp = v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -1.08e+222: tmp = -v / u elif u <= 2.1e+125: tmp = -v / t1 else: tmp = v / u return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -1.08e+222) tmp = Float64(Float64(-v) / u); elseif (u <= 2.1e+125) 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 <= -1.08e+222) tmp = -v / u; elseif (u <= 2.1e+125) tmp = -v / t1; else tmp = v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -1.08e+222], N[((-v) / u), $MachinePrecision], If[LessEqual[u, 2.1e+125], N[((-v) / t1), $MachinePrecision], N[(v / u), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.08 \cdot 10^{+222}:\\
\;\;\;\;\frac{-v}{u}\\
\mathbf{elif}\;u \leq 2.1 \cdot 10^{+125}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\
\end{array}
\end{array}
if u < -1.08e222Initial program 85.8%
*-commutative85.8%
times-frac100.0%
neg-mul-1100.0%
associate-/l*100.0%
associate-*r/100.0%
associate-/l*100.0%
associate-/l/100.0%
neg-mul-1100.0%
*-lft-identity100.0%
metadata-eval100.0%
times-frac100.0%
neg-mul-1100.0%
remove-double-neg100.0%
neg-mul-1100.0%
sub0-neg100.0%
associate--r+100.0%
neg-sub0100.0%
div-sub100.0%
distribute-frac-neg100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in t1 around 0 93.5%
Taylor expanded in u around 0 50.7%
mul-1-neg50.7%
distribute-frac-neg50.7%
Simplified50.7%
if -1.08e222 < u < 2.1000000000000001e125Initial program 64.7%
times-frac98.8%
Simplified98.8%
Taylor expanded in t1 around inf 67.9%
associate-*r/67.9%
neg-mul-167.9%
Simplified67.9%
if 2.1000000000000001e125 < u Initial program 75.9%
associate-/l*78.4%
associate-/l*92.9%
Simplified92.9%
Taylor expanded in t1 around 0 91.4%
frac-2neg91.4%
div-inv91.4%
remove-double-neg91.4%
div-inv91.3%
distribute-lft-neg-in91.3%
distribute-neg-in91.3%
add-sqr-sqrt41.1%
sqrt-unprod88.7%
sqr-neg88.7%
sqrt-unprod50.2%
add-sqr-sqrt91.3%
sub-neg91.3%
clear-num91.4%
Applied egg-rr91.4%
associate-*r/91.3%
*-rgt-identity91.3%
*-commutative91.3%
associate-/r*98.3%
associate-/r/98.3%
associate-*l/87.2%
*-commutative87.2%
associate-*r/98.3%
Simplified98.3%
Taylor expanded in t1 around inf 40.1%
Final simplification62.0%
(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 67.9%
times-frac99.0%
Simplified99.0%
Taylor expanded in t1 around inf 63.4%
Final simplification63.4%
(FPCore (u v t1) :precision binary64 (/ v u))
double code(double u, double v, double t1) {
return v / 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 / u
end function
public static double code(double u, double v, double t1) {
return v / u;
}
def code(u, v, t1): return v / u
function code(u, v, t1) return Float64(v / u) end
function tmp = code(u, v, t1) tmp = v / u; end
code[u_, v_, t1_] := N[(v / u), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{u}
\end{array}
Initial program 67.9%
associate-/l*68.6%
associate-/l*81.9%
Simplified81.9%
Taylor expanded in t1 around 0 53.0%
frac-2neg53.0%
div-inv52.3%
remove-double-neg52.3%
div-inv52.3%
distribute-lft-neg-in52.3%
distribute-neg-in52.3%
add-sqr-sqrt23.9%
sqrt-unprod54.0%
sqr-neg54.0%
sqrt-unprod26.9%
add-sqr-sqrt51.2%
sub-neg51.2%
clear-num51.2%
Applied egg-rr51.2%
associate-*r/51.9%
*-rgt-identity51.9%
*-commutative51.9%
associate-/r*48.1%
associate-/r/48.7%
associate-*l/45.0%
*-commutative45.0%
associate-*r/48.7%
Simplified48.7%
Taylor expanded in t1 around inf 15.7%
Final simplification15.7%
herbie shell --seed 2023261
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))