
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1): return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 * v) / ((t1 + u) * (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1): return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 * v) / ((t1 + u) * (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}
(FPCore (u v t1) :precision binary64 (* (/ (- t1) (+ t1 u)) (/ v (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 / (t1 + u)) * (v / (t1 + u));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-t1 / (t1 + u)) * (v / (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 / (t1 + u)) * (v / (t1 + u));
}
def code(u, v, t1): return (-t1 / (t1 + u)) * (v / (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) / Float64(t1 + u)) * Float64(v / Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 / (t1 + u)) * (v / (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}
\end{array}
Initial program 69.8%
times-frac98.5%
Simplified98.5%
Final simplification98.5%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ t1 u))) (t_2 (* t1 (/ (/ v u) (- u)))))
(if (<= t1 -1e-12)
t_1
(if (<= t1 -1.5e-240)
t_2
(if (<= t1 1.5e-186)
(* (/ (/ t1 u) u) (- v))
(if (<= t1 2.55e+33) 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 <= -1e-12) {
tmp = t_1;
} else if (t1 <= -1.5e-240) {
tmp = t_2;
} else if (t1 <= 1.5e-186) {
tmp = ((t1 / u) / u) * -v;
} else if (t1 <= 2.55e+33) {
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 <= (-1d-12)) then
tmp = t_1
else if (t1 <= (-1.5d-240)) then
tmp = t_2
else if (t1 <= 1.5d-186) then
tmp = ((t1 / u) / u) * -v
else if (t1 <= 2.55d+33) 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 <= -1e-12) {
tmp = t_1;
} else if (t1 <= -1.5e-240) {
tmp = t_2;
} else if (t1 <= 1.5e-186) {
tmp = ((t1 / u) / u) * -v;
} else if (t1 <= 2.55e+33) {
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 <= -1e-12: tmp = t_1 elif t1 <= -1.5e-240: tmp = t_2 elif t1 <= 1.5e-186: tmp = ((t1 / u) / u) * -v elif t1 <= 2.55e+33: 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(t1 * Float64(Float64(v / u) / Float64(-u))) tmp = 0.0 if (t1 <= -1e-12) tmp = t_1; elseif (t1 <= -1.5e-240) tmp = t_2; elseif (t1 <= 1.5e-186) tmp = Float64(Float64(Float64(t1 / u) / u) * Float64(-v)); elseif (t1 <= 2.55e+33) 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 <= -1e-12) tmp = t_1; elseif (t1 <= -1.5e-240) tmp = t_2; elseif (t1 <= 1.5e-186) tmp = ((t1 / u) / u) * -v; elseif (t1 <= 2.55e+33) 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[(t1 * N[(N[(v / u), $MachinePrecision] / (-u)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -1e-12], t$95$1, If[LessEqual[t1, -1.5e-240], t$95$2, If[LessEqual[t1, 1.5e-186], N[(N[(N[(t1 / u), $MachinePrecision] / u), $MachinePrecision] * (-v)), $MachinePrecision], If[LessEqual[t1, 2.55e+33], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u}\\
t_2 := t1 \cdot \frac{\frac{v}{u}}{-u}\\
\mathbf{if}\;t1 \leq -1 \cdot 10^{-12}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t1 \leq -1.5 \cdot 10^{-240}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t1 \leq 1.5 \cdot 10^{-186}:\\
\;\;\;\;\frac{\frac{t1}{u}}{u} \cdot \left(-v\right)\\
\mathbf{elif}\;t1 \leq 2.55 \cdot 10^{+33}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t1 < -9.9999999999999998e-13 or 2.5499999999999999e33 < t1 Initial program 60.0%
times-frac100.0%
Simplified100.0%
Taylor expanded in t1 around inf 87.4%
if -9.9999999999999998e-13 < t1 < -1.49999999999999995e-240 or 1.5000000000000001e-186 < t1 < 2.5499999999999999e33Initial program 84.3%
Taylor expanded in t1 around 0 67.8%
unpow267.8%
Simplified67.8%
frac-2neg67.8%
div-inv67.9%
distribute-lft-neg-out67.9%
remove-double-neg67.9%
distribute-rgt-neg-in67.9%
Applied egg-rr67.9%
associate-*l*70.8%
associate-/r*71.8%
associate-*r/77.1%
associate-*r/77.0%
associate-*l/77.0%
*-rgt-identity77.0%
Simplified77.0%
if -1.49999999999999995e-240 < t1 < 1.5000000000000001e-186Initial program 68.4%
associate-/l*76.0%
neg-mul-176.0%
*-commutative76.0%
associate-*r/76.0%
associate-/l*76.0%
neg-mul-176.0%
associate-/r*81.3%
Simplified81.3%
associate-*r/88.9%
add-sqr-sqrt31.1%
sqrt-unprod50.7%
sqr-neg50.7%
sqrt-unprod33.1%
add-sqr-sqrt47.6%
frac-2neg47.6%
add-sqr-sqrt14.5%
sqrt-unprod61.4%
sqr-neg61.4%
sqrt-unprod57.6%
add-sqr-sqrt88.9%
distribute-neg-in88.9%
add-sqr-sqrt27.9%
sqrt-unprod84.6%
sqr-neg84.6%
sqrt-unprod58.3%
add-sqr-sqrt84.5%
sub-neg84.5%
Applied egg-rr84.5%
Taylor expanded in t1 around 0 68.4%
mul-1-neg68.4%
*-commutative68.4%
associate-*r/81.3%
unpow281.3%
associate-/r*93.0%
Simplified93.0%
Final simplification84.5%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -5e-74) (not (<= t1 9.2e+32))) (/ (- v) (+ t1 u)) (* (/ (/ t1 u) u) (- v))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -5e-74) || !(t1 <= 9.2e+32)) {
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 <= (-5d-74)) .or. (.not. (t1 <= 9.2d+32))) 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 <= -5e-74) || !(t1 <= 9.2e+32)) {
tmp = -v / (t1 + u);
} else {
tmp = ((t1 / u) / u) * -v;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -5e-74) or not (t1 <= 9.2e+32): tmp = -v / (t1 + u) else: tmp = ((t1 / u) / u) * -v return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -5e-74) || !(t1 <= 9.2e+32)) tmp = Float64(Float64(-v) / Float64(t1 + u)); else tmp = Float64(Float64(Float64(t1 / u) / u) * Float64(-v)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -5e-74) || ~((t1 <= 9.2e+32))) tmp = -v / (t1 + u); else tmp = ((t1 / u) / u) * -v; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -5e-74], N[Not[LessEqual[t1, 9.2e+32]], $MachinePrecision]], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t1 / u), $MachinePrecision] / u), $MachinePrecision] * (-v)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -5 \cdot 10^{-74} \lor \neg \left(t1 \leq 9.2 \cdot 10^{+32}\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{t1}{u}}{u} \cdot \left(-v\right)\\
\end{array}
\end{array}
if t1 < -4.99999999999999998e-74 or 9.1999999999999998e32 < t1 Initial program 63.0%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around inf 83.5%
if -4.99999999999999998e-74 < t1 < 9.1999999999999998e32Initial program 78.7%
associate-/l*81.8%
neg-mul-181.8%
*-commutative81.8%
associate-*r/81.8%
associate-/l*81.9%
neg-mul-181.9%
associate-/r*89.5%
Simplified89.5%
associate-*r/95.6%
add-sqr-sqrt45.1%
sqrt-unprod57.0%
sqr-neg57.0%
sqrt-unprod24.3%
add-sqr-sqrt42.4%
frac-2neg42.4%
add-sqr-sqrt18.1%
sqrt-unprod54.6%
sqr-neg54.6%
sqrt-unprod50.4%
add-sqr-sqrt95.6%
distribute-neg-in95.6%
add-sqr-sqrt46.1%
sqrt-unprod84.4%
sqr-neg84.4%
sqrt-unprod42.4%
add-sqr-sqrt78.2%
sub-neg78.2%
Applied egg-rr78.2%
Taylor expanded in t1 around 0 70.3%
mul-1-neg70.3%
*-commutative70.3%
associate-*r/74.8%
unpow274.8%
associate-/r*78.7%
Simplified78.7%
Final simplification81.4%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -2.8e-6) (not (<= t1 8e+30))) (/ (- v) (+ t1 u)) (* (/ t1 u) (/ v (- u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -2.8e-6) || !(t1 <= 8e+30)) {
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 <= (-2.8d-6)) .or. (.not. (t1 <= 8d+30))) 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 <= -2.8e-6) || !(t1 <= 8e+30)) {
tmp = -v / (t1 + u);
} else {
tmp = (t1 / u) * (v / -u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -2.8e-6) or not (t1 <= 8e+30): tmp = -v / (t1 + u) else: tmp = (t1 / u) * (v / -u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -2.8e-6) || !(t1 <= 8e+30)) tmp = Float64(Float64(-v) / Float64(t1 + u)); else tmp = Float64(Float64(t1 / u) * Float64(v / Float64(-u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -2.8e-6) || ~((t1 <= 8e+30))) tmp = -v / (t1 + u); else tmp = (t1 / u) * (v / -u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -2.8e-6], N[Not[LessEqual[t1, 8e+30]], $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 -2.8 \cdot 10^{-6} \lor \neg \left(t1 \leq 8 \cdot 10^{+30}\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1}{u} \cdot \frac{v}{-u}\\
\end{array}
\end{array}
if t1 < -2.79999999999999987e-6 or 8.0000000000000002e30 < t1 Initial program 60.0%
times-frac100.0%
Simplified100.0%
Taylor expanded in t1 around inf 87.4%
if -2.79999999999999987e-6 < t1 < 8.0000000000000002e30Initial program 79.8%
associate-/l*82.6%
neg-mul-182.6%
*-commutative82.6%
associate-*r/82.5%
associate-/l*82.6%
neg-mul-182.6%
associate-/r*90.8%
Simplified90.8%
Taylor expanded in t1 around 0 72.3%
associate-*r/72.3%
neg-mul-172.3%
unpow272.3%
Simplified72.3%
frac-2neg72.3%
remove-double-neg72.3%
associate-*r/68.0%
distribute-rgt-neg-in68.0%
Applied egg-rr68.0%
times-frac79.5%
Simplified79.5%
Final simplification83.4%
(FPCore (u v t1) :precision binary64 (if (or (<= u -6.2e+115) (not (<= u 5.4e+110))) (* (/ t1 u) (/ v u)) (/ (- v) (+ t1 u))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -6.2e+115) || !(u <= 5.4e+110)) {
tmp = (t1 / u) * (v / 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 <= (-6.2d+115)) .or. (.not. (u <= 5.4d+110))) then
tmp = (t1 / u) * (v / 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 <= -6.2e+115) || !(u <= 5.4e+110)) {
tmp = (t1 / u) * (v / u);
} else {
tmp = -v / (t1 + u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -6.2e+115) or not (u <= 5.4e+110): tmp = (t1 / u) * (v / u) else: tmp = -v / (t1 + u) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -6.2e+115) || !(u <= 5.4e+110)) tmp = Float64(Float64(t1 / u) * Float64(v / 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 <= -6.2e+115) || ~((u <= 5.4e+110))) tmp = (t1 / u) * (v / u); else tmp = -v / (t1 + u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -6.2e+115], N[Not[LessEqual[u, 5.4e+110]], $MachinePrecision]], N[(N[(t1 / u), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -6.2 \cdot 10^{+115} \lor \neg \left(u \leq 5.4 \cdot 10^{+110}\right):\\
\;\;\;\;\frac{t1}{u} \cdot \frac{v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\end{array}
\end{array}
if u < -6.2000000000000001e115 or 5.40000000000000019e110 < u Initial program 76.9%
Taylor expanded in t1 around 0 74.6%
unpow274.6%
Simplified74.6%
*-commutative74.6%
times-frac91.2%
add-sqr-sqrt44.6%
sqrt-unprod67.6%
sqr-neg67.6%
sqrt-prod33.6%
add-sqr-sqrt66.0%
Applied egg-rr66.0%
if -6.2000000000000001e115 < u < 5.40000000000000019e110Initial program 66.3%
times-frac98.8%
Simplified98.8%
Taylor expanded in t1 around inf 68.8%
Final simplification67.9%
(FPCore (u v t1) :precision binary64 (if (or (<= u -3.8e+112) (not (<= u 4.7e+101))) (/ t1 (/ u (/ v u))) (/ (- v) (+ t1 u))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -3.8e+112) || !(u <= 4.7e+101)) {
tmp = t1 / (u / (v / 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 <= (-3.8d+112)) .or. (.not. (u <= 4.7d+101))) then
tmp = t1 / (u / (v / 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 <= -3.8e+112) || !(u <= 4.7e+101)) {
tmp = t1 / (u / (v / u));
} else {
tmp = -v / (t1 + u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -3.8e+112) or not (u <= 4.7e+101): tmp = t1 / (u / (v / u)) else: tmp = -v / (t1 + u) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -3.8e+112) || !(u <= 4.7e+101)) tmp = Float64(t1 / Float64(u / Float64(v / 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 <= -3.8e+112) || ~((u <= 4.7e+101))) tmp = t1 / (u / (v / u)); else tmp = -v / (t1 + u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -3.8e+112], N[Not[LessEqual[u, 4.7e+101]], $MachinePrecision]], N[(t1 / N[(u / N[(v / u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.8 \cdot 10^{+112} \lor \neg \left(u \leq 4.7 \cdot 10^{+101}\right):\\
\;\;\;\;\frac{t1}{\frac{u}{\frac{v}{u}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\end{array}
\end{array}
if u < -3.80000000000000008e112 or 4.69999999999999971e101 < u Initial program 77.5%
associate-/l*78.9%
neg-mul-178.9%
*-commutative78.9%
associate-*r/78.9%
associate-/l*78.9%
neg-mul-178.9%
associate-/r*90.4%
Simplified90.4%
Taylor expanded in t1 around 0 77.8%
associate-*r/77.8%
neg-mul-177.8%
unpow277.8%
Simplified77.8%
clear-num77.9%
un-div-inv77.9%
associate-/l*88.8%
add-sqr-sqrt46.5%
sqrt-unprod67.0%
sqr-neg67.0%
sqrt-unprod34.5%
add-sqr-sqrt68.1%
Applied egg-rr68.1%
if -3.80000000000000008e112 < u < 4.69999999999999971e101Initial program 65.9%
times-frac98.7%
Simplified98.7%
Taylor expanded in t1 around inf 69.0%
Final simplification68.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 69.8%
*-commutative69.8%
times-frac98.5%
neg-mul-198.5%
associate-/l*98.4%
associate-*r/98.4%
associate-/l*98.4%
associate-/l/98.4%
neg-mul-198.4%
*-lft-identity98.4%
metadata-eval98.4%
times-frac98.4%
neg-mul-198.4%
remove-double-neg98.4%
neg-mul-198.4%
sub0-neg98.4%
associate--r+98.4%
neg-sub098.4%
div-sub98.5%
distribute-frac-neg98.5%
*-inverses98.5%
metadata-eval98.5%
Simplified98.5%
Final simplification98.5%
(FPCore (u v t1) :precision binary64 (if (<= u -2.2e+112) (/ (- v) u) (if (<= u 5e+137) (/ (- v) t1) (/ v (+ t1 u)))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -2.2e+112) {
tmp = -v / u;
} else if (u <= 5e+137) {
tmp = -v / 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 (u <= (-2.2d+112)) then
tmp = -v / u
else if (u <= 5d+137) then
tmp = -v / 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 (u <= -2.2e+112) {
tmp = -v / u;
} else if (u <= 5e+137) {
tmp = -v / t1;
} else {
tmp = v / (t1 + u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -2.2e+112: tmp = -v / u elif u <= 5e+137: tmp = -v / t1 else: tmp = v / (t1 + u) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -2.2e+112) tmp = Float64(Float64(-v) / u); elseif (u <= 5e+137) tmp = Float64(Float64(-v) / t1); else tmp = Float64(v / Float64(t1 + u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -2.2e+112) tmp = -v / u; elseif (u <= 5e+137) tmp = -v / t1; else tmp = v / (t1 + u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -2.2e+112], N[((-v) / u), $MachinePrecision], If[LessEqual[u, 5e+137], N[((-v) / t1), $MachinePrecision], N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.2 \cdot 10^{+112}:\\
\;\;\;\;\frac{-v}{u}\\
\mathbf{elif}\;u \leq 5 \cdot 10^{+137}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{t1 + u}\\
\end{array}
\end{array}
if u < -2.1999999999999999e112Initial program 78.9%
*-commutative78.9%
times-frac99.8%
neg-mul-199.8%
associate-/l*99.8%
associate-*r/99.8%
associate-/l*99.8%
associate-/l/99.8%
neg-mul-199.8%
*-lft-identity99.8%
metadata-eval99.8%
times-frac99.8%
neg-mul-199.8%
remove-double-neg99.8%
neg-mul-199.8%
sub0-neg99.8%
associate--r+99.8%
neg-sub099.8%
div-sub99.8%
distribute-frac-neg99.8%
*-inverses99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in t1 around 0 94.0%
Taylor expanded in u around 0 38.3%
associate-*r/38.3%
neg-mul-138.3%
Simplified38.3%
if -2.1999999999999999e112 < u < 5.0000000000000002e137Initial program 67.1%
associate-/l*71.9%
neg-mul-171.9%
*-commutative71.9%
associate-*r/71.8%
associate-/l*72.2%
neg-mul-172.2%
associate-/r*83.5%
Simplified83.5%
Taylor expanded in t1 around inf 65.8%
associate-*r/65.8%
neg-mul-165.8%
Simplified65.8%
if 5.0000000000000002e137 < u Initial program 74.5%
associate-/l*74.9%
neg-mul-174.9%
*-commutative74.9%
associate-*r/74.9%
associate-/l*74.8%
neg-mul-174.8%
associate-/r*89.5%
Simplified89.5%
associate-*r/99.9%
add-sqr-sqrt56.9%
sqrt-unprod74.3%
sqr-neg74.3%
sqrt-unprod34.0%
add-sqr-sqrt67.9%
frac-2neg67.9%
add-sqr-sqrt33.9%
sqrt-unprod64.8%
sqr-neg64.8%
sqrt-unprod42.8%
add-sqr-sqrt99.9%
distribute-neg-in99.9%
add-sqr-sqrt47.5%
sqrt-unprod92.7%
sqr-neg92.7%
sqrt-unprod50.1%
add-sqr-sqrt97.6%
sub-neg97.6%
Applied egg-rr97.6%
Taylor expanded in t1 around inf 47.7%
Final simplification59.4%
(FPCore (u v t1) :precision binary64 (if (or (<= u -1.9e+112) (not (<= u 2.5e+142))) (/ (- v) u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.9e+112) || !(u <= 2.5e+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 <= (-1.9d+112)) .or. (.not. (u <= 2.5d+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 <= -1.9e+112) || !(u <= 2.5e+142)) {
tmp = -v / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -1.9e+112) or not (u <= 2.5e+142): tmp = -v / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -1.9e+112) || !(u <= 2.5e+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 <= -1.9e+112) || ~((u <= 2.5e+142))) tmp = -v / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.9e+112], N[Not[LessEqual[u, 2.5e+142]], $MachinePrecision]], N[((-v) / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.9 \cdot 10^{+112} \lor \neg \left(u \leq 2.5 \cdot 10^{+142}\right):\\
\;\;\;\;\frac{-v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -1.90000000000000004e112 or 2.5000000000000001e142 < u Initial program 75.4%
*-commutative75.4%
times-frac98.6%
neg-mul-198.6%
associate-/l*98.6%
associate-*r/98.6%
associate-/l*98.6%
associate-/l/98.6%
neg-mul-198.6%
*-lft-identity98.6%
metadata-eval98.6%
times-frac98.6%
neg-mul-198.6%
remove-double-neg98.6%
neg-mul-198.6%
sub0-neg98.6%
associate--r+98.6%
neg-sub098.6%
div-sub98.6%
distribute-frac-neg98.6%
*-inverses98.6%
metadata-eval98.6%
Simplified98.6%
Taylor expanded in t1 around 0 93.4%
Taylor expanded in u around 0 44.2%
associate-*r/44.2%
neg-mul-144.2%
Simplified44.2%
if -1.90000000000000004e112 < u < 2.5000000000000001e142Initial program 67.6%
associate-/l*72.3%
neg-mul-172.3%
*-commutative72.3%
associate-*r/72.3%
associate-/l*72.6%
neg-mul-172.6%
associate-/r*83.7%
Simplified83.7%
Taylor expanded in t1 around inf 64.8%
associate-*r/64.8%
neg-mul-164.8%
Simplified64.8%
Final simplification59.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 69.8%
times-frac98.5%
Simplified98.5%
Taylor expanded in t1 around inf 61.0%
Final simplification61.0%
(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 69.8%
associate-/l*73.3%
neg-mul-173.3%
*-commutative73.3%
associate-*r/73.3%
associate-/l*73.5%
neg-mul-173.5%
associate-/r*85.4%
Simplified85.4%
Taylor expanded in t1 around inf 52.7%
associate-*r/52.7%
neg-mul-152.7%
Simplified52.7%
Final simplification52.7%
(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 69.8%
associate-/l*73.3%
neg-mul-173.3%
*-commutative73.3%
associate-*r/73.3%
associate-/l*73.5%
neg-mul-173.5%
associate-/r*85.4%
Simplified85.4%
associate-*r/98.1%
add-sqr-sqrt49.5%
sqrt-unprod55.8%
sqr-neg55.8%
sqrt-unprod19.6%
add-sqr-sqrt40.3%
frac-2neg40.3%
add-sqr-sqrt20.6%
sqrt-unprod56.2%
sqr-neg56.2%
sqrt-unprod48.3%
add-sqr-sqrt98.1%
distribute-neg-in98.1%
add-sqr-sqrt51.9%
sqrt-unprod74.5%
sqr-neg74.5%
sqrt-unprod30.5%
add-sqr-sqrt62.7%
sub-neg62.7%
Applied egg-rr62.7%
Taylor expanded in t1 around inf 17.5%
Final simplification17.5%
herbie shell --seed 2023258
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))