
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1): return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 * v) / ((t1 + u) * (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1): return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 * v) / ((t1 + u) * (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}
(FPCore (u v t1) :precision binary64 (* (/ (- v) (+ t1 u)) (/ t1 (+ t1 u))))
double code(double u, double v, double t1) {
return (-v / (t1 + u)) * (t1 / (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)) * (t1 / (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-v / (t1 + u)) * (t1 / (t1 + u));
}
def code(u, v, t1): return (-v / (t1 + u)) * (t1 / (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-v) / Float64(t1 + u)) * Float64(t1 / Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-v / (t1 + u)) * (t1 / (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-v}{t1 + u} \cdot \frac{t1}{t1 + u}
\end{array}
Initial program 70.0%
times-frac98.7%
distribute-frac-neg98.7%
distribute-neg-frac298.7%
+-commutative98.7%
distribute-neg-in98.7%
unsub-neg98.7%
Simplified98.7%
Final simplification98.7%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (* t1 (/ (/ (- v) (+ t1 u)) (+ t1 u)))))
(if (<= t1 -5e+113)
(/ v (- (- (* u 2.0)) t1))
(if (<= t1 1.45e-266)
t_1
(if (<= t1 8.5e+112)
(* v (/ t1 (- (* (+ t1 u) (+ t1 u)))))
(if (<= t1 6.2e+159) t_1 (/ (- v) t1)))))))
double code(double u, double v, double t1) {
double t_1 = t1 * ((-v / (t1 + u)) / (t1 + u));
double tmp;
if (t1 <= -5e+113) {
tmp = v / (-(u * 2.0) - t1);
} else if (t1 <= 1.45e-266) {
tmp = t_1;
} else if (t1 <= 8.5e+112) {
tmp = v * (t1 / -((t1 + u) * (t1 + u)));
} else if (t1 <= 6.2e+159) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = t1 * ((-v / (t1 + u)) / (t1 + u))
if (t1 <= (-5d+113)) then
tmp = v / (-(u * 2.0d0) - t1)
else if (t1 <= 1.45d-266) then
tmp = t_1
else if (t1 <= 8.5d+112) then
tmp = v * (t1 / -((t1 + u) * (t1 + u)))
else if (t1 <= 6.2d+159) then
tmp = t_1
else
tmp = -v / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = t1 * ((-v / (t1 + u)) / (t1 + u));
double tmp;
if (t1 <= -5e+113) {
tmp = v / (-(u * 2.0) - t1);
} else if (t1 <= 1.45e-266) {
tmp = t_1;
} else if (t1 <= 8.5e+112) {
tmp = v * (t1 / -((t1 + u) * (t1 + u)));
} else if (t1 <= 6.2e+159) {
tmp = t_1;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): t_1 = t1 * ((-v / (t1 + u)) / (t1 + u)) tmp = 0 if t1 <= -5e+113: tmp = v / (-(u * 2.0) - t1) elif t1 <= 1.45e-266: tmp = t_1 elif t1 <= 8.5e+112: tmp = v * (t1 / -((t1 + u) * (t1 + u))) elif t1 <= 6.2e+159: tmp = t_1 else: tmp = -v / t1 return tmp
function code(u, v, t1) t_1 = Float64(t1 * Float64(Float64(Float64(-v) / Float64(t1 + u)) / Float64(t1 + u))) tmp = 0.0 if (t1 <= -5e+113) tmp = Float64(v / Float64(Float64(-Float64(u * 2.0)) - t1)); elseif (t1 <= 1.45e-266) tmp = t_1; elseif (t1 <= 8.5e+112) tmp = Float64(v * Float64(t1 / Float64(-Float64(Float64(t1 + u) * Float64(t1 + u))))); elseif (t1 <= 6.2e+159) tmp = t_1; else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = t1 * ((-v / (t1 + u)) / (t1 + u)); tmp = 0.0; if (t1 <= -5e+113) tmp = v / (-(u * 2.0) - t1); elseif (t1 <= 1.45e-266) tmp = t_1; elseif (t1 <= 8.5e+112) tmp = v * (t1 / -((t1 + u) * (t1 + u))); elseif (t1 <= 6.2e+159) tmp = t_1; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(t1 * N[(N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -5e+113], N[(v / N[((-N[(u * 2.0), $MachinePrecision]) - t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 1.45e-266], t$95$1, If[LessEqual[t1, 8.5e+112], N[(v * N[(t1 / (-N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 6.2e+159], t$95$1, N[((-v) / t1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t1 \cdot \frac{\frac{-v}{t1 + u}}{t1 + u}\\
\mathbf{if}\;t1 \leq -5 \cdot 10^{+113}:\\
\;\;\;\;\frac{v}{\left(-u \cdot 2\right) - t1}\\
\mathbf{elif}\;t1 \leq 1.45 \cdot 10^{-266}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 8.5 \cdot 10^{+112}:\\
\;\;\;\;v \cdot \frac{t1}{-\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
\mathbf{elif}\;t1 \leq 6.2 \cdot 10^{+159}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if t1 < -5e113Initial program 47.4%
associate-/l*48.7%
distribute-lft-neg-out48.7%
distribute-rgt-neg-in48.7%
associate-/r*70.0%
distribute-neg-frac270.0%
Simplified70.0%
associate-*r/100.0%
+-commutative100.0%
distribute-neg-in100.0%
sub-neg100.0%
associate-*l/100.0%
clear-num100.0%
frac-2neg100.0%
frac-times100.0%
*-un-lft-identity100.0%
frac-2neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
+-commutative100.0%
remove-double-neg100.0%
add-sqr-sqrt99.5%
sqrt-unprod16.3%
sqr-neg16.3%
sqrt-unprod0.0%
add-sqr-sqrt41.5%
add-sqr-sqrt39.9%
sqrt-unprod42.3%
Applied egg-rr100.0%
Taylor expanded in u around 0 95.6%
*-commutative95.6%
Simplified95.6%
if -5e113 < t1 < 1.44999999999999998e-266 or 8.50000000000000047e112 < t1 < 6.1999999999999996e159Initial program 78.7%
associate-/l*81.4%
distribute-lft-neg-out81.4%
distribute-rgt-neg-in81.4%
associate-/r*89.5%
distribute-neg-frac289.5%
Simplified89.5%
if 1.44999999999999998e-266 < t1 < 8.50000000000000047e112Initial program 87.2%
associate-*l/95.0%
*-commutative95.0%
Simplified95.0%
if 6.1999999999999996e159 < t1 Initial program 33.3%
associate-/l*34.5%
distribute-lft-neg-out34.5%
distribute-rgt-neg-in34.5%
associate-/r*70.1%
distribute-neg-frac270.1%
Simplified70.1%
Taylor expanded in t1 around inf 95.2%
associate-*r/95.2%
neg-mul-195.2%
Simplified95.2%
Final simplification92.9%
(FPCore (u v t1) :precision binary64 (if (<= t1 -2.9e+107) (/ v (- (- (* u 2.0)) t1)) (if (<= t1 4.9e+159) (* t1 (/ (/ (- v) (+ t1 u)) (+ t1 u))) (/ (- v) t1))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -2.9e+107) {
tmp = v / (-(u * 2.0) - t1);
} else if (t1 <= 4.9e+159) {
tmp = t1 * ((-v / (t1 + u)) / (t1 + 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 (t1 <= (-2.9d+107)) then
tmp = v / (-(u * 2.0d0) - t1)
else if (t1 <= 4.9d+159) then
tmp = t1 * ((-v / (t1 + u)) / (t1 + u))
else
tmp = -v / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -2.9e+107) {
tmp = v / (-(u * 2.0) - t1);
} else if (t1 <= 4.9e+159) {
tmp = t1 * ((-v / (t1 + u)) / (t1 + u));
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -2.9e+107: tmp = v / (-(u * 2.0) - t1) elif t1 <= 4.9e+159: tmp = t1 * ((-v / (t1 + u)) / (t1 + u)) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -2.9e+107) tmp = Float64(v / Float64(Float64(-Float64(u * 2.0)) - t1)); elseif (t1 <= 4.9e+159) tmp = Float64(t1 * Float64(Float64(Float64(-v) / Float64(t1 + u)) / Float64(t1 + u))); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -2.9e+107) tmp = v / (-(u * 2.0) - t1); elseif (t1 <= 4.9e+159) tmp = t1 * ((-v / (t1 + u)) / (t1 + u)); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -2.9e+107], N[(v / N[((-N[(u * 2.0), $MachinePrecision]) - t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 4.9e+159], N[(t1 * N[(N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.9 \cdot 10^{+107}:\\
\;\;\;\;\frac{v}{\left(-u \cdot 2\right) - t1}\\
\mathbf{elif}\;t1 \leq 4.9 \cdot 10^{+159}:\\
\;\;\;\;t1 \cdot \frac{\frac{-v}{t1 + u}}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if t1 < -2.89999999999999988e107Initial program 47.4%
associate-/l*48.7%
distribute-lft-neg-out48.7%
distribute-rgt-neg-in48.7%
associate-/r*70.0%
distribute-neg-frac270.0%
Simplified70.0%
associate-*r/100.0%
+-commutative100.0%
distribute-neg-in100.0%
sub-neg100.0%
associate-*l/100.0%
clear-num100.0%
frac-2neg100.0%
frac-times100.0%
*-un-lft-identity100.0%
frac-2neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
+-commutative100.0%
remove-double-neg100.0%
add-sqr-sqrt99.5%
sqrt-unprod16.3%
sqr-neg16.3%
sqrt-unprod0.0%
add-sqr-sqrt41.5%
add-sqr-sqrt39.9%
sqrt-unprod42.3%
Applied egg-rr100.0%
Taylor expanded in u around 0 95.6%
*-commutative95.6%
Simplified95.6%
if -2.89999999999999988e107 < t1 < 4.8999999999999996e159Initial program 82.1%
associate-/l*84.3%
distribute-lft-neg-out84.3%
distribute-rgt-neg-in84.3%
associate-/r*89.3%
distribute-neg-frac289.3%
Simplified89.3%
if 4.8999999999999996e159 < t1 Initial program 33.3%
associate-/l*34.5%
distribute-lft-neg-out34.5%
distribute-rgt-neg-in34.5%
associate-/r*70.1%
distribute-neg-frac270.1%
Simplified70.1%
Taylor expanded in t1 around inf 95.2%
associate-*r/95.2%
neg-mul-195.2%
Simplified95.2%
Final simplification91.3%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -3.6e-60) (not (<= t1 1.45e-165))) (/ v (- (- (* u 2.0)) t1)) (* (/ t1 (- (- u) t1)) (/ v u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3.6e-60) || !(t1 <= 1.45e-165)) {
tmp = v / (-(u * 2.0) - t1);
} else {
tmp = (t1 / (-u - t1)) * (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 <= (-3.6d-60)) .or. (.not. (t1 <= 1.45d-165))) then
tmp = v / (-(u * 2.0d0) - t1)
else
tmp = (t1 / (-u - t1)) * (v / u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3.6e-60) || !(t1 <= 1.45e-165)) {
tmp = v / (-(u * 2.0) - t1);
} else {
tmp = (t1 / (-u - t1)) * (v / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -3.6e-60) or not (t1 <= 1.45e-165): tmp = v / (-(u * 2.0) - t1) else: tmp = (t1 / (-u - t1)) * (v / u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -3.6e-60) || !(t1 <= 1.45e-165)) tmp = Float64(v / Float64(Float64(-Float64(u * 2.0)) - t1)); else tmp = Float64(Float64(t1 / Float64(Float64(-u) - t1)) * Float64(v / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -3.6e-60) || ~((t1 <= 1.45e-165))) tmp = v / (-(u * 2.0) - t1); else tmp = (t1 / (-u - t1)) * (v / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -3.6e-60], N[Not[LessEqual[t1, 1.45e-165]], $MachinePrecision]], N[(v / N[((-N[(u * 2.0), $MachinePrecision]) - t1), $MachinePrecision]), $MachinePrecision], N[(N[(t1 / N[((-u) - t1), $MachinePrecision]), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3.6 \cdot 10^{-60} \lor \neg \left(t1 \leq 1.45 \cdot 10^{-165}\right):\\
\;\;\;\;\frac{v}{\left(-u \cdot 2\right) - t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{u}\\
\end{array}
\end{array}
if t1 < -3.6e-60 or 1.45e-165 < t1 Initial program 66.0%
associate-/l*67.2%
distribute-lft-neg-out67.2%
distribute-rgt-neg-in67.2%
associate-/r*81.2%
distribute-neg-frac281.2%
Simplified81.2%
associate-*r/99.9%
+-commutative99.9%
distribute-neg-in99.9%
sub-neg99.9%
associate-*l/99.9%
clear-num99.9%
frac-2neg99.9%
frac-times96.6%
*-un-lft-identity96.6%
frac-2neg96.6%
sub-neg96.6%
distribute-neg-in96.6%
+-commutative96.6%
remove-double-neg96.6%
add-sqr-sqrt51.3%
sqrt-unprod33.2%
sqr-neg33.2%
sqrt-unprod14.3%
add-sqr-sqrt32.1%
add-sqr-sqrt21.2%
sqrt-unprod54.1%
Applied egg-rr96.6%
Taylor expanded in u around 0 83.5%
*-commutative83.5%
Simplified83.5%
if -3.6e-60 < t1 < 1.45e-165Initial program 79.3%
times-frac96.0%
distribute-frac-neg96.0%
distribute-neg-frac296.0%
+-commutative96.0%
distribute-neg-in96.0%
unsub-neg96.0%
Simplified96.0%
Taylor expanded in t1 around 0 85.7%
Final simplification84.2%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.9e-60) (not (<= t1 4.6e-167))) (/ v (- (- (* u 2.0)) t1)) (* t1 (/ (/ v (- u)) (+ t1 u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.9e-60) || !(t1 <= 4.6e-167)) {
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 <= (-1.9d-60)) .or. (.not. (t1 <= 4.6d-167))) 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 <= -1.9e-60) || !(t1 <= 4.6e-167)) {
tmp = v / (-(u * 2.0) - t1);
} else {
tmp = t1 * ((v / -u) / (t1 + u));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1.9e-60) or not (t1 <= 4.6e-167): 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 <= -1.9e-60) || !(t1 <= 4.6e-167)) tmp = Float64(v / Float64(Float64(-Float64(u * 2.0)) - t1)); else tmp = Float64(t1 * Float64(Float64(v / Float64(-u)) / Float64(t1 + u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -1.9e-60) || ~((t1 <= 4.6e-167))) 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, -1.9e-60], N[Not[LessEqual[t1, 4.6e-167]], $MachinePrecision]], N[(v / N[((-N[(u * 2.0), $MachinePrecision]) - t1), $MachinePrecision]), $MachinePrecision], N[(t1 * N[(N[(v / (-u)), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.9 \cdot 10^{-60} \lor \neg \left(t1 \leq 4.6 \cdot 10^{-167}\right):\\
\;\;\;\;\frac{v}{\left(-u \cdot 2\right) - t1}\\
\mathbf{else}:\\
\;\;\;\;t1 \cdot \frac{\frac{v}{-u}}{t1 + u}\\
\end{array}
\end{array}
if t1 < -1.89999999999999997e-60 or 4.6000000000000003e-167 < t1 Initial program 66.0%
associate-/l*67.2%
distribute-lft-neg-out67.2%
distribute-rgt-neg-in67.2%
associate-/r*81.2%
distribute-neg-frac281.2%
Simplified81.2%
associate-*r/99.9%
+-commutative99.9%
distribute-neg-in99.9%
sub-neg99.9%
associate-*l/99.9%
clear-num99.9%
frac-2neg99.9%
frac-times96.6%
*-un-lft-identity96.6%
frac-2neg96.6%
sub-neg96.6%
distribute-neg-in96.6%
+-commutative96.6%
remove-double-neg96.6%
add-sqr-sqrt51.3%
sqrt-unprod33.2%
sqr-neg33.2%
sqrt-unprod14.3%
add-sqr-sqrt32.1%
add-sqr-sqrt21.2%
sqrt-unprod54.1%
Applied egg-rr96.6%
Taylor expanded in u around 0 83.5%
*-commutative83.5%
Simplified83.5%
if -1.89999999999999997e-60 < t1 < 4.6000000000000003e-167Initial program 79.3%
associate-/l*83.0%
distribute-lft-neg-out83.0%
distribute-rgt-neg-in83.0%
associate-/r*87.9%
distribute-neg-frac287.9%
Simplified87.9%
Taylor expanded in t1 around 0 82.3%
Final simplification83.1%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -1.25e-154) (not (<= t1 6.7e-168))) (/ v (- (- (* u 2.0)) t1)) (/ (* v (/ t1 u)) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.25e-154) || !(t1 <= 6.7e-168)) {
tmp = v / (-(u * 2.0) - t1);
} else {
tmp = (v * (t1 / 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 <= (-1.25d-154)) .or. (.not. (t1 <= 6.7d-168))) then
tmp = v / (-(u * 2.0d0) - t1)
else
tmp = (v * (t1 / u)) / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.25e-154) || !(t1 <= 6.7e-168)) {
tmp = v / (-(u * 2.0) - t1);
} else {
tmp = (v * (t1 / u)) / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1.25e-154) or not (t1 <= 6.7e-168): tmp = v / (-(u * 2.0) - t1) else: tmp = (v * (t1 / u)) / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.25e-154) || !(t1 <= 6.7e-168)) tmp = Float64(v / Float64(Float64(-Float64(u * 2.0)) - t1)); else tmp = Float64(Float64(v * Float64(t1 / u)) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -1.25e-154) || ~((t1 <= 6.7e-168))) tmp = v / (-(u * 2.0) - t1); else tmp = (v * (t1 / u)) / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.25e-154], N[Not[LessEqual[t1, 6.7e-168]], $MachinePrecision]], N[(v / N[((-N[(u * 2.0), $MachinePrecision]) - t1), $MachinePrecision]), $MachinePrecision], N[(N[(v * N[(t1 / u), $MachinePrecision]), $MachinePrecision] / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.25 \cdot 10^{-154} \lor \neg \left(t1 \leq 6.7 \cdot 10^{-168}\right):\\
\;\;\;\;\frac{v}{\left(-u \cdot 2\right) - t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v \cdot \frac{t1}{u}}{t1}\\
\end{array}
\end{array}
if t1 < -1.25000000000000005e-154 or 6.69999999999999988e-168 < t1 Initial program 67.7%
associate-/l*68.8%
distribute-lft-neg-out68.8%
distribute-rgt-neg-in68.8%
associate-/r*81.9%
distribute-neg-frac281.9%
Simplified81.9%
associate-*r/99.9%
+-commutative99.9%
distribute-neg-in99.9%
sub-neg99.9%
associate-*l/99.9%
clear-num99.9%
frac-2neg99.9%
frac-times96.0%
*-un-lft-identity96.0%
frac-2neg96.0%
sub-neg96.0%
distribute-neg-in96.0%
+-commutative96.0%
remove-double-neg96.0%
add-sqr-sqrt54.8%
sqrt-unprod38.4%
sqr-neg38.4%
sqrt-unprod13.0%
add-sqr-sqrt32.5%
add-sqr-sqrt20.5%
sqrt-unprod52.9%
Applied egg-rr96.0%
Taylor expanded in u around 0 80.9%
*-commutative80.9%
Simplified80.9%
if -1.25000000000000005e-154 < t1 < 6.69999999999999988e-168Initial program 77.8%
associate-/l*82.6%
distribute-lft-neg-out82.6%
distribute-rgt-neg-in82.6%
associate-/r*87.4%
distribute-neg-frac287.4%
Simplified87.4%
Taylor expanded in t1 around 0 85.0%
Taylor expanded in u around 0 24.4%
associate-*r/24.4%
mul-1-neg24.4%
Simplified24.4%
associate-*r/33.7%
distribute-rgt-neg-in33.7%
*-commutative33.7%
*-commutative33.7%
associate-/r*51.8%
*-commutative51.8%
distribute-rgt-neg-in51.8%
add-sqr-sqrt27.7%
sqrt-unprod51.8%
sqr-neg51.8%
sqrt-unprod25.8%
add-sqr-sqrt54.9%
Applied egg-rr54.9%
*-commutative54.9%
associate-/l*60.0%
Applied egg-rr60.0%
Final simplification76.0%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -5.4e-61) (not (<= t1 9.5e-166))) (/ (- v) t1) (/ (* v (/ t1 u)) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -5.4e-61) || !(t1 <= 9.5e-166)) {
tmp = -v / t1;
} else {
tmp = (v * (t1 / 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 <= (-5.4d-61)) .or. (.not. (t1 <= 9.5d-166))) then
tmp = -v / t1
else
tmp = (v * (t1 / u)) / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -5.4e-61) || !(t1 <= 9.5e-166)) {
tmp = -v / t1;
} else {
tmp = (v * (t1 / u)) / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -5.4e-61) or not (t1 <= 9.5e-166): tmp = -v / t1 else: tmp = (v * (t1 / u)) / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -5.4e-61) || !(t1 <= 9.5e-166)) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(v * Float64(t1 / u)) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -5.4e-61) || ~((t1 <= 9.5e-166))) tmp = -v / t1; else tmp = (v * (t1 / u)) / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -5.4e-61], N[Not[LessEqual[t1, 9.5e-166]], $MachinePrecision]], N[((-v) / t1), $MachinePrecision], N[(N[(v * N[(t1 / u), $MachinePrecision]), $MachinePrecision] / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -5.4 \cdot 10^{-61} \lor \neg \left(t1 \leq 9.5 \cdot 10^{-166}\right):\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v \cdot \frac{t1}{u}}{t1}\\
\end{array}
\end{array}
if t1 < -5.39999999999999987e-61 or 9.50000000000000046e-166 < t1 Initial program 66.0%
associate-/l*67.2%
distribute-lft-neg-out67.2%
distribute-rgt-neg-in67.2%
associate-/r*81.2%
distribute-neg-frac281.2%
Simplified81.2%
Taylor expanded in t1 around inf 79.0%
associate-*r/79.0%
neg-mul-179.0%
Simplified79.0%
if -5.39999999999999987e-61 < t1 < 9.50000000000000046e-166Initial program 79.3%
associate-/l*83.0%
distribute-lft-neg-out83.0%
distribute-rgt-neg-in83.0%
associate-/r*87.9%
distribute-neg-frac287.9%
Simplified87.9%
Taylor expanded in t1 around 0 82.3%
Taylor expanded in u around 0 25.1%
associate-*r/25.1%
mul-1-neg25.1%
Simplified25.1%
associate-*r/33.4%
distribute-rgt-neg-in33.4%
*-commutative33.4%
*-commutative33.4%
associate-/r*48.2%
*-commutative48.2%
distribute-rgt-neg-in48.2%
add-sqr-sqrt22.9%
sqrt-unprod49.4%
sqr-neg49.4%
sqrt-unprod27.8%
add-sqr-sqrt51.6%
Applied egg-rr51.6%
*-commutative51.6%
associate-/l*56.8%
Applied egg-rr56.8%
Final simplification72.3%
(FPCore (u v t1) :precision binary64 (if (or (<= u -2.6e+121) (not (<= u 3.1e+113))) (* v (/ (/ t1 u) t1)) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.6e+121) || !(u <= 3.1e+113)) {
tmp = v * ((t1 / u) / t1);
} 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 <= (-2.6d+121)) .or. (.not. (u <= 3.1d+113))) then
tmp = v * ((t1 / u) / t1)
else
tmp = -v / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.6e+121) || !(u <= 3.1e+113)) {
tmp = v * ((t1 / u) / t1);
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -2.6e+121) or not (u <= 3.1e+113): tmp = v * ((t1 / u) / t1) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -2.6e+121) || !(u <= 3.1e+113)) tmp = Float64(v * Float64(Float64(t1 / u) / t1)); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -2.6e+121) || ~((u <= 3.1e+113))) tmp = v * ((t1 / u) / t1); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.6e+121], N[Not[LessEqual[u, 3.1e+113]], $MachinePrecision]], N[(v * N[(N[(t1 / u), $MachinePrecision] / t1), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.6 \cdot 10^{+121} \lor \neg \left(u \leq 3.1 \cdot 10^{+113}\right):\\
\;\;\;\;v \cdot \frac{\frac{t1}{u}}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -2.5999999999999999e121 or 3.09999999999999991e113 < u Initial program 76.1%
associate-/l*75.4%
distribute-lft-neg-out75.4%
distribute-rgt-neg-in75.4%
associate-/r*86.5%
distribute-neg-frac286.5%
Simplified86.5%
Taylor expanded in t1 around 0 86.0%
associate-*r/90.5%
+-commutative90.5%
distribute-neg-in90.5%
sub-neg90.5%
associate-*l/89.4%
*-commutative89.4%
clear-num89.3%
frac-times84.9%
*-un-lft-identity84.9%
sub-neg84.9%
distribute-neg-in84.9%
+-commutative84.9%
add-sqr-sqrt46.7%
sqrt-unprod70.5%
sqr-neg70.5%
sqrt-unprod32.1%
add-sqr-sqrt67.9%
Applied egg-rr67.9%
Taylor expanded in u around 0 48.1%
*-commutative48.1%
associate-*r/48.1%
Simplified48.1%
associate-/r*55.0%
associate-/r/61.5%
Applied egg-rr61.5%
if -2.5999999999999999e121 < u < 3.09999999999999991e113Initial program 67.4%
associate-/l*70.5%
distribute-lft-neg-out70.5%
distribute-rgt-neg-in70.5%
associate-/r*81.8%
distribute-neg-frac281.8%
Simplified81.8%
Taylor expanded in t1 around inf 75.8%
associate-*r/75.8%
neg-mul-175.8%
Simplified75.8%
Final simplification71.4%
(FPCore (u v t1) :precision binary64 (if (or (<= u -2.6e+109) (not (<= u 1.45e+163))) (* (/ t1 u) (/ v t1)) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.6e+109) || !(u <= 1.45e+163)) {
tmp = (t1 / u) * (v / t1);
} 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 <= (-2.6d+109)) .or. (.not. (u <= 1.45d+163))) then
tmp = (t1 / u) * (v / t1)
else
tmp = -v / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.6e+109) || !(u <= 1.45e+163)) {
tmp = (t1 / u) * (v / t1);
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -2.6e+109) or not (u <= 1.45e+163): tmp = (t1 / u) * (v / t1) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -2.6e+109) || !(u <= 1.45e+163)) tmp = Float64(Float64(t1 / u) * Float64(v / t1)); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -2.6e+109) || ~((u <= 1.45e+163))) tmp = (t1 / u) * (v / t1); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.6e+109], N[Not[LessEqual[u, 1.45e+163]], $MachinePrecision]], N[(N[(t1 / u), $MachinePrecision] * N[(v / t1), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.6 \cdot 10^{+109} \lor \neg \left(u \leq 1.45 \cdot 10^{+163}\right):\\
\;\;\;\;\frac{t1}{u} \cdot \frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -2.5999999999999998e109 or 1.44999999999999999e163 < u Initial program 75.1%
associate-/l*75.6%
distribute-lft-neg-out75.6%
distribute-rgt-neg-in75.6%
associate-/r*88.5%
distribute-neg-frac288.5%
Simplified88.5%
Taylor expanded in t1 around 0 88.0%
associate-*r/90.9%
+-commutative90.9%
distribute-neg-in90.9%
sub-neg90.9%
associate-*l/90.9%
*-commutative90.9%
clear-num90.8%
frac-times86.6%
*-un-lft-identity86.6%
sub-neg86.6%
distribute-neg-in86.6%
+-commutative86.6%
add-sqr-sqrt54.4%
sqrt-unprod75.5%
sqr-neg75.5%
sqrt-unprod30.8%
add-sqr-sqrt72.5%
Applied egg-rr72.5%
Taylor expanded in u around 0 52.4%
*-commutative52.4%
associate-*r/52.4%
Simplified52.4%
*-un-lft-identity52.4%
*-commutative52.4%
times-frac59.2%
clear-num59.2%
Applied egg-rr59.2%
if -2.5999999999999998e109 < u < 1.44999999999999999e163Initial program 68.3%
associate-/l*70.7%
distribute-lft-neg-out70.7%
distribute-rgt-neg-in70.7%
associate-/r*81.3%
distribute-neg-frac281.3%
Simplified81.3%
Taylor expanded in t1 around inf 73.1%
associate-*r/73.1%
neg-mul-173.1%
Simplified73.1%
Final simplification69.5%
(FPCore (u v t1) :precision binary64 (if (or (<= u -3.8e+192) (not (<= u 1.15e+167))) (/ v u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -3.8e+192) || !(u <= 1.15e+167)) {
tmp = v / u;
} else {
tmp = -v / t1;
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if ((u <= (-3.8d+192)) .or. (.not. (u <= 1.15d+167))) then
tmp = v / u
else
tmp = -v / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -3.8e+192) || !(u <= 1.15e+167)) {
tmp = v / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -3.8e+192) or not (u <= 1.15e+167): tmp = v / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -3.8e+192) || !(u <= 1.15e+167)) 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 <= -3.8e+192) || ~((u <= 1.15e+167))) tmp = v / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -3.8e+192], N[Not[LessEqual[u, 1.15e+167]], $MachinePrecision]], N[(v / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.8 \cdot 10^{+192} \lor \neg \left(u \leq 1.15 \cdot 10^{+167}\right):\\
\;\;\;\;\frac{v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -3.7999999999999999e192 or 1.14999999999999994e167 < u Initial program 79.1%
associate-/l*79.7%
distribute-lft-neg-out79.7%
distribute-rgt-neg-in79.7%
associate-/r*90.3%
distribute-neg-frac290.3%
Simplified90.3%
Taylor expanded in t1 around 0 90.0%
associate-*r/92.0%
+-commutative92.0%
distribute-neg-in92.0%
sub-neg92.0%
associate-*l/92.0%
*-commutative92.0%
clear-num92.0%
frac-times88.4%
*-un-lft-identity88.4%
sub-neg88.4%
distribute-neg-in88.4%
+-commutative88.4%
add-sqr-sqrt47.6%
sqrt-unprod79.7%
sqr-neg79.7%
sqrt-unprod39.0%
add-sqr-sqrt79.5%
Applied egg-rr79.5%
Taylor expanded in t1 around inf 61.4%
if -3.7999999999999999e192 < u < 1.14999999999999994e167Initial program 67.7%
associate-/l*70.0%
distribute-lft-neg-out70.0%
distribute-rgt-neg-in70.0%
associate-/r*81.4%
distribute-neg-frac281.4%
Simplified81.4%
Taylor expanded in t1 around inf 70.2%
associate-*r/70.2%
neg-mul-170.2%
Simplified70.2%
Final simplification68.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 70.0%
associate-/l*72.0%
distribute-lft-neg-out72.0%
distribute-rgt-neg-in72.0%
associate-/r*83.2%
distribute-neg-frac283.2%
Simplified83.2%
Taylor expanded in t1 around 0 49.2%
associate-*r/48.2%
+-commutative48.2%
distribute-neg-in48.2%
sub-neg48.2%
associate-*l/49.2%
*-commutative49.2%
clear-num49.4%
frac-times49.2%
*-un-lft-identity49.2%
sub-neg49.2%
distribute-neg-in49.2%
+-commutative49.2%
add-sqr-sqrt29.0%
sqrt-unprod44.4%
sqr-neg44.4%
sqrt-unprod14.3%
add-sqr-sqrt32.7%
Applied egg-rr32.7%
Taylor expanded in t1 around inf 20.4%
herbie shell --seed 2024103
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))