
(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 14 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 (/ v (+ t1 u))) -1.0) (+ t1 u)))
double code(double u, double v, double t1) {
return ((t1 * (v / (t1 + u))) / -1.0) / (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))) / (-1.0d0)) / (t1 + u)
end function
public static double code(double u, double v, double t1) {
return ((t1 * (v / (t1 + u))) / -1.0) / (t1 + u);
}
def code(u, v, t1): return ((t1 * (v / (t1 + u))) / -1.0) / (t1 + u)
function code(u, v, t1) return Float64(Float64(Float64(t1 * Float64(v / Float64(t1 + u))) / -1.0) / Float64(t1 + u)) end
function tmp = code(u, v, t1) tmp = ((t1 * (v / (t1 + u))) / -1.0) / (t1 + u); end
code[u_, v_, t1_] := N[(N[(N[(t1 * N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / -1.0), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{t1 \cdot \frac{v}{t1 + u}}{-1}}{t1 + u}
\end{array}
Initial program 76.6%
associate-/l*76.9%
distribute-lft-neg-out76.9%
distribute-rgt-neg-in76.9%
associate-/r*88.0%
distribute-neg-frac288.0%
Simplified88.0%
associate-*r/98.5%
neg-mul-198.5%
associate-/r*98.5%
Applied egg-rr98.5%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ v (* t1 (/ (- u t1) t1)))) (t_2 (* (/ v u) (/ t1 (- u)))))
(if (<= u -1.05e+103)
t_2
(if (<= u -2.3e+48)
t_1
(if (<= u -2.4e-63)
t_2
(if (<= u 3.2e-45)
(/ v (- t1))
(if (or (<= u 6.2e+20) (not (<= u 8.5e+138))) t_2 t_1)))))))
double code(double u, double v, double t1) {
double t_1 = v / (t1 * ((u - t1) / t1));
double t_2 = (v / u) * (t1 / -u);
double tmp;
if (u <= -1.05e+103) {
tmp = t_2;
} else if (u <= -2.3e+48) {
tmp = t_1;
} else if (u <= -2.4e-63) {
tmp = t_2;
} else if (u <= 3.2e-45) {
tmp = v / -t1;
} else if ((u <= 6.2e+20) || !(u <= 8.5e+138)) {
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 - t1) / t1))
t_2 = (v / u) * (t1 / -u)
if (u <= (-1.05d+103)) then
tmp = t_2
else if (u <= (-2.3d+48)) then
tmp = t_1
else if (u <= (-2.4d-63)) then
tmp = t_2
else if (u <= 3.2d-45) then
tmp = v / -t1
else if ((u <= 6.2d+20) .or. (.not. (u <= 8.5d+138))) 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 - t1) / t1));
double t_2 = (v / u) * (t1 / -u);
double tmp;
if (u <= -1.05e+103) {
tmp = t_2;
} else if (u <= -2.3e+48) {
tmp = t_1;
} else if (u <= -2.4e-63) {
tmp = t_2;
} else if (u <= 3.2e-45) {
tmp = v / -t1;
} else if ((u <= 6.2e+20) || !(u <= 8.5e+138)) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = v / (t1 * ((u - t1) / t1)) t_2 = (v / u) * (t1 / -u) tmp = 0 if u <= -1.05e+103: tmp = t_2 elif u <= -2.3e+48: tmp = t_1 elif u <= -2.4e-63: tmp = t_2 elif u <= 3.2e-45: tmp = v / -t1 elif (u <= 6.2e+20) or not (u <= 8.5e+138): tmp = t_2 else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(v / Float64(t1 * Float64(Float64(u - t1) / t1))) t_2 = Float64(Float64(v / u) * Float64(t1 / Float64(-u))) tmp = 0.0 if (u <= -1.05e+103) tmp = t_2; elseif (u <= -2.3e+48) tmp = t_1; elseif (u <= -2.4e-63) tmp = t_2; elseif (u <= 3.2e-45) tmp = Float64(v / Float64(-t1)); elseif ((u <= 6.2e+20) || !(u <= 8.5e+138)) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = v / (t1 * ((u - t1) / t1)); t_2 = (v / u) * (t1 / -u); tmp = 0.0; if (u <= -1.05e+103) tmp = t_2; elseif (u <= -2.3e+48) tmp = t_1; elseif (u <= -2.4e-63) tmp = t_2; elseif (u <= 3.2e-45) tmp = v / -t1; elseif ((u <= 6.2e+20) || ~((u <= 8.5e+138))) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v / N[(t1 * N[(N[(u - t1), $MachinePrecision] / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(v / u), $MachinePrecision] * N[(t1 / (-u)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -1.05e+103], t$95$2, If[LessEqual[u, -2.3e+48], t$95$1, If[LessEqual[u, -2.4e-63], t$95$2, If[LessEqual[u, 3.2e-45], N[(v / (-t1)), $MachinePrecision], If[Or[LessEqual[u, 6.2e+20], N[Not[LessEqual[u, 8.5e+138]], $MachinePrecision]], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{v}{t1 \cdot \frac{u - t1}{t1}}\\
t_2 := \frac{v}{u} \cdot \frac{t1}{-u}\\
\mathbf{if}\;u \leq -1.05 \cdot 10^{+103}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;u \leq -2.3 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq -2.4 \cdot 10^{-63}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;u \leq 3.2 \cdot 10^{-45}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{elif}\;u \leq 6.2 \cdot 10^{+20} \lor \neg \left(u \leq 8.5 \cdot 10^{+138}\right):\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -1.0500000000000001e103 or -2.3e48 < u < -2.4000000000000001e-63 or 3.20000000000000007e-45 < u < 6.2e20 or 8.5000000000000006e138 < u Initial program 82.6%
times-frac98.4%
distribute-frac-neg98.4%
distribute-neg-frac298.4%
+-commutative98.4%
distribute-neg-in98.4%
unsub-neg98.4%
Simplified98.4%
Taylor expanded in t1 around 0 87.9%
Taylor expanded in t1 around 0 87.9%
associate-*r/87.9%
mul-1-neg87.9%
Simplified87.9%
if -1.0500000000000001e103 < u < -2.3e48 or 6.2e20 < u < 8.5000000000000006e138Initial program 64.8%
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 inf 75.8%
clear-num75.8%
frac-times81.4%
*-un-lft-identity81.4%
add-sqr-sqrt30.7%
sqrt-unprod81.5%
sqr-neg81.5%
sqrt-unprod50.8%
add-sqr-sqrt81.9%
Applied egg-rr81.9%
if -2.4000000000000001e-63 < u < 3.20000000000000007e-45Initial program 73.8%
associate-/l*72.0%
distribute-lft-neg-out72.0%
distribute-rgt-neg-in72.0%
associate-/r*82.5%
distribute-neg-frac282.5%
Simplified82.5%
Taylor expanded in t1 around inf 84.9%
associate-*r/84.9%
neg-mul-184.9%
Simplified84.9%
Final simplification85.8%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ v (* t1 (/ (- u t1) t1))))
(t_2 (- (- u) t1))
(t_3 (* t1 (/ (/ v u) t_2))))
(if (<= u -1.75e+104)
(/ (* t1 (/ v u)) t_2)
(if (<= u -3.9e+48)
t_1
(if (<= u -7.8e-62)
t_3
(if (<= u 1.45e-45)
(/ v (- t1))
(if (<= u 1.05e+22)
t_3
(if (<= u 9.2e+134) t_1 (* (/ v u) (/ t1 (- u)))))))))))
double code(double u, double v, double t1) {
double t_1 = v / (t1 * ((u - t1) / t1));
double t_2 = -u - t1;
double t_3 = t1 * ((v / u) / t_2);
double tmp;
if (u <= -1.75e+104) {
tmp = (t1 * (v / u)) / t_2;
} else if (u <= -3.9e+48) {
tmp = t_1;
} else if (u <= -7.8e-62) {
tmp = t_3;
} else if (u <= 1.45e-45) {
tmp = v / -t1;
} else if (u <= 1.05e+22) {
tmp = t_3;
} else if (u <= 9.2e+134) {
tmp = t_1;
} else {
tmp = (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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = v / (t1 * ((u - t1) / t1))
t_2 = -u - t1
t_3 = t1 * ((v / u) / t_2)
if (u <= (-1.75d+104)) then
tmp = (t1 * (v / u)) / t_2
else if (u <= (-3.9d+48)) then
tmp = t_1
else if (u <= (-7.8d-62)) then
tmp = t_3
else if (u <= 1.45d-45) then
tmp = v / -t1
else if (u <= 1.05d+22) then
tmp = t_3
else if (u <= 9.2d+134) then
tmp = t_1
else
tmp = (v / u) * (t1 / -u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = v / (t1 * ((u - t1) / t1));
double t_2 = -u - t1;
double t_3 = t1 * ((v / u) / t_2);
double tmp;
if (u <= -1.75e+104) {
tmp = (t1 * (v / u)) / t_2;
} else if (u <= -3.9e+48) {
tmp = t_1;
} else if (u <= -7.8e-62) {
tmp = t_3;
} else if (u <= 1.45e-45) {
tmp = v / -t1;
} else if (u <= 1.05e+22) {
tmp = t_3;
} else if (u <= 9.2e+134) {
tmp = t_1;
} else {
tmp = (v / u) * (t1 / -u);
}
return tmp;
}
def code(u, v, t1): t_1 = v / (t1 * ((u - t1) / t1)) t_2 = -u - t1 t_3 = t1 * ((v / u) / t_2) tmp = 0 if u <= -1.75e+104: tmp = (t1 * (v / u)) / t_2 elif u <= -3.9e+48: tmp = t_1 elif u <= -7.8e-62: tmp = t_3 elif u <= 1.45e-45: tmp = v / -t1 elif u <= 1.05e+22: tmp = t_3 elif u <= 9.2e+134: tmp = t_1 else: tmp = (v / u) * (t1 / -u) return tmp
function code(u, v, t1) t_1 = Float64(v / Float64(t1 * Float64(Float64(u - t1) / t1))) t_2 = Float64(Float64(-u) - t1) t_3 = Float64(t1 * Float64(Float64(v / u) / t_2)) tmp = 0.0 if (u <= -1.75e+104) tmp = Float64(Float64(t1 * Float64(v / u)) / t_2); elseif (u <= -3.9e+48) tmp = t_1; elseif (u <= -7.8e-62) tmp = t_3; elseif (u <= 1.45e-45) tmp = Float64(v / Float64(-t1)); elseif (u <= 1.05e+22) tmp = t_3; elseif (u <= 9.2e+134) tmp = t_1; else tmp = Float64(Float64(v / u) * Float64(t1 / Float64(-u))); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = v / (t1 * ((u - t1) / t1)); t_2 = -u - t1; t_3 = t1 * ((v / u) / t_2); tmp = 0.0; if (u <= -1.75e+104) tmp = (t1 * (v / u)) / t_2; elseif (u <= -3.9e+48) tmp = t_1; elseif (u <= -7.8e-62) tmp = t_3; elseif (u <= 1.45e-45) tmp = v / -t1; elseif (u <= 1.05e+22) tmp = t_3; elseif (u <= 9.2e+134) tmp = t_1; else tmp = (v / u) * (t1 / -u); end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v / N[(t1 * N[(N[(u - t1), $MachinePrecision] / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-u) - t1), $MachinePrecision]}, Block[{t$95$3 = N[(t1 * N[(N[(v / u), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -1.75e+104], N[(N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[u, -3.9e+48], t$95$1, If[LessEqual[u, -7.8e-62], t$95$3, If[LessEqual[u, 1.45e-45], N[(v / (-t1)), $MachinePrecision], If[LessEqual[u, 1.05e+22], t$95$3, If[LessEqual[u, 9.2e+134], t$95$1, N[(N[(v / u), $MachinePrecision] * N[(t1 / (-u)), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{v}{t1 \cdot \frac{u - t1}{t1}}\\
t_2 := \left(-u\right) - t1\\
t_3 := t1 \cdot \frac{\frac{v}{u}}{t\_2}\\
\mathbf{if}\;u \leq -1.75 \cdot 10^{+104}:\\
\;\;\;\;\frac{t1 \cdot \frac{v}{u}}{t\_2}\\
\mathbf{elif}\;u \leq -3.9 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq -7.8 \cdot 10^{-62}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;u \leq 1.45 \cdot 10^{-45}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{elif}\;u \leq 1.05 \cdot 10^{+22}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;u \leq 9.2 \cdot 10^{+134}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u} \cdot \frac{t1}{-u}\\
\end{array}
\end{array}
if u < -1.7500000000000001e104Initial program 84.3%
times-frac96.2%
distribute-frac-neg96.2%
distribute-neg-frac296.2%
+-commutative96.2%
distribute-neg-in96.2%
unsub-neg96.2%
Simplified96.2%
Taylor expanded in t1 around 0 94.2%
associate-*l/97.8%
frac-2neg97.8%
sub-neg97.8%
distribute-neg-in97.8%
add-sqr-sqrt97.7%
sqrt-unprod82.4%
sqr-neg82.4%
sqrt-unprod0.0%
add-sqr-sqrt69.1%
distribute-neg-in69.1%
sub-neg69.1%
neg-sub069.1%
associate-+l-69.1%
neg-sub069.1%
add-sqr-sqrt69.1%
sqrt-unprod69.4%
sqr-neg69.4%
sqrt-unprod0.0%
add-sqr-sqrt97.8%
+-commutative97.8%
Applied egg-rr97.8%
if -1.7500000000000001e104 < u < -3.9000000000000001e48 or 1.0499999999999999e22 < u < 9.1999999999999992e134Initial program 64.8%
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 inf 75.8%
clear-num75.8%
frac-times81.4%
*-un-lft-identity81.4%
add-sqr-sqrt30.7%
sqrt-unprod81.5%
sqr-neg81.5%
sqrt-unprod50.8%
add-sqr-sqrt81.9%
Applied egg-rr81.9%
if -3.9000000000000001e48 < u < -7.8000000000000007e-62 or 1.45e-45 < u < 1.0499999999999999e22Initial program 87.8%
associate-/l*88.8%
distribute-lft-neg-out88.8%
distribute-rgt-neg-in88.8%
associate-/r*95.1%
distribute-neg-frac295.1%
Simplified95.1%
Taylor expanded in t1 around 0 77.7%
if -7.8000000000000007e-62 < u < 1.45e-45Initial program 73.8%
associate-/l*72.0%
distribute-lft-neg-out72.0%
distribute-rgt-neg-in72.0%
associate-/r*82.5%
distribute-neg-frac282.5%
Simplified82.5%
Taylor expanded in t1 around inf 84.9%
associate-*r/84.9%
neg-mul-184.9%
Simplified84.9%
if 9.1999999999999992e134 < u Initial program 77.1%
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 93.2%
Taylor expanded in t1 around 0 93.3%
associate-*r/93.3%
mul-1-neg93.3%
Simplified93.3%
Final simplification87.2%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (* t1 (/ (/ v u) (- (- u) t1)))))
(if (<= u -1.1e-63)
t_1
(if (<= u 4.2e-45)
(/ v (- t1))
(if (<= u 5.8e+18)
t_1
(if (<= u 8.5e+134)
(/ v (* t1 (/ (- u t1) t1)))
(* (/ v u) (/ t1 (- u)))))))))
double code(double u, double v, double t1) {
double t_1 = t1 * ((v / u) / (-u - t1));
double tmp;
if (u <= -1.1e-63) {
tmp = t_1;
} else if (u <= 4.2e-45) {
tmp = v / -t1;
} else if (u <= 5.8e+18) {
tmp = t_1;
} else if (u <= 8.5e+134) {
tmp = v / (t1 * ((u - t1) / t1));
} else {
tmp = (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) :: t_1
real(8) :: tmp
t_1 = t1 * ((v / u) / (-u - t1))
if (u <= (-1.1d-63)) then
tmp = t_1
else if (u <= 4.2d-45) then
tmp = v / -t1
else if (u <= 5.8d+18) then
tmp = t_1
else if (u <= 8.5d+134) then
tmp = v / (t1 * ((u - t1) / t1))
else
tmp = (v / u) * (t1 / -u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = t1 * ((v / u) / (-u - t1));
double tmp;
if (u <= -1.1e-63) {
tmp = t_1;
} else if (u <= 4.2e-45) {
tmp = v / -t1;
} else if (u <= 5.8e+18) {
tmp = t_1;
} else if (u <= 8.5e+134) {
tmp = v / (t1 * ((u - t1) / t1));
} else {
tmp = (v / u) * (t1 / -u);
}
return tmp;
}
def code(u, v, t1): t_1 = t1 * ((v / u) / (-u - t1)) tmp = 0 if u <= -1.1e-63: tmp = t_1 elif u <= 4.2e-45: tmp = v / -t1 elif u <= 5.8e+18: tmp = t_1 elif u <= 8.5e+134: tmp = v / (t1 * ((u - t1) / t1)) else: tmp = (v / u) * (t1 / -u) return tmp
function code(u, v, t1) t_1 = Float64(t1 * Float64(Float64(v / u) / Float64(Float64(-u) - t1))) tmp = 0.0 if (u <= -1.1e-63) tmp = t_1; elseif (u <= 4.2e-45) tmp = Float64(v / Float64(-t1)); elseif (u <= 5.8e+18) tmp = t_1; elseif (u <= 8.5e+134) tmp = Float64(v / Float64(t1 * Float64(Float64(u - t1) / t1))); else tmp = Float64(Float64(v / u) * Float64(t1 / Float64(-u))); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = t1 * ((v / u) / (-u - t1)); tmp = 0.0; if (u <= -1.1e-63) tmp = t_1; elseif (u <= 4.2e-45) tmp = v / -t1; elseif (u <= 5.8e+18) tmp = t_1; elseif (u <= 8.5e+134) tmp = v / (t1 * ((u - t1) / t1)); else tmp = (v / u) * (t1 / -u); end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(t1 * N[(N[(v / u), $MachinePrecision] / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -1.1e-63], t$95$1, If[LessEqual[u, 4.2e-45], N[(v / (-t1)), $MachinePrecision], If[LessEqual[u, 5.8e+18], t$95$1, If[LessEqual[u, 8.5e+134], N[(v / N[(t1 * N[(N[(u - t1), $MachinePrecision] / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(v / u), $MachinePrecision] * N[(t1 / (-u)), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t1 \cdot \frac{\frac{v}{u}}{\left(-u\right) - t1}\\
\mathbf{if}\;u \leq -1.1 \cdot 10^{-63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 4.2 \cdot 10^{-45}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{elif}\;u \leq 5.8 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 8.5 \cdot 10^{+134}:\\
\;\;\;\;\frac{v}{t1 \cdot \frac{u - t1}{t1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u} \cdot \frac{t1}{-u}\\
\end{array}
\end{array}
if u < -1.1e-63 or 4.1999999999999999e-45 < u < 5.8e18Initial program 83.5%
associate-/l*84.1%
distribute-lft-neg-out84.1%
distribute-rgt-neg-in84.1%
associate-/r*94.2%
distribute-neg-frac294.2%
Simplified94.2%
Taylor expanded in t1 around 0 82.7%
if -1.1e-63 < u < 4.1999999999999999e-45Initial program 73.8%
associate-/l*72.0%
distribute-lft-neg-out72.0%
distribute-rgt-neg-in72.0%
associate-/r*82.5%
distribute-neg-frac282.5%
Simplified82.5%
Taylor expanded in t1 around inf 84.9%
associate-*r/84.9%
neg-mul-184.9%
Simplified84.9%
if 5.8e18 < u < 8.50000000000000024e134Initial program 60.3%
times-frac99.7%
distribute-frac-neg99.7%
distribute-neg-frac299.7%
+-commutative99.7%
distribute-neg-in99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in t1 around inf 78.3%
clear-num78.3%
frac-times83.0%
*-un-lft-identity83.0%
add-sqr-sqrt0.0%
sqrt-unprod83.1%
sqr-neg83.1%
sqrt-unprod83.1%
add-sqr-sqrt83.1%
Applied egg-rr83.1%
if 8.50000000000000024e134 < u Initial program 77.1%
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 93.2%
Taylor expanded in t1 around 0 93.3%
associate-*r/93.3%
mul-1-neg93.3%
Simplified93.3%
Final simplification85.4%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (* (/ v u) (/ t1 (- u)))))
(if (<= u -7.8e-62)
t_1
(if (<= u 1.25e-45)
(/ v (- t1))
(if (or (<= u 68000000000000.0) (not (<= u 5.1e+65)))
t_1
(/ v (- (* u (- 2.0)) t1)))))))
double code(double u, double v, double t1) {
double t_1 = (v / u) * (t1 / -u);
double tmp;
if (u <= -7.8e-62) {
tmp = t_1;
} else if (u <= 1.25e-45) {
tmp = v / -t1;
} else if ((u <= 68000000000000.0) || !(u <= 5.1e+65)) {
tmp = t_1;
} else {
tmp = v / ((u * -2.0) - 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 = (v / u) * (t1 / -u)
if (u <= (-7.8d-62)) then
tmp = t_1
else if (u <= 1.25d-45) then
tmp = v / -t1
else if ((u <= 68000000000000.0d0) .or. (.not. (u <= 5.1d+65))) then
tmp = t_1
else
tmp = v / ((u * -2.0d0) - t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = (v / u) * (t1 / -u);
double tmp;
if (u <= -7.8e-62) {
tmp = t_1;
} else if (u <= 1.25e-45) {
tmp = v / -t1;
} else if ((u <= 68000000000000.0) || !(u <= 5.1e+65)) {
tmp = t_1;
} else {
tmp = v / ((u * -2.0) - t1);
}
return tmp;
}
def code(u, v, t1): t_1 = (v / u) * (t1 / -u) tmp = 0 if u <= -7.8e-62: tmp = t_1 elif u <= 1.25e-45: tmp = v / -t1 elif (u <= 68000000000000.0) or not (u <= 5.1e+65): tmp = t_1 else: tmp = v / ((u * -2.0) - t1) return tmp
function code(u, v, t1) t_1 = Float64(Float64(v / u) * Float64(t1 / Float64(-u))) tmp = 0.0 if (u <= -7.8e-62) tmp = t_1; elseif (u <= 1.25e-45) tmp = Float64(v / Float64(-t1)); elseif ((u <= 68000000000000.0) || !(u <= 5.1e+65)) tmp = t_1; else tmp = Float64(v / Float64(Float64(u * Float64(-2.0)) - t1)); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = (v / u) * (t1 / -u); tmp = 0.0; if (u <= -7.8e-62) tmp = t_1; elseif (u <= 1.25e-45) tmp = v / -t1; elseif ((u <= 68000000000000.0) || ~((u <= 5.1e+65))) tmp = t_1; else tmp = v / ((u * -2.0) - t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(v / u), $MachinePrecision] * N[(t1 / (-u)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -7.8e-62], t$95$1, If[LessEqual[u, 1.25e-45], N[(v / (-t1)), $MachinePrecision], If[Or[LessEqual[u, 68000000000000.0], N[Not[LessEqual[u, 5.1e+65]], $MachinePrecision]], t$95$1, N[(v / N[(N[(u * (-2.0)), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{v}{u} \cdot \frac{t1}{-u}\\
\mathbf{if}\;u \leq -7.8 \cdot 10^{-62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 1.25 \cdot 10^{-45}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{elif}\;u \leq 68000000000000 \lor \neg \left(u \leq 5.1 \cdot 10^{+65}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u \cdot \left(-2\right) - t1}\\
\end{array}
\end{array}
if u < -7.8000000000000007e-62 or 1.24999999999999994e-45 < u < 6.8e13 or 5.09999999999999989e65 < u Initial program 79.7%
times-frac98.7%
distribute-frac-neg98.7%
distribute-neg-frac298.7%
+-commutative98.7%
distribute-neg-in98.7%
unsub-neg98.7%
Simplified98.7%
Taylor expanded in t1 around 0 82.0%
Taylor expanded in t1 around 0 82.2%
associate-*r/82.2%
mul-1-neg82.2%
Simplified82.2%
if -7.8000000000000007e-62 < u < 1.24999999999999994e-45Initial program 73.8%
associate-/l*72.0%
distribute-lft-neg-out72.0%
distribute-rgt-neg-in72.0%
associate-/r*82.5%
distribute-neg-frac282.5%
Simplified82.5%
Taylor expanded in t1 around inf 84.9%
associate-*r/84.9%
neg-mul-184.9%
Simplified84.9%
if 6.8e13 < u < 5.09999999999999989e65Initial program 57.5%
associate-/l*68.9%
distribute-lft-neg-out68.9%
distribute-rgt-neg-in68.9%
associate-/r*68.9%
distribute-neg-frac268.9%
Simplified68.9%
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-sqrt32.7%
sqrt-unprod56.2%
sqr-neg56.2%
sqrt-unprod34.6%
add-sqr-sqrt35.5%
add-sqr-sqrt0.9%
sqrt-unprod47.0%
Applied egg-rr100.0%
Taylor expanded in u around 0 90.7%
*-commutative90.7%
Simplified90.7%
Final simplification83.6%
(FPCore (u v t1) :precision binary64 (if (or (<= u -6.2e-62) (not (<= u 5.1e-45))) (* (/ v u) (/ t1 (- u))) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -6.2e-62) || !(u <= 5.1e-45)) {
tmp = (v / 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 ((u <= (-6.2d-62)) .or. (.not. (u <= 5.1d-45))) then
tmp = (v / 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 ((u <= -6.2e-62) || !(u <= 5.1e-45)) {
tmp = (v / u) * (t1 / -u);
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -6.2e-62) or not (u <= 5.1e-45): tmp = (v / u) * (t1 / -u) else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -6.2e-62) || !(u <= 5.1e-45)) tmp = Float64(Float64(v / u) * Float64(t1 / Float64(-u))); else tmp = Float64(v / Float64(-t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -6.2e-62) || ~((u <= 5.1e-45))) tmp = (v / u) * (t1 / -u); else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -6.2e-62], N[Not[LessEqual[u, 5.1e-45]], $MachinePrecision]], N[(N[(v / u), $MachinePrecision] * N[(t1 / (-u)), $MachinePrecision]), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -6.2 \cdot 10^{-62} \lor \neg \left(u \leq 5.1 \cdot 10^{-45}\right):\\
\;\;\;\;\frac{v}{u} \cdot \frac{t1}{-u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if u < -6.1999999999999999e-62 or 5.0999999999999997e-45 < u Initial program 78.4%
times-frac98.7%
distribute-frac-neg98.7%
distribute-neg-frac298.7%
+-commutative98.7%
distribute-neg-in98.7%
unsub-neg98.7%
Simplified98.7%
Taylor expanded in t1 around 0 79.3%
Taylor expanded in t1 around 0 79.5%
associate-*r/79.5%
mul-1-neg79.5%
Simplified79.5%
if -6.1999999999999999e-62 < u < 5.0999999999999997e-45Initial program 73.8%
associate-/l*72.0%
distribute-lft-neg-out72.0%
distribute-rgt-neg-in72.0%
associate-/r*82.5%
distribute-neg-frac282.5%
Simplified82.5%
Taylor expanded in t1 around inf 84.9%
associate-*r/84.9%
neg-mul-184.9%
Simplified84.9%
Final simplification81.7%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -4e-203) (not (<= t1 4.8e-188))) (/ v (- (- u) t1)) (/ (* t1 (/ v u)) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -4e-203) || !(t1 <= 4.8e-188)) {
tmp = v / (-u - t1);
} else {
tmp = (t1 * (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 ((t1 <= (-4d-203)) .or. (.not. (t1 <= 4.8d-188))) then
tmp = v / (-u - t1)
else
tmp = (t1 * (v / u)) / t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -4e-203) || !(t1 <= 4.8e-188)) {
tmp = v / (-u - t1);
} else {
tmp = (t1 * (v / u)) / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -4e-203) or not (t1 <= 4.8e-188): tmp = v / (-u - t1) else: tmp = (t1 * (v / u)) / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -4e-203) || !(t1 <= 4.8e-188)) tmp = Float64(v / Float64(Float64(-u) - t1)); else tmp = Float64(Float64(t1 * Float64(v / u)) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -4e-203) || ~((t1 <= 4.8e-188))) tmp = v / (-u - t1); else tmp = (t1 * (v / u)) / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -4e-203], N[Not[LessEqual[t1, 4.8e-188]], $MachinePrecision]], N[(v / N[((-u) - t1), $MachinePrecision]), $MachinePrecision], N[(N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision] / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -4 \cdot 10^{-203} \lor \neg \left(t1 \leq 4.8 \cdot 10^{-188}\right):\\
\;\;\;\;\frac{v}{\left(-u\right) - t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1 \cdot \frac{v}{u}}{t1}\\
\end{array}
\end{array}
if t1 < -4.0000000000000001e-203 or 4.8e-188 < t1 Initial program 73.3%
times-frac99.2%
distribute-frac-neg99.2%
distribute-neg-frac299.2%
+-commutative99.2%
distribute-neg-in99.2%
unsub-neg99.2%
Simplified99.2%
Taylor expanded in t1 around inf 70.6%
Taylor expanded in v around 0 68.4%
associate-*r/68.4%
neg-mul-168.4%
Simplified68.4%
if -4.0000000000000001e-203 < t1 < 4.8e-188Initial program 89.7%
times-frac93.6%
distribute-frac-neg93.6%
distribute-neg-frac293.6%
+-commutative93.6%
distribute-neg-in93.6%
unsub-neg93.6%
Simplified93.6%
Taylor expanded in t1 around inf 49.2%
frac-times44.5%
associate-/r*62.4%
sub-neg62.4%
distribute-neg-in62.4%
+-commutative62.4%
neg-mul-162.4%
associate-/l/62.4%
associate-*r/64.4%
associate-/l*64.4%
associate-/l/64.4%
neg-mul-164.4%
+-commutative64.4%
distribute-neg-in64.4%
sub-neg64.4%
add-sqr-sqrt28.1%
sqrt-unprod67.3%
sqr-neg67.3%
sqrt-unprod35.9%
add-sqr-sqrt62.0%
Applied egg-rr62.0%
Taylor expanded in u around inf 56.3%
Final simplification66.0%
(FPCore (u v t1) :precision binary64 (if (or (<= u -2.6e+125) (not (<= u 3.5e+191))) (/ v u) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.6e+125) || !(u <= 3.5e+191)) {
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 <= (-2.6d+125)) .or. (.not. (u <= 3.5d+191))) 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 <= -2.6e+125) || !(u <= 3.5e+191)) {
tmp = v / u;
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -2.6e+125) or not (u <= 3.5e+191): tmp = v / u else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -2.6e+125) || !(u <= 3.5e+191)) 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 <= -2.6e+125) || ~((u <= 3.5e+191))) tmp = v / u; else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.6e+125], N[Not[LessEqual[u, 3.5e+191]], $MachinePrecision]], N[(v / u), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.6 \cdot 10^{+125} \lor \neg \left(u \leq 3.5 \cdot 10^{+191}\right):\\
\;\;\;\;\frac{v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if u < -2.60000000000000003e125 or 3.4999999999999997e191 < u Initial program 80.6%
associate-/l*80.9%
distribute-lft-neg-out80.9%
distribute-rgt-neg-in80.9%
associate-/r*94.9%
distribute-neg-frac294.9%
Simplified94.9%
associate-*r/100.0%
neg-mul-1100.0%
associate-/r*100.0%
Applied egg-rr100.0%
div-inv99.9%
associate-/l*99.9%
associate-*l*94.9%
associate-/l/94.9%
neg-mul-194.9%
+-commutative94.9%
distribute-neg-in94.9%
sub-neg94.9%
add-sqr-sqrt49.0%
sqrt-unprod80.9%
sqr-neg80.9%
sqrt-unprod40.0%
add-sqr-sqrt78.8%
frac-2neg78.8%
metadata-eval78.8%
+-commutative78.8%
distribute-neg-in78.8%
sub-neg78.8%
add-sqr-sqrt38.8%
sqrt-unprod78.1%
sqr-neg78.1%
sqrt-unprod45.4%
add-sqr-sqrt94.5%
Applied egg-rr94.5%
associate-*r*99.5%
*-commutative99.5%
associate-*l/99.5%
neg-mul-199.5%
*-commutative99.5%
associate-/r/96.2%
distribute-frac-neg96.2%
div-sub96.2%
sub-neg96.2%
*-inverses96.2%
metadata-eval96.2%
Simplified96.2%
Taylor expanded in u around 0 41.9%
Taylor expanded in u around inf 41.1%
if -2.60000000000000003e125 < u < 3.4999999999999997e191Initial program 75.0%
associate-/l*75.5%
distribute-lft-neg-out75.5%
distribute-rgt-neg-in75.5%
associate-/r*85.4%
distribute-neg-frac285.4%
Simplified85.4%
Taylor expanded in t1 around inf 66.0%
associate-*r/66.0%
neg-mul-166.0%
Simplified66.0%
Final simplification59.2%
(FPCore (u v t1) :precision binary64 (if (<= u -4e+122) (/ v (- u)) (if (<= u 3.5e+191) (/ v (- t1)) (/ v u))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -4e+122) {
tmp = v / -u;
} else if (u <= 3.5e+191) {
tmp = v / -t1;
} else {
tmp = v / u;
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (u <= (-4d+122)) then
tmp = v / -u
else if (u <= 3.5d+191) then
tmp = v / -t1
else
tmp = v / u
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -4e+122) {
tmp = v / -u;
} else if (u <= 3.5e+191) {
tmp = v / -t1;
} else {
tmp = v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -4e+122: tmp = v / -u elif u <= 3.5e+191: tmp = v / -t1 else: tmp = v / u return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -4e+122) tmp = Float64(v / Float64(-u)); elseif (u <= 3.5e+191) tmp = Float64(v / Float64(-t1)); else tmp = Float64(v / u); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -4e+122) tmp = v / -u; elseif (u <= 3.5e+191) tmp = v / -t1; else tmp = v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -4e+122], N[(v / (-u)), $MachinePrecision], If[LessEqual[u, 3.5e+191], N[(v / (-t1)), $MachinePrecision], N[(v / u), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -4 \cdot 10^{+122}:\\
\;\;\;\;\frac{v}{-u}\\
\mathbf{elif}\;u \leq 3.5 \cdot 10^{+191}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\
\end{array}
\end{array}
if u < -4.00000000000000006e122Initial program 81.9%
times-frac95.6%
distribute-frac-neg95.6%
distribute-neg-frac295.6%
+-commutative95.6%
distribute-neg-in95.6%
unsub-neg95.6%
Simplified95.6%
Taylor expanded in t1 around inf 49.7%
Taylor expanded in t1 around 0 35.2%
associate-*r/35.2%
neg-mul-135.2%
Simplified35.2%
if -4.00000000000000006e122 < u < 3.4999999999999997e191Initial program 74.7%
associate-/l*75.2%
distribute-lft-neg-out75.2%
distribute-rgt-neg-in75.2%
associate-/r*85.2%
distribute-neg-frac285.2%
Simplified85.2%
Taylor expanded in t1 around inf 66.6%
associate-*r/66.6%
neg-mul-166.6%
Simplified66.6%
if 3.4999999999999997e191 < u Initial program 80.4%
associate-/l*80.6%
distribute-lft-neg-out80.6%
distribute-rgt-neg-in80.6%
associate-/r*94.6%
distribute-neg-frac294.6%
Simplified94.6%
associate-*r/100.0%
neg-mul-1100.0%
associate-/r*100.0%
Applied egg-rr100.0%
div-inv100.0%
associate-/l*100.0%
associate-*l*94.5%
associate-/l/94.5%
neg-mul-194.5%
+-commutative94.5%
distribute-neg-in94.5%
sub-neg94.5%
add-sqr-sqrt0.0%
sqrt-unprod80.6%
sqr-neg80.6%
sqrt-unprod82.3%
add-sqr-sqrt82.3%
frac-2neg82.3%
metadata-eval82.3%
+-commutative82.3%
distribute-neg-in82.3%
sub-neg82.3%
add-sqr-sqrt0.0%
sqrt-unprod80.6%
sqr-neg80.6%
sqrt-unprod93.4%
add-sqr-sqrt93.6%
Applied egg-rr93.6%
associate-*r*99.0%
*-commutative99.0%
associate-*l/99.0%
neg-mul-199.0%
*-commutative99.0%
associate-/r/98.9%
distribute-frac-neg98.9%
div-sub98.9%
sub-neg98.9%
*-inverses98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in u around 0 47.9%
Taylor expanded in u around inf 46.2%
Final simplification59.3%
(FPCore (u v t1) :precision binary64 (* (/ v (+ t1 u)) (/ t1 (- (- u) t1))))
double code(double u, double v, double t1) {
return (v / (t1 + u)) * (t1 / (-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)) * (t1 / (-u - t1))
end function
public static double code(double u, double v, double t1) {
return (v / (t1 + u)) * (t1 / (-u - t1));
}
def code(u, v, t1): return (v / (t1 + u)) * (t1 / (-u - t1))
function code(u, v, t1) return Float64(Float64(v / Float64(t1 + u)) * Float64(t1 / Float64(Float64(-u) - t1))) end
function tmp = code(u, v, t1) tmp = (v / (t1 + u)) * (t1 / (-u - t1)); end
code[u_, v_, t1_] := N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(t1 / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{v}{t1 + u} \cdot \frac{t1}{\left(-u\right) - t1}
\end{array}
Initial program 76.6%
times-frac98.1%
distribute-frac-neg98.1%
distribute-neg-frac298.1%
+-commutative98.1%
distribute-neg-in98.1%
unsub-neg98.1%
Simplified98.1%
Final simplification98.1%
(FPCore (u v t1) :precision binary64 (/ (/ v (- u t1)) (- 1.0 (/ u t1))))
double code(double u, double v, double t1) {
return (v / (u - t1)) / (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 / (u - t1)) / (1.0d0 - (u / t1))
end function
public static double code(double u, double v, double t1) {
return (v / (u - t1)) / (1.0 - (u / t1));
}
def code(u, v, t1): return (v / (u - t1)) / (1.0 - (u / t1))
function code(u, v, t1) return Float64(Float64(v / Float64(u - t1)) / Float64(1.0 - Float64(u / t1))) end
function tmp = code(u, v, t1) tmp = (v / (u - t1)) / (1.0 - (u / t1)); end
code[u_, v_, t1_] := N[(N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{v}{u - t1}}{1 - \frac{u}{t1}}
\end{array}
Initial program 76.6%
associate-/l*76.9%
distribute-lft-neg-out76.9%
distribute-rgt-neg-in76.9%
associate-/r*88.0%
distribute-neg-frac288.0%
Simplified88.0%
associate-*r/98.5%
neg-mul-198.5%
associate-/r*98.5%
Applied egg-rr98.5%
div-inv98.3%
associate-/l*98.3%
associate-*l*87.9%
associate-/l/87.9%
neg-mul-187.9%
+-commutative87.9%
distribute-neg-in87.9%
sub-neg87.9%
add-sqr-sqrt44.8%
sqrt-unprod76.2%
sqr-neg76.2%
sqrt-unprod33.9%
add-sqr-sqrt68.3%
frac-2neg68.3%
metadata-eval68.3%
+-commutative68.3%
distribute-neg-in68.3%
sub-neg68.3%
add-sqr-sqrt34.3%
sqrt-unprod73.9%
sqr-neg73.9%
sqrt-unprod42.5%
add-sqr-sqrt86.8%
Applied egg-rr86.8%
associate-*r*97.0%
*-commutative97.0%
associate-*l/97.1%
neg-mul-197.1%
*-commutative97.1%
associate-/r/97.3%
distribute-frac-neg97.3%
div-sub97.3%
sub-neg97.3%
*-inverses97.3%
metadata-eval97.3%
Simplified97.3%
Taylor expanded in v around 0 95.5%
mul-1-neg95.5%
sub-neg95.5%
metadata-eval95.5%
associate-/r*96.5%
distribute-neg-frac296.5%
+-commutative96.5%
distribute-neg-in96.5%
metadata-eval96.5%
unsub-neg96.5%
Simplified96.5%
(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 76.6%
times-frac98.1%
distribute-frac-neg98.1%
distribute-neg-frac298.1%
+-commutative98.1%
distribute-neg-in98.1%
unsub-neg98.1%
Simplified98.1%
Taylor expanded in t1 around inf 66.3%
Taylor expanded in v around 0 60.8%
associate-*r/60.8%
neg-mul-160.8%
Simplified60.8%
Final simplification60.8%
(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(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}{u - t1}
\end{array}
Initial program 76.6%
associate-/l*76.9%
distribute-lft-neg-out76.9%
distribute-rgt-neg-in76.9%
associate-/r*88.0%
distribute-neg-frac288.0%
Simplified88.0%
associate-*r/98.5%
neg-mul-198.5%
associate-/r*98.5%
Applied egg-rr98.5%
div-inv98.3%
associate-/l*98.3%
associate-*l*87.9%
associate-/l/87.9%
neg-mul-187.9%
+-commutative87.9%
distribute-neg-in87.9%
sub-neg87.9%
add-sqr-sqrt44.8%
sqrt-unprod76.2%
sqr-neg76.2%
sqrt-unprod33.9%
add-sqr-sqrt68.3%
frac-2neg68.3%
metadata-eval68.3%
+-commutative68.3%
distribute-neg-in68.3%
sub-neg68.3%
add-sqr-sqrt34.3%
sqrt-unprod73.9%
sqr-neg73.9%
sqrt-unprod42.5%
add-sqr-sqrt86.8%
Applied egg-rr86.8%
associate-*r*97.0%
*-commutative97.0%
associate-*l/97.1%
neg-mul-197.1%
*-commutative97.1%
associate-/r/97.3%
distribute-frac-neg97.3%
div-sub97.3%
sub-neg97.3%
*-inverses97.3%
metadata-eval97.3%
Simplified97.3%
Taylor expanded in u around 0 59.7%
(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 76.6%
associate-/l*76.9%
distribute-lft-neg-out76.9%
distribute-rgt-neg-in76.9%
associate-/r*88.0%
distribute-neg-frac288.0%
Simplified88.0%
associate-*r/98.5%
neg-mul-198.5%
associate-/r*98.5%
Applied egg-rr98.5%
div-inv98.3%
associate-/l*98.3%
associate-*l*87.9%
associate-/l/87.9%
neg-mul-187.9%
+-commutative87.9%
distribute-neg-in87.9%
sub-neg87.9%
add-sqr-sqrt44.8%
sqrt-unprod76.2%
sqr-neg76.2%
sqrt-unprod33.9%
add-sqr-sqrt68.3%
frac-2neg68.3%
metadata-eval68.3%
+-commutative68.3%
distribute-neg-in68.3%
sub-neg68.3%
add-sqr-sqrt34.3%
sqrt-unprod73.9%
sqr-neg73.9%
sqrt-unprod42.5%
add-sqr-sqrt86.8%
Applied egg-rr86.8%
associate-*r*97.0%
*-commutative97.0%
associate-*l/97.1%
neg-mul-197.1%
*-commutative97.1%
associate-/r/97.3%
distribute-frac-neg97.3%
div-sub97.3%
sub-neg97.3%
*-inverses97.3%
metadata-eval97.3%
Simplified97.3%
Taylor expanded in u around 0 59.7%
Taylor expanded in u around inf 18.4%
herbie shell --seed 2024107
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))