
(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[(N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * (-v)), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{t1 + u}
\end{array}
Initial program 70.8%
associate-/l*70.0%
distribute-lft-neg-out70.0%
distribute-rgt-neg-in70.0%
associate-/r*82.6%
distribute-neg-frac282.6%
Simplified82.6%
associate-*r/97.7%
+-commutative97.7%
distribute-neg-in97.7%
sub-neg97.7%
associate-*l/98.3%
frac-2neg98.3%
associate-*r/99.0%
remove-double-neg99.0%
sub-neg99.0%
distribute-neg-in99.0%
+-commutative99.0%
frac-2neg99.0%
add-sqr-sqrt55.1%
sqrt-unprod42.6%
sqr-neg42.6%
sqrt-unprod13.3%
add-sqr-sqrt32.3%
add-sqr-sqrt17.6%
sqrt-unprod48.4%
Applied egg-rr99.0%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -3.8e+39) (not (<= t1 1.65e+81))) (/ v (- (* u (- 2.0)) t1)) (* t1 (/ (/ v (+ t1 u)) (- (- u) t1)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3.8e+39) || !(t1 <= 1.65e+81)) {
tmp = v / ((u * -2.0) - t1);
} else {
tmp = t1 * ((v / (t1 + 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.8d+39)) .or. (.not. (t1 <= 1.65d+81))) then
tmp = v / ((u * -2.0d0) - t1)
else
tmp = t1 * ((v / (t1 + u)) / (-u - t1))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3.8e+39) || !(t1 <= 1.65e+81)) {
tmp = v / ((u * -2.0) - t1);
} else {
tmp = t1 * ((v / (t1 + u)) / (-u - t1));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -3.8e+39) or not (t1 <= 1.65e+81): tmp = v / ((u * -2.0) - t1) else: tmp = t1 * ((v / (t1 + u)) / (-u - t1)) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -3.8e+39) || !(t1 <= 1.65e+81)) tmp = Float64(v / Float64(Float64(u * Float64(-2.0)) - t1)); else tmp = Float64(t1 * Float64(Float64(v / Float64(t1 + u)) / Float64(Float64(-u) - t1))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -3.8e+39) || ~((t1 <= 1.65e+81))) tmp = v / ((u * -2.0) - t1); else tmp = t1 * ((v / (t1 + u)) / (-u - t1)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -3.8e+39], N[Not[LessEqual[t1, 1.65e+81]], $MachinePrecision]], N[(v / N[(N[(u * (-2.0)), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], N[(t1 * N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3.8 \cdot 10^{+39} \lor \neg \left(t1 \leq 1.65 \cdot 10^{+81}\right):\\
\;\;\;\;\frac{v}{u \cdot \left(-2\right) - t1}\\
\mathbf{else}:\\
\;\;\;\;t1 \cdot \frac{\frac{v}{t1 + u}}{\left(-u\right) - t1}\\
\end{array}
\end{array}
if t1 < -3.7999999999999998e39 or 1.65e81 < t1 Initial program 55.8%
associate-/l*57.1%
distribute-lft-neg-out57.1%
distribute-rgt-neg-in57.1%
associate-/r*75.2%
distribute-neg-frac275.2%
Simplified75.2%
associate-*r/99.9%
+-commutative99.9%
distribute-neg-in99.9%
sub-neg99.9%
associate-*l/99.9%
frac-2neg99.9%
clear-num99.9%
frac-times98.9%
*-un-lft-identity98.9%
+-commutative98.9%
distribute-neg-in98.9%
sub-neg98.9%
Applied egg-rr98.9%
Taylor expanded in u around 0 92.2%
*-commutative92.2%
Simplified92.2%
if -3.7999999999999998e39 < t1 < 1.65e81Initial program 82.0%
associate-/l*79.8%
distribute-lft-neg-out79.8%
distribute-rgt-neg-in79.8%
associate-/r*88.2%
distribute-neg-frac288.2%
Simplified88.2%
Final simplification89.9%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -5.2e-7) (not (<= t1 8.6e-51))) (/ v (- (* u (- 2.0)) t1)) (* (/ t1 (- u)) (/ v u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -5.2e-7) || !(t1 <= 8.6e-51)) {
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 <= (-5.2d-7)) .or. (.not. (t1 <= 8.6d-51))) 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 <= -5.2e-7) || !(t1 <= 8.6e-51)) {
tmp = v / ((u * -2.0) - t1);
} else {
tmp = (t1 / -u) * (v / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -5.2e-7) or not (t1 <= 8.6e-51): tmp = v / ((u * -2.0) - t1) else: tmp = (t1 / -u) * (v / u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -5.2e-7) || !(t1 <= 8.6e-51)) tmp = Float64(v / Float64(Float64(u * Float64(-2.0)) - t1)); else tmp = Float64(Float64(t1 / Float64(-u)) * Float64(v / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -5.2e-7) || ~((t1 <= 8.6e-51))) 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, -5.2e-7], N[Not[LessEqual[t1, 8.6e-51]], $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 -5.2 \cdot 10^{-7} \lor \neg \left(t1 \leq 8.6 \cdot 10^{-51}\right):\\
\;\;\;\;\frac{v}{u \cdot \left(-2\right) - t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1}{-u} \cdot \frac{v}{u}\\
\end{array}
\end{array}
if t1 < -5.19999999999999998e-7 or 8.5999999999999995e-51 < t1 Initial program 64.8%
associate-/l*65.7%
distribute-lft-neg-out65.7%
distribute-rgt-neg-in65.7%
associate-/r*80.9%
distribute-neg-frac280.9%
Simplified80.9%
associate-*r/99.8%
+-commutative99.8%
distribute-neg-in99.8%
sub-neg99.8%
associate-*l/99.8%
frac-2neg99.8%
clear-num99.9%
frac-times97.8%
*-un-lft-identity97.8%
+-commutative97.8%
distribute-neg-in97.8%
sub-neg97.8%
Applied egg-rr97.8%
Taylor expanded in u around 0 87.2%
*-commutative87.2%
Simplified87.2%
if -5.19999999999999998e-7 < t1 < 8.5999999999999995e-51Initial program 78.5%
times-frac96.3%
distribute-frac-neg96.3%
distribute-neg-frac296.3%
+-commutative96.3%
distribute-neg-in96.3%
unsub-neg96.3%
Simplified96.3%
Taylor expanded in t1 around 0 76.6%
Taylor expanded in t1 around 0 77.0%
associate-*r/77.0%
mul-1-neg77.0%
Simplified77.0%
Final simplification82.8%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -3.2e-7) (not (<= t1 4e-50))) (/ v (- (- u) t1)) (* (/ t1 (- u)) (/ v u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3.2e-7) || !(t1 <= 4e-50)) {
tmp = v / (-u - 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 <= (-3.2d-7)) .or. (.not. (t1 <= 4d-50))) then
tmp = v / (-u - 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 <= -3.2e-7) || !(t1 <= 4e-50)) {
tmp = v / (-u - t1);
} else {
tmp = (t1 / -u) * (v / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -3.2e-7) or not (t1 <= 4e-50): tmp = v / (-u - t1) else: tmp = (t1 / -u) * (v / u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -3.2e-7) || !(t1 <= 4e-50)) tmp = Float64(v / Float64(Float64(-u) - t1)); else tmp = Float64(Float64(t1 / Float64(-u)) * Float64(v / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -3.2e-7) || ~((t1 <= 4e-50))) tmp = v / (-u - t1); else tmp = (t1 / -u) * (v / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -3.2e-7], N[Not[LessEqual[t1, 4e-50]], $MachinePrecision]], N[(v / N[((-u) - t1), $MachinePrecision]), $MachinePrecision], N[(N[(t1 / (-u)), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3.2 \cdot 10^{-7} \lor \neg \left(t1 \leq 4 \cdot 10^{-50}\right):\\
\;\;\;\;\frac{v}{\left(-u\right) - t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1}{-u} \cdot \frac{v}{u}\\
\end{array}
\end{array}
if t1 < -3.2000000000000001e-7 or 4.00000000000000003e-50 < t1 Initial program 64.8%
associate-/l*65.7%
distribute-lft-neg-out65.7%
distribute-rgt-neg-in65.7%
associate-/r*80.9%
distribute-neg-frac280.9%
Simplified80.9%
associate-*r/99.8%
+-commutative99.8%
distribute-neg-in99.8%
sub-neg99.8%
associate-*l/99.8%
frac-2neg99.8%
associate-*r/99.9%
remove-double-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
+-commutative99.9%
frac-2neg99.9%
add-sqr-sqrt48.3%
sqrt-unprod31.8%
sqr-neg31.8%
sqrt-unprod14.3%
add-sqr-sqrt29.5%
add-sqr-sqrt14.6%
sqrt-unprod49.0%
Applied egg-rr99.9%
Taylor expanded in t1 around inf 86.6%
mul-1-neg86.6%
Simplified86.6%
if -3.2000000000000001e-7 < t1 < 4.00000000000000003e-50Initial program 78.5%
times-frac96.3%
distribute-frac-neg96.3%
distribute-neg-frac296.3%
+-commutative96.3%
distribute-neg-in96.3%
unsub-neg96.3%
Simplified96.3%
Taylor expanded in t1 around 0 76.6%
Taylor expanded in t1 around 0 77.0%
associate-*r/77.0%
mul-1-neg77.0%
Simplified77.0%
Final simplification82.4%
(FPCore (u v t1) :precision binary64 (if (or (<= u -2.65e+110) (not (<= u 6.5e+227))) (/ t1 (* u (/ u v))) (/ v (- (- u) t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.65e+110) || !(u <= 6.5e+227)) {
tmp = t1 / (u * (u / v));
} else {
tmp = v / (-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 ((u <= (-2.65d+110)) .or. (.not. (u <= 6.5d+227))) then
tmp = t1 / (u * (u / v))
else
tmp = v / (-u - t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.65e+110) || !(u <= 6.5e+227)) {
tmp = t1 / (u * (u / v));
} else {
tmp = v / (-u - t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -2.65e+110) or not (u <= 6.5e+227): tmp = t1 / (u * (u / v)) else: tmp = v / (-u - t1) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -2.65e+110) || !(u <= 6.5e+227)) tmp = Float64(t1 / Float64(u * Float64(u / v))); else tmp = Float64(v / Float64(Float64(-u) - t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -2.65e+110) || ~((u <= 6.5e+227))) tmp = t1 / (u * (u / v)); else tmp = v / (-u - t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.65e+110], N[Not[LessEqual[u, 6.5e+227]], $MachinePrecision]], N[(t1 / N[(u * N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.65 \cdot 10^{+110} \lor \neg \left(u \leq 6.5 \cdot 10^{+227}\right):\\
\;\;\;\;\frac{t1}{u \cdot \frac{u}{v}}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{\left(-u\right) - t1}\\
\end{array}
\end{array}
if u < -2.6499999999999999e110 or 6.50000000000000018e227 < u Initial program 79.3%
times-frac99.8%
distribute-frac-neg99.8%
distribute-neg-frac299.8%
+-commutative99.8%
distribute-neg-in99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in t1 around 0 89.3%
Taylor expanded in t1 around 0 89.2%
associate-*r/89.2%
mul-1-neg89.2%
Simplified89.2%
*-commutative89.2%
clear-num89.2%
frac-times83.3%
*-un-lft-identity83.3%
add-sqr-sqrt52.7%
sqrt-unprod63.3%
sqr-neg63.3%
sqrt-unprod25.2%
add-sqr-sqrt74.5%
Applied egg-rr74.5%
if -2.6499999999999999e110 < u < 6.50000000000000018e227Initial program 68.3%
associate-/l*67.2%
distribute-lft-neg-out67.2%
distribute-rgt-neg-in67.2%
associate-/r*80.6%
distribute-neg-frac280.6%
Simplified80.6%
associate-*r/97.1%
+-commutative97.1%
distribute-neg-in97.1%
sub-neg97.1%
associate-*l/97.9%
frac-2neg97.9%
associate-*r/98.8%
remove-double-neg98.8%
sub-neg98.8%
distribute-neg-in98.8%
+-commutative98.8%
frac-2neg98.8%
add-sqr-sqrt53.8%
sqrt-unprod36.6%
sqr-neg36.6%
sqrt-unprod9.9%
add-sqr-sqrt20.3%
add-sqr-sqrt8.5%
sqrt-unprod40.9%
Applied egg-rr98.8%
Taylor expanded in t1 around inf 69.5%
mul-1-neg69.5%
Simplified69.5%
Final simplification70.6%
(FPCore (u v t1) :precision binary64 (if (or (<= u -1.3e+177) (not (<= u 9e+216))) (* (/ v u) 0.5) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.3e+177) || !(u <= 9e+216)) {
tmp = (v / u) * 0.5;
} 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.3d+177)) .or. (.not. (u <= 9d+216))) then
tmp = (v / u) * 0.5d0
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.3e+177) || !(u <= 9e+216)) {
tmp = (v / u) * 0.5;
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -1.3e+177) or not (u <= 9e+216): tmp = (v / u) * 0.5 else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -1.3e+177) || !(u <= 9e+216)) tmp = Float64(Float64(v / u) * 0.5); else tmp = Float64(v / Float64(-t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -1.3e+177) || ~((u <= 9e+216))) tmp = (v / u) * 0.5; else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.3e+177], N[Not[LessEqual[u, 9e+216]], $MachinePrecision]], N[(N[(v / u), $MachinePrecision] * 0.5), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.3 \cdot 10^{+177} \lor \neg \left(u \leq 9 \cdot 10^{+216}\right):\\
\;\;\;\;\frac{v}{u} \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if u < -1.2999999999999999e177 or 9.0000000000000005e216 < u Initial program 79.1%
associate-/l*79.6%
distribute-lft-neg-out79.6%
distribute-rgt-neg-in79.6%
associate-/r*88.4%
distribute-neg-frac288.4%
Simplified88.4%
associate-*r/99.8%
+-commutative99.8%
distribute-neg-in99.8%
sub-neg99.8%
associate-*l/99.8%
frac-2neg99.8%
clear-num99.8%
frac-times93.5%
*-un-lft-identity93.5%
+-commutative93.5%
distribute-neg-in93.5%
sub-neg93.5%
Applied egg-rr93.5%
Taylor expanded in u around 0 51.6%
*-commutative51.6%
Simplified51.6%
Taylor expanded in t1 around 0 47.6%
*-commutative47.6%
Simplified47.6%
frac-2neg47.6%
associate-*l/47.6%
add-sqr-sqrt22.3%
sqrt-unprod47.4%
sqr-neg47.4%
sqrt-unprod25.7%
add-sqr-sqrt48.0%
Applied egg-rr48.0%
distribute-frac-neg248.0%
*-commutative48.0%
associate-*r/48.0%
*-commutative48.0%
distribute-rgt-neg-in48.0%
metadata-eval48.0%
Simplified48.0%
if -1.2999999999999999e177 < u < 9.0000000000000005e216Initial program 68.9%
associate-/l*67.9%
distribute-lft-neg-out67.9%
distribute-rgt-neg-in67.9%
associate-/r*81.3%
distribute-neg-frac281.3%
Simplified81.3%
Taylor expanded in t1 around inf 65.6%
associate-*r/65.6%
neg-mul-165.6%
Simplified65.6%
Final simplification62.3%
(FPCore (u v t1) :precision binary64 (if (<= u -3.5e+177) (* (/ v u) 0.5) (if (<= u 1.7e+189) (/ v (- t1)) (/ v (+ t1 u)))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -3.5e+177) {
tmp = (v / u) * 0.5;
} else if (u <= 1.7e+189) {
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 <= (-3.5d+177)) then
tmp = (v / u) * 0.5d0
else if (u <= 1.7d+189) 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 <= -3.5e+177) {
tmp = (v / u) * 0.5;
} else if (u <= 1.7e+189) {
tmp = v / -t1;
} else {
tmp = v / (t1 + u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -3.5e+177: tmp = (v / u) * 0.5 elif u <= 1.7e+189: tmp = v / -t1 else: tmp = v / (t1 + u) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -3.5e+177) tmp = Float64(Float64(v / u) * 0.5); elseif (u <= 1.7e+189) tmp = Float64(v / Float64(-t1)); else tmp = Float64(v / Float64(t1 + u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -3.5e+177) tmp = (v / u) * 0.5; elseif (u <= 1.7e+189) tmp = v / -t1; else tmp = v / (t1 + u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -3.5e+177], N[(N[(v / u), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[u, 1.7e+189], N[(v / (-t1)), $MachinePrecision], N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.5 \cdot 10^{+177}:\\
\;\;\;\;\frac{v}{u} \cdot 0.5\\
\mathbf{elif}\;u \leq 1.7 \cdot 10^{+189}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{t1 + u}\\
\end{array}
\end{array}
if u < -3.49999999999999991e177Initial program 81.8%
associate-/l*82.2%
distribute-lft-neg-out82.2%
distribute-rgt-neg-in82.2%
associate-/r*94.0%
distribute-neg-frac294.0%
Simplified94.0%
associate-*r/99.8%
+-commutative99.8%
distribute-neg-in99.8%
sub-neg99.8%
associate-*l/99.9%
frac-2neg99.9%
clear-num99.9%
frac-times89.3%
*-un-lft-identity89.3%
+-commutative89.3%
distribute-neg-in89.3%
sub-neg89.3%
Applied egg-rr89.3%
Taylor expanded in u around 0 47.4%
*-commutative47.4%
Simplified47.4%
Taylor expanded in t1 around 0 43.7%
*-commutative43.7%
Simplified43.7%
frac-2neg43.7%
associate-*l/43.7%
add-sqr-sqrt19.9%
sqrt-unprod43.3%
sqr-neg43.3%
sqrt-unprod24.3%
add-sqr-sqrt44.2%
Applied egg-rr44.2%
distribute-frac-neg244.2%
*-commutative44.2%
associate-*r/44.2%
*-commutative44.2%
distribute-rgt-neg-in44.2%
metadata-eval44.2%
Simplified44.2%
if -3.49999999999999991e177 < u < 1.69999999999999992e189Initial program 69.6%
associate-/l*68.5%
distribute-lft-neg-out68.5%
distribute-rgt-neg-in68.5%
associate-/r*81.3%
distribute-neg-frac281.3%
Simplified81.3%
Taylor expanded in t1 around inf 66.6%
associate-*r/66.6%
neg-mul-166.6%
Simplified66.6%
if 1.69999999999999992e189 < u Initial program 68.7%
associate-/l*69.5%
distribute-lft-neg-out69.5%
distribute-rgt-neg-in69.5%
associate-/r*81.0%
distribute-neg-frac281.0%
Simplified81.0%
Taylor expanded in t1 around inf 53.9%
associate-*r/53.1%
clear-num53.1%
add-sqr-sqrt4.0%
sqrt-unprod53.5%
sqr-neg53.5%
sqrt-unprod42.9%
add-sqr-sqrt46.9%
Applied egg-rr46.9%
associate-/r/46.9%
associate-*r/46.5%
associate-*r/50.2%
associate-*l/50.2%
*-lft-identity50.2%
*-commutative50.2%
associate-/r*49.7%
times-frac47.3%
*-inverses47.3%
*-rgt-identity47.3%
Simplified47.3%
Final simplification62.3%
(FPCore (u v t1) :precision binary64 (if (<= u -3.5e+178) (/ v u) (if (<= u 2.25e+192) (/ v (- t1)) (* v (/ -0.5 u)))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -3.5e+178) {
tmp = v / u;
} else if (u <= 2.25e+192) {
tmp = v / -t1;
} else {
tmp = v * (-0.5 / 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.5d+178)) then
tmp = v / u
else if (u <= 2.25d+192) then
tmp = v / -t1
else
tmp = v * ((-0.5d0) / u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -3.5e+178) {
tmp = v / u;
} else if (u <= 2.25e+192) {
tmp = v / -t1;
} else {
tmp = v * (-0.5 / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -3.5e+178: tmp = v / u elif u <= 2.25e+192: tmp = v / -t1 else: tmp = v * (-0.5 / u) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -3.5e+178) tmp = Float64(v / u); elseif (u <= 2.25e+192) tmp = Float64(v / Float64(-t1)); else tmp = Float64(v * Float64(-0.5 / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -3.5e+178) tmp = v / u; elseif (u <= 2.25e+192) tmp = v / -t1; else tmp = v * (-0.5 / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -3.5e+178], N[(v / u), $MachinePrecision], If[LessEqual[u, 2.25e+192], N[(v / (-t1)), $MachinePrecision], N[(v * N[(-0.5 / u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.5 \cdot 10^{+178}:\\
\;\;\;\;\frac{v}{u}\\
\mathbf{elif}\;u \leq 2.25 \cdot 10^{+192}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{else}:\\
\;\;\;\;v \cdot \frac{-0.5}{u}\\
\end{array}
\end{array}
if u < -3.5e178Initial program 81.8%
associate-/l*82.2%
distribute-lft-neg-out82.2%
distribute-rgt-neg-in82.2%
associate-/r*94.0%
distribute-neg-frac294.0%
Simplified94.0%
associate-*r/99.8%
+-commutative99.8%
distribute-neg-in99.8%
sub-neg99.8%
associate-*l/99.9%
frac-2neg99.9%
associate-*r/99.9%
remove-double-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
+-commutative99.9%
frac-2neg99.9%
add-sqr-sqrt59.2%
sqrt-unprod78.1%
sqr-neg78.1%
sqrt-unprod29.9%
add-sqr-sqrt81.9%
add-sqr-sqrt81.9%
sqrt-unprod82.2%
Applied egg-rr99.9%
Taylor expanded in t1 around inf 47.4%
mul-1-neg47.4%
Simplified47.4%
clear-num47.4%
associate-/r/47.4%
add-sqr-sqrt19.9%
sqrt-unprod43.2%
sqr-neg43.2%
sqrt-unprod24.0%
add-sqr-sqrt43.9%
Applied egg-rr43.9%
Taylor expanded in t1 around 0 44.2%
if -3.5e178 < u < 2.25e192Initial program 69.2%
associate-/l*68.2%
distribute-lft-neg-out68.2%
distribute-rgt-neg-in68.2%
associate-/r*81.4%
distribute-neg-frac281.4%
Simplified81.4%
Taylor expanded in t1 around inf 66.3%
associate-*r/66.3%
neg-mul-166.3%
Simplified66.3%
if 2.25e192 < u Initial program 71.6%
associate-/l*72.2%
distribute-lft-neg-out72.2%
distribute-rgt-neg-in72.2%
associate-/r*80.2%
distribute-neg-frac280.2%
Simplified80.2%
associate-*r/99.7%
+-commutative99.7%
distribute-neg-in99.7%
sub-neg99.7%
associate-*l/99.7%
frac-2neg99.7%
clear-num99.7%
frac-times99.2%
*-un-lft-identity99.2%
+-commutative99.2%
distribute-neg-in99.2%
sub-neg99.2%
Applied egg-rr99.2%
Taylor expanded in u around 0 56.4%
*-commutative56.4%
Simplified56.4%
Taylor expanded in t1 around 0 48.9%
*-commutative48.9%
Simplified48.9%
Taylor expanded in v around 0 48.9%
associate-*r/48.9%
*-commutative48.9%
associate-*r/48.9%
Simplified48.9%
Final simplification62.3%
(FPCore (u v t1) :precision binary64 (if (or (<= u -1.65e+180) (not (<= u 3e+220))) (/ v u) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.65e+180) || !(u <= 3e+220)) {
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.65d+180)) .or. (.not. (u <= 3d+220))) 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.65e+180) || !(u <= 3e+220)) {
tmp = v / u;
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -1.65e+180) or not (u <= 3e+220): tmp = v / u else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -1.65e+180) || !(u <= 3e+220)) tmp = Float64(v / u); else tmp = Float64(v / Float64(-t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -1.65e+180) || ~((u <= 3e+220))) tmp = v / u; else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.65e+180], N[Not[LessEqual[u, 3e+220]], $MachinePrecision]], N[(v / u), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.65 \cdot 10^{+180} \lor \neg \left(u \leq 3 \cdot 10^{+220}\right):\\
\;\;\;\;\frac{v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if u < -1.64999999999999995e180 or 3.00000000000000024e220 < u Initial program 79.1%
associate-/l*79.6%
distribute-lft-neg-out79.6%
distribute-rgt-neg-in79.6%
associate-/r*88.4%
distribute-neg-frac288.4%
Simplified88.4%
associate-*r/99.8%
+-commutative99.8%
distribute-neg-in99.8%
sub-neg99.8%
associate-*l/99.8%
frac-2neg99.8%
associate-*r/99.9%
remove-double-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
+-commutative99.9%
frac-2neg99.9%
add-sqr-sqrt65.9%
sqrt-unprod66.5%
sqr-neg66.5%
sqrt-unprod21.9%
add-sqr-sqrt79.3%
add-sqr-sqrt49.2%
sqrt-unprod79.6%
Applied egg-rr99.9%
Taylor expanded in t1 around inf 51.2%
mul-1-neg51.2%
Simplified51.2%
clear-num51.2%
associate-/r/51.2%
add-sqr-sqrt22.3%
sqrt-unprod47.5%
sqr-neg47.5%
sqrt-unprod25.7%
add-sqr-sqrt47.9%
Applied egg-rr47.9%
Taylor expanded in t1 around 0 48.0%
if -1.64999999999999995e180 < u < 3.00000000000000024e220Initial program 68.9%
associate-/l*67.9%
distribute-lft-neg-out67.9%
distribute-rgt-neg-in67.9%
associate-/r*81.3%
distribute-neg-frac281.3%
Simplified81.3%
Taylor expanded in t1 around inf 65.6%
associate-*r/65.6%
neg-mul-165.6%
Simplified65.6%
Final simplification62.3%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -2.6e+206) (not (<= t1 4.6e+80))) (/ v t1) (/ v u)))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -2.6e+206) || !(t1 <= 4.6e+80)) {
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 <= (-2.6d+206)) .or. (.not. (t1 <= 4.6d+80))) 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 <= -2.6e+206) || !(t1 <= 4.6e+80)) {
tmp = v / t1;
} else {
tmp = v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -2.6e+206) or not (t1 <= 4.6e+80): tmp = v / t1 else: tmp = v / u return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -2.6e+206) || !(t1 <= 4.6e+80)) 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 <= -2.6e+206) || ~((t1 <= 4.6e+80))) tmp = v / t1; else tmp = v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -2.6e+206], N[Not[LessEqual[t1, 4.6e+80]], $MachinePrecision]], N[(v / t1), $MachinePrecision], N[(v / u), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.6 \cdot 10^{+206} \lor \neg \left(t1 \leq 4.6 \cdot 10^{+80}\right):\\
\;\;\;\;\frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\
\end{array}
\end{array}
if t1 < -2.59999999999999989e206 or 4.60000000000000008e80 < t1 Initial program 43.0%
associate-/l*45.8%
distribute-lft-neg-out45.8%
distribute-rgt-neg-in45.8%
associate-/r*66.8%
distribute-neg-frac266.8%
Simplified66.8%
associate-*r/99.8%
+-commutative99.8%
distribute-neg-in99.8%
sub-neg99.8%
associate-*l/99.9%
frac-2neg99.9%
associate-*r/99.9%
remove-double-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
+-commutative99.9%
frac-2neg99.9%
add-sqr-sqrt30.8%
sqrt-unprod4.4%
sqr-neg4.4%
sqrt-unprod19.9%
add-sqr-sqrt31.1%
add-sqr-sqrt11.2%
sqrt-unprod47.1%
Applied egg-rr99.9%
Taylor expanded in t1 around inf 90.0%
mul-1-neg90.0%
Simplified90.0%
clear-num87.6%
associate-/r/89.8%
add-sqr-sqrt44.9%
sqrt-unprod46.8%
sqr-neg46.8%
sqrt-unprod18.2%
add-sqr-sqrt31.4%
Applied egg-rr31.4%
Taylor expanded in t1 around inf 31.0%
if -2.59999999999999989e206 < t1 < 4.60000000000000008e80Initial program 81.4%
associate-/l*79.4%
distribute-lft-neg-out79.4%
distribute-rgt-neg-in79.4%
associate-/r*88.7%
distribute-neg-frac288.7%
Simplified88.7%
associate-*r/96.9%
+-commutative96.9%
distribute-neg-in96.9%
sub-neg96.9%
associate-*l/97.7%
frac-2neg97.7%
associate-*r/98.7%
remove-double-neg98.7%
sub-neg98.7%
distribute-neg-in98.7%
+-commutative98.7%
frac-2neg98.7%
add-sqr-sqrt64.4%
sqrt-unprod57.3%
sqr-neg57.3%
sqrt-unprod10.8%
add-sqr-sqrt32.8%
add-sqr-sqrt20.1%
sqrt-unprod48.9%
Applied egg-rr98.7%
Taylor expanded in t1 around inf 55.8%
mul-1-neg55.8%
Simplified55.8%
clear-num55.9%
associate-/r/55.7%
add-sqr-sqrt23.1%
sqrt-unprod30.3%
sqr-neg30.3%
sqrt-unprod10.0%
add-sqr-sqrt19.3%
Applied egg-rr19.3%
Taylor expanded in t1 around 0 18.8%
Final simplification22.2%
(FPCore (u v t1) :precision binary64 (* (/ t1 (+ t1 u)) (/ v (- (- u) t1))))
double code(double u, double v, double t1) {
return (t1 / (t1 + u)) * (v / (-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 = (t1 / (t1 + u)) * (v / (-u - t1))
end function
public static double code(double u, double v, double t1) {
return (t1 / (t1 + u)) * (v / (-u - t1));
}
def code(u, v, t1): return (t1 / (t1 + u)) * (v / (-u - t1))
function code(u, v, t1) return Float64(Float64(t1 / Float64(t1 + u)) * Float64(v / Float64(Float64(-u) - t1))) end
function tmp = code(u, v, t1) tmp = (t1 / (t1 + u)) * (v / (-u - t1)); end
code[u_, v_, t1_] := N[(N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(v / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t1}{t1 + u} \cdot \frac{v}{\left(-u\right) - t1}
\end{array}
Initial program 70.8%
times-frac98.3%
distribute-frac-neg98.3%
distribute-neg-frac298.3%
+-commutative98.3%
distribute-neg-in98.3%
unsub-neg98.3%
Simplified98.3%
Final simplification98.3%
(FPCore (u v t1) :precision binary64 (/ v (- (- u) t1)))
double code(double u, double v, double t1) {
return v / (-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 / (-u - t1)
end function
public static double code(double u, double v, double t1) {
return v / (-u - t1);
}
def code(u, v, t1): return v / (-u - t1)
function code(u, v, t1) return Float64(v / Float64(Float64(-u) - t1)) end
function tmp = code(u, v, t1) tmp = v / (-u - t1); end
code[u_, v_, t1_] := N[(v / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{\left(-u\right) - t1}
\end{array}
Initial program 70.8%
associate-/l*70.0%
distribute-lft-neg-out70.0%
distribute-rgt-neg-in70.0%
associate-/r*82.6%
distribute-neg-frac282.6%
Simplified82.6%
associate-*r/97.7%
+-commutative97.7%
distribute-neg-in97.7%
sub-neg97.7%
associate-*l/98.3%
frac-2neg98.3%
associate-*r/99.0%
remove-double-neg99.0%
sub-neg99.0%
distribute-neg-in99.0%
+-commutative99.0%
frac-2neg99.0%
add-sqr-sqrt55.1%
sqrt-unprod42.6%
sqr-neg42.6%
sqrt-unprod13.3%
add-sqr-sqrt32.3%
add-sqr-sqrt17.6%
sqrt-unprod48.4%
Applied egg-rr99.0%
Taylor expanded in t1 around inf 65.3%
mul-1-neg65.3%
Simplified65.3%
Final simplification65.3%
(FPCore (u v t1) :precision binary64 (/ v t1))
double code(double u, double v, double t1) {
return v / t1;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = v / t1
end function
public static double code(double u, double v, double t1) {
return v / t1;
}
def code(u, v, t1): return v / t1
function code(u, v, t1) return Float64(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 70.8%
associate-/l*70.0%
distribute-lft-neg-out70.0%
distribute-rgt-neg-in70.0%
associate-/r*82.6%
distribute-neg-frac282.6%
Simplified82.6%
associate-*r/97.7%
+-commutative97.7%
distribute-neg-in97.7%
sub-neg97.7%
associate-*l/98.3%
frac-2neg98.3%
associate-*r/99.0%
remove-double-neg99.0%
sub-neg99.0%
distribute-neg-in99.0%
+-commutative99.0%
frac-2neg99.0%
add-sqr-sqrt55.1%
sqrt-unprod42.6%
sqr-neg42.6%
sqrt-unprod13.3%
add-sqr-sqrt32.3%
add-sqr-sqrt17.6%
sqrt-unprod48.4%
Applied egg-rr99.0%
Taylor expanded in t1 around inf 65.3%
mul-1-neg65.3%
Simplified65.3%
clear-num64.7%
associate-/r/65.1%
add-sqr-sqrt29.2%
sqrt-unprod34.9%
sqr-neg34.9%
sqrt-unprod12.2%
add-sqr-sqrt22.7%
Applied egg-rr22.7%
Taylor expanded in t1 around inf 12.6%
herbie shell --seed 2024106
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))