
(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) (+ t1 u)) (/ v (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 / (t1 + u)) * (v / (t1 + u));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-t1 / (t1 + u)) * (v / (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 / (t1 + u)) * (v / (t1 + u));
}
def code(u, v, t1): return (-t1 / (t1 + u)) * (v / (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) / Float64(t1 + u)) * Float64(v / Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 / (t1 + u)) * (v / (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}
\end{array}
Initial program 73.1%
times-frac98.5%
Simplified98.5%
Final simplification98.5%
(FPCore (u v t1)
:precision binary64
(if (<= u -8.5e+73)
(/ (* t1 (/ (- v) u)) u)
(if (<= u -3.6e+31)
(/ v (- (* u -2.0) t1))
(if (<= u -2.3e-32)
(/ t1 (* (- t1 u) (/ u v)))
(if (<= u 4.8e-55) (/ (- v) t1) (* (/ v (+ t1 u)) (/ (- t1) u)))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -8.5e+73) {
tmp = (t1 * (-v / u)) / u;
} else if (u <= -3.6e+31) {
tmp = v / ((u * -2.0) - t1);
} else if (u <= -2.3e-32) {
tmp = t1 / ((t1 - u) * (u / v));
} else if (u <= 4.8e-55) {
tmp = -v / t1;
} else {
tmp = (v / (t1 + 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 (u <= (-8.5d+73)) then
tmp = (t1 * (-v / u)) / u
else if (u <= (-3.6d+31)) then
tmp = v / ((u * (-2.0d0)) - t1)
else if (u <= (-2.3d-32)) then
tmp = t1 / ((t1 - u) * (u / v))
else if (u <= 4.8d-55) then
tmp = -v / t1
else
tmp = (v / (t1 + u)) * (-t1 / u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -8.5e+73) {
tmp = (t1 * (-v / u)) / u;
} else if (u <= -3.6e+31) {
tmp = v / ((u * -2.0) - t1);
} else if (u <= -2.3e-32) {
tmp = t1 / ((t1 - u) * (u / v));
} else if (u <= 4.8e-55) {
tmp = -v / t1;
} else {
tmp = (v / (t1 + u)) * (-t1 / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -8.5e+73: tmp = (t1 * (-v / u)) / u elif u <= -3.6e+31: tmp = v / ((u * -2.0) - t1) elif u <= -2.3e-32: tmp = t1 / ((t1 - u) * (u / v)) elif u <= 4.8e-55: tmp = -v / t1 else: tmp = (v / (t1 + u)) * (-t1 / u) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -8.5e+73) tmp = Float64(Float64(t1 * Float64(Float64(-v) / u)) / u); elseif (u <= -3.6e+31) tmp = Float64(v / Float64(Float64(u * -2.0) - t1)); elseif (u <= -2.3e-32) tmp = Float64(t1 / Float64(Float64(t1 - u) * Float64(u / v))); elseif (u <= 4.8e-55) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(v / Float64(t1 + u)) * Float64(Float64(-t1) / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -8.5e+73) tmp = (t1 * (-v / u)) / u; elseif (u <= -3.6e+31) tmp = v / ((u * -2.0) - t1); elseif (u <= -2.3e-32) tmp = t1 / ((t1 - u) * (u / v)); elseif (u <= 4.8e-55) tmp = -v / t1; else tmp = (v / (t1 + u)) * (-t1 / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -8.5e+73], N[(N[(t1 * N[((-v) / u), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision], If[LessEqual[u, -3.6e+31], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, -2.3e-32], N[(t1 / N[(N[(t1 - u), $MachinePrecision] * N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 4.8e-55], N[((-v) / t1), $MachinePrecision], N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[((-t1) / u), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -8.5 \cdot 10^{+73}:\\
\;\;\;\;\frac{t1 \cdot \frac{-v}{u}}{u}\\
\mathbf{elif}\;u \leq -3.6 \cdot 10^{+31}:\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\
\mathbf{elif}\;u \leq -2.3 \cdot 10^{-32}:\\
\;\;\;\;\frac{t1}{\left(t1 - u\right) \cdot \frac{u}{v}}\\
\mathbf{elif}\;u \leq 4.8 \cdot 10^{-55}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{t1 + u} \cdot \frac{-t1}{u}\\
\end{array}
\end{array}
if u < -8.4999999999999998e73Initial program 78.7%
times-frac95.2%
Simplified95.2%
Taylor expanded in t1 around 0 84.2%
associate-*r/84.2%
mul-1-neg84.2%
Simplified84.2%
Applied egg-rr83.0%
distribute-neg-frac83.0%
distribute-neg-frac83.0%
Simplified83.0%
Taylor expanded in u around inf 87.1%
associate-*r/89.2%
neg-mul-189.2%
distribute-rgt-neg-in89.2%
distribute-neg-frac89.2%
Simplified89.2%
if -8.4999999999999998e73 < u < -3.59999999999999996e31Initial program 62.9%
associate-/r*75.8%
*-commutative75.8%
associate-/l*100.0%
associate-/l/100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
div-sub100.0%
sub-neg100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in t1 around inf 88.3%
mul-1-neg88.3%
unsub-neg88.3%
*-commutative88.3%
Simplified88.3%
if -3.59999999999999996e31 < u < -2.3000000000000001e-32Initial program 82.2%
times-frac99.2%
Simplified99.2%
*-commutative99.2%
clear-num99.6%
frac-2neg99.6%
frac-times87.9%
*-un-lft-identity87.9%
remove-double-neg87.9%
distribute-neg-in87.9%
add-sqr-sqrt12.5%
sqrt-unprod86.0%
sqr-neg86.0%
sqrt-unprod73.5%
add-sqr-sqrt86.0%
sub-neg86.0%
Applied egg-rr86.0%
Taylor expanded in t1 around 0 85.8%
if -2.3000000000000001e-32 < u < 4.79999999999999983e-55Initial program 68.7%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around inf 84.3%
associate-*r/84.3%
neg-mul-184.3%
Simplified84.3%
if 4.79999999999999983e-55 < u Initial program 74.7%
times-frac98.5%
Simplified98.5%
Taylor expanded in t1 around 0 80.2%
associate-*r/80.2%
mul-1-neg80.2%
Simplified80.2%
Final simplification84.2%
(FPCore (u v t1)
:precision binary64
(if (<= u -1.25e+74)
(/ (* t1 (/ (- v) u)) u)
(if (<= u -3.5e+31)
(/ v (- (* u -2.0) t1))
(if (<= u -1.15e-41)
(/ t1 (* (/ (+ t1 u) v) (- t1 u)))
(if (<= u 4.8e-55) (/ (- v) t1) (* (/ v (+ t1 u)) (/ (- t1) u)))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -1.25e+74) {
tmp = (t1 * (-v / u)) / u;
} else if (u <= -3.5e+31) {
tmp = v / ((u * -2.0) - t1);
} else if (u <= -1.15e-41) {
tmp = t1 / (((t1 + u) / v) * (t1 - u));
} else if (u <= 4.8e-55) {
tmp = -v / t1;
} else {
tmp = (v / (t1 + 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 (u <= (-1.25d+74)) then
tmp = (t1 * (-v / u)) / u
else if (u <= (-3.5d+31)) then
tmp = v / ((u * (-2.0d0)) - t1)
else if (u <= (-1.15d-41)) then
tmp = t1 / (((t1 + u) / v) * (t1 - u))
else if (u <= 4.8d-55) then
tmp = -v / t1
else
tmp = (v / (t1 + u)) * (-t1 / u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -1.25e+74) {
tmp = (t1 * (-v / u)) / u;
} else if (u <= -3.5e+31) {
tmp = v / ((u * -2.0) - t1);
} else if (u <= -1.15e-41) {
tmp = t1 / (((t1 + u) / v) * (t1 - u));
} else if (u <= 4.8e-55) {
tmp = -v / t1;
} else {
tmp = (v / (t1 + u)) * (-t1 / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -1.25e+74: tmp = (t1 * (-v / u)) / u elif u <= -3.5e+31: tmp = v / ((u * -2.0) - t1) elif u <= -1.15e-41: tmp = t1 / (((t1 + u) / v) * (t1 - u)) elif u <= 4.8e-55: tmp = -v / t1 else: tmp = (v / (t1 + u)) * (-t1 / u) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -1.25e+74) tmp = Float64(Float64(t1 * Float64(Float64(-v) / u)) / u); elseif (u <= -3.5e+31) tmp = Float64(v / Float64(Float64(u * -2.0) - t1)); elseif (u <= -1.15e-41) tmp = Float64(t1 / Float64(Float64(Float64(t1 + u) / v) * Float64(t1 - u))); elseif (u <= 4.8e-55) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(v / Float64(t1 + u)) * Float64(Float64(-t1) / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -1.25e+74) tmp = (t1 * (-v / u)) / u; elseif (u <= -3.5e+31) tmp = v / ((u * -2.0) - t1); elseif (u <= -1.15e-41) tmp = t1 / (((t1 + u) / v) * (t1 - u)); elseif (u <= 4.8e-55) tmp = -v / t1; else tmp = (v / (t1 + u)) * (-t1 / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -1.25e+74], N[(N[(t1 * N[((-v) / u), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision], If[LessEqual[u, -3.5e+31], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, -1.15e-41], N[(t1 / N[(N[(N[(t1 + u), $MachinePrecision] / v), $MachinePrecision] * N[(t1 - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 4.8e-55], N[((-v) / t1), $MachinePrecision], N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[((-t1) / u), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.25 \cdot 10^{+74}:\\
\;\;\;\;\frac{t1 \cdot \frac{-v}{u}}{u}\\
\mathbf{elif}\;u \leq -3.5 \cdot 10^{+31}:\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\
\mathbf{elif}\;u \leq -1.15 \cdot 10^{-41}:\\
\;\;\;\;\frac{t1}{\frac{t1 + u}{v} \cdot \left(t1 - u\right)}\\
\mathbf{elif}\;u \leq 4.8 \cdot 10^{-55}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{t1 + u} \cdot \frac{-t1}{u}\\
\end{array}
\end{array}
if u < -1.24999999999999991e74Initial program 78.7%
times-frac95.2%
Simplified95.2%
Taylor expanded in t1 around 0 84.2%
associate-*r/84.2%
mul-1-neg84.2%
Simplified84.2%
Applied egg-rr83.0%
distribute-neg-frac83.0%
distribute-neg-frac83.0%
Simplified83.0%
Taylor expanded in u around inf 87.1%
associate-*r/89.2%
neg-mul-189.2%
distribute-rgt-neg-in89.2%
distribute-neg-frac89.2%
Simplified89.2%
if -1.24999999999999991e74 < u < -3.5e31Initial program 62.9%
associate-/r*75.8%
*-commutative75.8%
associate-/l*100.0%
associate-/l/100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
div-sub100.0%
sub-neg100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in t1 around inf 88.3%
mul-1-neg88.3%
unsub-neg88.3%
*-commutative88.3%
Simplified88.3%
if -3.5e31 < u < -1.15000000000000005e-41Initial program 80.1%
times-frac99.3%
Simplified99.3%
*-commutative99.3%
clear-num99.6%
frac-2neg99.6%
frac-times84.9%
*-un-lft-identity84.9%
remove-double-neg84.9%
distribute-neg-in84.9%
add-sqr-sqrt10.9%
sqrt-unprod83.3%
sqr-neg83.3%
sqrt-unprod72.4%
add-sqr-sqrt83.3%
sub-neg83.3%
Applied egg-rr83.3%
if -1.15000000000000005e-41 < u < 4.79999999999999983e-55Initial program 68.7%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around inf 84.8%
associate-*r/84.8%
neg-mul-184.8%
Simplified84.8%
if 4.79999999999999983e-55 < u Initial program 74.7%
times-frac98.5%
Simplified98.5%
Taylor expanded in t1 around 0 80.2%
associate-*r/80.2%
mul-1-neg80.2%
Simplified80.2%
Final simplification84.2%
(FPCore (u v t1)
:precision binary64
(if (or (<= t1 -1.38e+66)
(not
(or (<= t1 -1.55e+27)
(and (not (<= t1 -3.2e-40)) (<= t1 116000000000.0)))))
(/ v (- (* u -2.0) t1))
(* (/ (- v) u) (/ t1 u))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -1.38e+66) || !((t1 <= -1.55e+27) || (!(t1 <= -3.2e-40) && (t1 <= 116000000000.0)))) {
tmp = v / ((u * -2.0) - 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) :: tmp
if ((t1 <= (-1.38d+66)) .or. (.not. (t1 <= (-1.55d+27)) .or. (.not. (t1 <= (-3.2d-40))) .and. (t1 <= 116000000000.0d0))) then
tmp = v / ((u * (-2.0d0)) - t1)
else
tmp = (-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.38e+66) || !((t1 <= -1.55e+27) || (!(t1 <= -3.2e-40) && (t1 <= 116000000000.0)))) {
tmp = v / ((u * -2.0) - t1);
} else {
tmp = (-v / u) * (t1 / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -1.38e+66) or not ((t1 <= -1.55e+27) or (not (t1 <= -3.2e-40) and (t1 <= 116000000000.0))): tmp = v / ((u * -2.0) - t1) else: tmp = (-v / u) * (t1 / u) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -1.38e+66) || !((t1 <= -1.55e+27) || (!(t1 <= -3.2e-40) && (t1 <= 116000000000.0)))) tmp = Float64(v / Float64(Float64(u * -2.0) - t1)); else tmp = Float64(Float64(Float64(-v) / u) * Float64(t1 / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -1.38e+66) || ~(((t1 <= -1.55e+27) || (~((t1 <= -3.2e-40)) && (t1 <= 116000000000.0))))) tmp = v / ((u * -2.0) - t1); else tmp = (-v / u) * (t1 / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.38e+66], N[Not[Or[LessEqual[t1, -1.55e+27], And[N[Not[LessEqual[t1, -3.2e-40]], $MachinePrecision], LessEqual[t1, 116000000000.0]]]], $MachinePrecision]], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], N[(N[((-v) / u), $MachinePrecision] * N[(t1 / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.38 \cdot 10^{+66} \lor \neg \left(t1 \leq -1.55 \cdot 10^{+27} \lor \neg \left(t1 \leq -3.2 \cdot 10^{-40}\right) \land t1 \leq 116000000000\right):\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{u} \cdot \frac{t1}{u}\\
\end{array}
\end{array}
if t1 < -1.38e66 or -1.54999999999999998e27 < t1 < -3.20000000000000002e-40 or 1.16e11 < t1 Initial program 65.5%
associate-/r*79.9%
*-commutative79.9%
associate-/l*99.9%
associate-/l/95.3%
+-commutative95.3%
remove-double-neg95.3%
unsub-neg95.3%
div-sub95.3%
sub-neg95.3%
*-inverses95.3%
metadata-eval95.3%
Simplified95.3%
Taylor expanded in t1 around inf 84.2%
mul-1-neg84.2%
unsub-neg84.2%
*-commutative84.2%
Simplified84.2%
if -1.38e66 < t1 < -1.54999999999999998e27 or -3.20000000000000002e-40 < t1 < 1.16e11Initial program 79.9%
times-frac97.4%
Simplified97.4%
Taylor expanded in t1 around 0 77.1%
associate-*r/77.1%
mul-1-neg77.1%
Simplified77.1%
Taylor expanded in t1 around 0 80.3%
Final simplification82.1%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) u)) (t_2 (/ v (- (* u -2.0) t1))))
(if (<= t1 -1.38e+66)
t_2
(if (<= t1 -1.1e+26)
(* t_1 (/ t1 u))
(if (or (<= t1 -2.95e-40) (not (<= t1 3500000000000.0)))
t_2
(/ (* t1 t_1) u))))))
double code(double u, double v, double t1) {
double t_1 = -v / u;
double t_2 = v / ((u * -2.0) - t1);
double tmp;
if (t1 <= -1.38e+66) {
tmp = t_2;
} else if (t1 <= -1.1e+26) {
tmp = t_1 * (t1 / u);
} else if ((t1 <= -2.95e-40) || !(t1 <= 3500000000000.0)) {
tmp = t_2;
} else {
tmp = (t1 * t_1) / 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) :: tmp
t_1 = -v / u
t_2 = v / ((u * (-2.0d0)) - t1)
if (t1 <= (-1.38d+66)) then
tmp = t_2
else if (t1 <= (-1.1d+26)) then
tmp = t_1 * (t1 / u)
else if ((t1 <= (-2.95d-40)) .or. (.not. (t1 <= 3500000000000.0d0))) then
tmp = t_2
else
tmp = (t1 * t_1) / u
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -v / u;
double t_2 = v / ((u * -2.0) - t1);
double tmp;
if (t1 <= -1.38e+66) {
tmp = t_2;
} else if (t1 <= -1.1e+26) {
tmp = t_1 * (t1 / u);
} else if ((t1 <= -2.95e-40) || !(t1 <= 3500000000000.0)) {
tmp = t_2;
} else {
tmp = (t1 * t_1) / u;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / u t_2 = v / ((u * -2.0) - t1) tmp = 0 if t1 <= -1.38e+66: tmp = t_2 elif t1 <= -1.1e+26: tmp = t_1 * (t1 / u) elif (t1 <= -2.95e-40) or not (t1 <= 3500000000000.0): tmp = t_2 else: tmp = (t1 * t_1) / u return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / u) t_2 = Float64(v / Float64(Float64(u * -2.0) - t1)) tmp = 0.0 if (t1 <= -1.38e+66) tmp = t_2; elseif (t1 <= -1.1e+26) tmp = Float64(t_1 * Float64(t1 / u)); elseif ((t1 <= -2.95e-40) || !(t1 <= 3500000000000.0)) tmp = t_2; else tmp = Float64(Float64(t1 * t_1) / u); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / u; t_2 = v / ((u * -2.0) - t1); tmp = 0.0; if (t1 <= -1.38e+66) tmp = t_2; elseif (t1 <= -1.1e+26) tmp = t_1 * (t1 / u); elseif ((t1 <= -2.95e-40) || ~((t1 <= 3500000000000.0))) tmp = t_2; else tmp = (t1 * t_1) / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / u), $MachinePrecision]}, Block[{t$95$2 = N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -1.38e+66], t$95$2, If[LessEqual[t1, -1.1e+26], N[(t$95$1 * N[(t1 / u), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t1, -2.95e-40], N[Not[LessEqual[t1, 3500000000000.0]], $MachinePrecision]], t$95$2, N[(N[(t1 * t$95$1), $MachinePrecision] / u), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{u}\\
t_2 := \frac{v}{u \cdot -2 - t1}\\
\mathbf{if}\;t1 \leq -1.38 \cdot 10^{+66}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t1 \leq -1.1 \cdot 10^{+26}:\\
\;\;\;\;t\_1 \cdot \frac{t1}{u}\\
\mathbf{elif}\;t1 \leq -2.95 \cdot 10^{-40} \lor \neg \left(t1 \leq 3500000000000\right):\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{t1 \cdot t\_1}{u}\\
\end{array}
\end{array}
if t1 < -1.38e66 or -1.10000000000000004e26 < t1 < -2.94999999999999983e-40 or 3.5e12 < t1 Initial program 65.5%
associate-/r*79.9%
*-commutative79.9%
associate-/l*99.9%
associate-/l/95.3%
+-commutative95.3%
remove-double-neg95.3%
unsub-neg95.3%
div-sub95.3%
sub-neg95.3%
*-inverses95.3%
metadata-eval95.3%
Simplified95.3%
Taylor expanded in t1 around inf 84.2%
mul-1-neg84.2%
unsub-neg84.2%
*-commutative84.2%
Simplified84.2%
if -1.38e66 < t1 < -1.10000000000000004e26Initial program 60.2%
times-frac100.0%
Simplified100.0%
Taylor expanded in t1 around 0 77.6%
associate-*r/77.6%
mul-1-neg77.6%
Simplified77.6%
Taylor expanded in t1 around 0 77.8%
if -2.94999999999999983e-40 < t1 < 3.5e12Initial program 82.0%
times-frac97.1%
Simplified97.1%
Taylor expanded in t1 around 0 77.0%
associate-*r/77.0%
mul-1-neg77.0%
Simplified77.0%
Applied egg-rr76.0%
distribute-neg-frac76.0%
distribute-neg-frac76.0%
Simplified76.0%
Taylor expanded in u around inf 78.4%
associate-*r/82.5%
neg-mul-182.5%
distribute-rgt-neg-in82.5%
distribute-neg-frac82.5%
Simplified82.5%
Final simplification83.1%
(FPCore (u v t1)
:precision binary64
(if (<= u -1.15e+104)
(/ (* t1 (/ (- v) u)) u)
(if (<= u 1.25e+161)
(/ v (* (+ t1 u) (- -1.0 (/ u t1))))
(* (/ v (+ t1 u)) (/ (- t1) u)))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -1.15e+104) {
tmp = (t1 * (-v / u)) / u;
} else if (u <= 1.25e+161) {
tmp = v / ((t1 + u) * (-1.0 - (u / t1)));
} else {
tmp = (v / (t1 + 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 (u <= (-1.15d+104)) then
tmp = (t1 * (-v / u)) / u
else if (u <= 1.25d+161) then
tmp = v / ((t1 + u) * ((-1.0d0) - (u / t1)))
else
tmp = (v / (t1 + u)) * (-t1 / u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -1.15e+104) {
tmp = (t1 * (-v / u)) / u;
} else if (u <= 1.25e+161) {
tmp = v / ((t1 + u) * (-1.0 - (u / t1)));
} else {
tmp = (v / (t1 + u)) * (-t1 / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -1.15e+104: tmp = (t1 * (-v / u)) / u elif u <= 1.25e+161: tmp = v / ((t1 + u) * (-1.0 - (u / t1))) else: tmp = (v / (t1 + u)) * (-t1 / u) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -1.15e+104) tmp = Float64(Float64(t1 * Float64(Float64(-v) / u)) / u); elseif (u <= 1.25e+161) tmp = Float64(v / Float64(Float64(t1 + u) * Float64(-1.0 - Float64(u / t1)))); else tmp = Float64(Float64(v / Float64(t1 + u)) * Float64(Float64(-t1) / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -1.15e+104) tmp = (t1 * (-v / u)) / u; elseif (u <= 1.25e+161) tmp = v / ((t1 + u) * (-1.0 - (u / t1))); else tmp = (v / (t1 + u)) * (-t1 / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -1.15e+104], N[(N[(t1 * N[((-v) / u), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision], If[LessEqual[u, 1.25e+161], N[(v / N[(N[(t1 + u), $MachinePrecision] * N[(-1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[((-t1) / u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.15 \cdot 10^{+104}:\\
\;\;\;\;\frac{t1 \cdot \frac{-v}{u}}{u}\\
\mathbf{elif}\;u \leq 1.25 \cdot 10^{+161}:\\
\;\;\;\;\frac{v}{\left(t1 + u\right) \cdot \left(-1 - \frac{u}{t1}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{t1 + u} \cdot \frac{-t1}{u}\\
\end{array}
\end{array}
if u < -1.14999999999999992e104Initial program 77.4%
times-frac94.5%
Simplified94.5%
Taylor expanded in t1 around 0 87.5%
associate-*r/87.5%
mul-1-neg87.5%
Simplified87.5%
Applied egg-rr86.0%
distribute-neg-frac86.0%
distribute-neg-frac86.0%
Simplified86.0%
Taylor expanded in u around inf 90.6%
associate-*r/92.7%
neg-mul-192.7%
distribute-rgt-neg-in92.7%
distribute-neg-frac92.7%
Simplified92.7%
if -1.14999999999999992e104 < u < 1.2499999999999999e161Initial program 74.5%
associate-/r*83.4%
*-commutative83.4%
associate-/l*98.9%
associate-/l/97.3%
+-commutative97.3%
remove-double-neg97.3%
unsub-neg97.3%
div-sub97.3%
sub-neg97.3%
*-inverses97.3%
metadata-eval97.3%
Simplified97.3%
Taylor expanded in u around 0 97.3%
sub-neg97.3%
mul-1-neg97.3%
distribute-neg-in97.3%
+-commutative97.3%
distribute-neg-in97.3%
metadata-eval97.3%
sub-neg97.3%
Simplified97.3%
if 1.2499999999999999e161 < u Initial program 59.6%
times-frac99.7%
Simplified99.7%
Taylor expanded in t1 around 0 91.1%
associate-*r/91.1%
mul-1-neg91.1%
Simplified91.1%
Final simplification95.8%
(FPCore (u v t1) :precision binary64 (if (or (<= u -7.2e+88) (not (<= u 3.8e+63))) (* (/ v u) (/ t1 u)) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -7.2e+88) || !(u <= 3.8e+63)) {
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 <= (-7.2d+88)) .or. (.not. (u <= 3.8d+63))) 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 <= -7.2e+88) || !(u <= 3.8e+63)) {
tmp = (v / u) * (t1 / u);
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -7.2e+88) or not (u <= 3.8e+63): tmp = (v / u) * (t1 / u) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -7.2e+88) || !(u <= 3.8e+63)) tmp = Float64(Float64(v / 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 ((u <= -7.2e+88) || ~((u <= 3.8e+63))) tmp = (v / u) * (t1 / u); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -7.2e+88], N[Not[LessEqual[u, 3.8e+63]], $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 -7.2 \cdot 10^{+88} \lor \neg \left(u \leq 3.8 \cdot 10^{+63}\right):\\
\;\;\;\;\frac{v}{u} \cdot \frac{t1}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -7.2000000000000004e88 or 3.8000000000000001e63 < u Initial program 73.1%
times-frac96.7%
Simplified96.7%
Taylor expanded in t1 around 0 84.1%
associate-*r/84.1%
mul-1-neg84.1%
Simplified84.1%
Applied egg-rr83.5%
distribute-neg-frac83.5%
distribute-neg-frac83.5%
Simplified83.5%
Taylor expanded in u around inf 81.8%
div-inv81.8%
associate-/r/87.4%
associate-*l*84.3%
add-sqr-sqrt43.8%
sqrt-unprod58.8%
sqr-neg58.8%
sqrt-unprod25.9%
add-sqr-sqrt58.1%
div-inv58.1%
Applied egg-rr58.1%
if -7.2000000000000004e88 < u < 3.8000000000000001e63Initial program 73.1%
times-frac99.8%
Simplified99.8%
Taylor expanded in t1 around inf 72.2%
associate-*r/72.2%
neg-mul-172.2%
Simplified72.2%
Final simplification66.6%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -3.2e+148) (not (<= t1 2e+150))) (/ v t1) (/ v u)))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -3.2e+148) || !(t1 <= 2e+150)) {
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 <= (-3.2d+148)) .or. (.not. (t1 <= 2d+150))) 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 <= -3.2e+148) || !(t1 <= 2e+150)) {
tmp = v / t1;
} else {
tmp = v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -3.2e+148) or not (t1 <= 2e+150): tmp = v / t1 else: tmp = v / u return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -3.2e+148) || !(t1 <= 2e+150)) 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 <= -3.2e+148) || ~((t1 <= 2e+150))) tmp = v / t1; else tmp = v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -3.2e+148], N[Not[LessEqual[t1, 2e+150]], $MachinePrecision]], N[(v / t1), $MachinePrecision], N[(v / u), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3.2 \cdot 10^{+148} \lor \neg \left(t1 \leq 2 \cdot 10^{+150}\right):\\
\;\;\;\;\frac{v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\
\end{array}
\end{array}
if t1 < -3.1999999999999999e148 or 1.99999999999999996e150 < t1 Initial program 43.8%
times-frac99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.7%
frac-2neg99.7%
frac-times58.7%
*-un-lft-identity58.7%
remove-double-neg58.7%
distribute-neg-in58.7%
add-sqr-sqrt22.0%
sqrt-unprod43.5%
sqr-neg43.5%
sqrt-unprod24.7%
add-sqr-sqrt43.2%
sub-neg43.2%
Applied egg-rr43.2%
Taylor expanded in t1 around inf 40.8%
if -3.1999999999999999e148 < t1 < 1.99999999999999996e150Initial program 81.5%
times-frac98.2%
Simplified98.2%
Taylor expanded in t1 around 0 63.9%
associate-*r/63.9%
mul-1-neg63.9%
Simplified63.9%
associate-*r/63.5%
clear-num63.1%
associate-*l/63.2%
*-un-lft-identity63.2%
add-sqr-sqrt30.3%
sqrt-unprod42.8%
sqr-neg42.8%
sqrt-unprod17.7%
add-sqr-sqrt32.7%
Applied egg-rr32.7%
Taylor expanded in u around 0 15.4%
Final simplification21.0%
(FPCore (u v t1) :precision binary64 (/ (/ v (+ t1 u)) (- -1.0 (/ u t1))))
double code(double u, double v, double t1) {
return (v / (t1 + u)) / (-1.0 - (u / t1));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (v / (t1 + u)) / ((-1.0d0) - (u / t1))
end function
public static double code(double u, double v, double t1) {
return (v / (t1 + u)) / (-1.0 - (u / t1));
}
def code(u, v, t1): return (v / (t1 + u)) / (-1.0 - (u / t1))
function code(u, v, t1) return Float64(Float64(v / Float64(t1 + u)) / Float64(-1.0 - Float64(u / t1))) end
function tmp = code(u, v, t1) tmp = (v / (t1 + u)) / (-1.0 - (u / t1)); end
code[u_, v_, t1_] := N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{v}{t1 + u}}{-1 - \frac{u}{t1}}
\end{array}
Initial program 73.1%
associate-/r*85.1%
*-commutative85.1%
associate-/l*98.1%
associate-/l/91.6%
+-commutative91.6%
remove-double-neg91.6%
unsub-neg91.6%
div-sub91.6%
sub-neg91.6%
*-inverses91.6%
metadata-eval91.6%
Simplified91.6%
Taylor expanded in v around 0 91.6%
sub-neg91.6%
mul-1-neg91.6%
distribute-neg-in91.6%
associate-/r*98.3%
+-commutative98.3%
distribute-neg-in98.3%
metadata-eval98.3%
sub-neg98.3%
Simplified98.3%
Final simplification98.3%
(FPCore (u v t1) :precision binary64 (if (<= u -4e+217) (* (/ v u) -0.5) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if (u <= -4e+217) {
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 <= (-4d+217)) 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 <= -4e+217) {
tmp = (v / u) * -0.5;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -4e+217: tmp = (v / u) * -0.5 else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -4e+217) tmp = Float64(Float64(v / u) * -0.5); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -4e+217) tmp = (v / u) * -0.5; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -4e+217], N[(N[(v / u), $MachinePrecision] * -0.5), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -4 \cdot 10^{+217}:\\
\;\;\;\;\frac{v}{u} \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -3.99999999999999984e217Initial program 81.7%
associate-/r*99.9%
*-commutative99.9%
associate-/l*99.9%
associate-/l/81.7%
+-commutative81.7%
remove-double-neg81.7%
unsub-neg81.7%
div-sub81.7%
sub-neg81.7%
*-inverses81.7%
metadata-eval81.7%
Simplified81.7%
Taylor expanded in t1 around inf 43.1%
mul-1-neg43.1%
unsub-neg43.1%
*-commutative43.1%
Simplified43.1%
Taylor expanded in u around inf 43.1%
if -3.99999999999999984e217 < u Initial program 72.4%
times-frac98.4%
Simplified98.4%
Taylor expanded in t1 around inf 55.4%
associate-*r/55.4%
neg-mul-155.4%
Simplified55.4%
Final simplification54.5%
(FPCore (u v t1) :precision binary64 (if (<= u -5.2e+217) (/ v u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if (u <= -5.2e+217) {
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 <= (-5.2d+217)) 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 <= -5.2e+217) {
tmp = v / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -5.2e+217: tmp = v / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -5.2e+217) 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 <= -5.2e+217) tmp = v / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -5.2e+217], N[(v / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -5.2 \cdot 10^{+217}:\\
\;\;\;\;\frac{v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -5.20000000000000023e217Initial program 81.7%
times-frac99.8%
Simplified99.8%
Taylor expanded in t1 around 0 99.8%
associate-*r/99.8%
mul-1-neg99.8%
Simplified99.8%
associate-*r/99.8%
clear-num99.9%
associate-*l/99.9%
*-un-lft-identity99.9%
add-sqr-sqrt59.8%
sqrt-unprod85.2%
sqr-neg85.2%
sqrt-unprod40.0%
add-sqr-sqrt81.3%
Applied egg-rr81.3%
Taylor expanded in u around 0 42.9%
if -5.20000000000000023e217 < u Initial program 72.4%
times-frac98.4%
Simplified98.4%
Taylor expanded in t1 around inf 55.4%
associate-*r/55.4%
neg-mul-155.4%
Simplified55.4%
Final simplification54.4%
(FPCore (u v t1) :precision binary64 (if (<= u -4.1e+217) (/ (- v) u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if (u <= -4.1e+217) {
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 <= (-4.1d+217)) 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 <= -4.1e+217) {
tmp = -v / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -4.1e+217: tmp = -v / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -4.1e+217) tmp = Float64(Float64(-v) / u); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -4.1e+217) tmp = -v / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -4.1e+217], N[((-v) / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -4.1 \cdot 10^{+217}:\\
\;\;\;\;\frac{-v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -4.1000000000000002e217Initial program 81.7%
times-frac99.8%
Simplified99.8%
Taylor expanded in t1 around 0 99.8%
associate-*r/99.8%
mul-1-neg99.8%
Simplified99.8%
Taylor expanded in t1 around inf 43.1%
associate-*r/43.1%
neg-mul-143.1%
Simplified43.1%
if -4.1000000000000002e217 < u Initial program 72.4%
times-frac98.4%
Simplified98.4%
Taylor expanded in t1 around inf 55.4%
associate-*r/55.4%
neg-mul-155.4%
Simplified55.4%
Final simplification54.5%
(FPCore (u v t1) :precision binary64 (/ (- v) (+ t1 u)))
double code(double u, double v, double t1) {
return -v / (t1 + u);
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = -v / (t1 + u)
end function
public static double code(double u, double v, double t1) {
return -v / (t1 + u);
}
def code(u, v, t1): return -v / (t1 + u)
function code(u, v, t1) return Float64(Float64(-v) / Float64(t1 + u)) end
function tmp = code(u, v, t1) tmp = -v / (t1 + u); end
code[u_, v_, t1_] := N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-v}{t1 + u}
\end{array}
Initial program 73.1%
times-frac98.5%
Simplified98.5%
associate-*r/98.2%
clear-num98.0%
associate-*l/98.1%
*-un-lft-identity98.1%
frac-2neg98.1%
distribute-neg-in98.1%
add-sqr-sqrt45.1%
sqrt-unprod69.8%
sqr-neg69.8%
sqrt-unprod30.3%
add-sqr-sqrt57.5%
sub-neg57.5%
remove-double-neg57.5%
Applied egg-rr57.5%
associate-/r/58.9%
add-sqr-sqrt31.0%
sqrt-unprod44.5%
sqr-neg44.5%
sqrt-unprod32.6%
add-sqr-sqrt71.4%
distribute-rgt-neg-in71.4%
associate-/r/71.4%
neg-sub071.4%
div-sub71.4%
*-inverses71.4%
sub-neg71.4%
distribute-neg-frac71.4%
add-sqr-sqrt38.7%
sqrt-unprod77.2%
sqr-neg77.2%
sqrt-unprod45.3%
add-sqr-sqrt98.1%
frac-2neg98.1%
Applied egg-rr98.1%
neg-sub098.1%
distribute-neg-frac98.1%
Simplified98.1%
Taylor expanded in u around 0 56.8%
mul-1-neg56.8%
Simplified56.8%
Final simplification56.8%
(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 73.1%
times-frac98.5%
Simplified98.5%
*-commutative98.5%
clear-num98.1%
frac-2neg98.1%
frac-times80.5%
*-un-lft-identity80.5%
remove-double-neg80.5%
distribute-neg-in80.5%
add-sqr-sqrt36.0%
sqrt-unprod64.9%
sqr-neg64.9%
sqrt-unprod30.3%
add-sqr-sqrt53.8%
sub-neg53.8%
Applied egg-rr53.8%
Taylor expanded in t1 around inf 12.1%
Final simplification12.1%
herbie shell --seed 2024031
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))