
(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 15 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) (- (- 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(Float64(t1 / Float64(t1 + u)) * 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[(N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision] / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{t1}{t1 + u} \cdot v}{\left(-u\right) - t1}
\end{array}
Initial program 71.8%
associate-/l*72.5%
distribute-lft-neg-out72.5%
distribute-rgt-neg-in72.5%
associate-/r*81.7%
distribute-neg-frac281.7%
Simplified81.7%
distribute-frac-neg281.7%
distribute-rgt-neg-out81.7%
associate-/r*72.5%
distribute-lft-neg-out72.5%
associate-/l*71.8%
times-frac97.5%
frac-2neg97.5%
associate-*r/98.3%
add-sqr-sqrt46.5%
sqrt-unprod44.2%
sqr-neg44.2%
sqrt-unprod18.9%
add-sqr-sqrt35.5%
add-sqr-sqrt19.0%
sqrt-unprod56.5%
sqr-neg56.5%
sqrt-prod47.6%
add-sqr-sqrt98.3%
Applied egg-rr98.3%
Final simplification98.3%
(FPCore (u v t1)
:precision binary64
(if (<= u -5.4e+188)
(/ (* (- v) (/ t1 u)) (+ t1 u))
(if (<= u -1.2e-132)
(* (- t1) (/ (/ v (+ t1 u)) (+ t1 u)))
(if (<= u 7.2e-151)
(/ v (- (- t1) (* u 2.0)))
(if (<= u 9.8e+145)
(* (- v) (/ t1 (* (+ t1 u) (+ t1 u))))
(/ (/ t1 (/ u v)) (- (- u) t1)))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -5.4e+188) {
tmp = (-v * (t1 / u)) / (t1 + u);
} else if (u <= -1.2e-132) {
tmp = -t1 * ((v / (t1 + u)) / (t1 + u));
} else if (u <= 7.2e-151) {
tmp = v / (-t1 - (u * 2.0));
} else if (u <= 9.8e+145) {
tmp = -v * (t1 / ((t1 + u) * (t1 + u)));
} else {
tmp = (t1 / (u / 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 <= (-5.4d+188)) then
tmp = (-v * (t1 / u)) / (t1 + u)
else if (u <= (-1.2d-132)) then
tmp = -t1 * ((v / (t1 + u)) / (t1 + u))
else if (u <= 7.2d-151) then
tmp = v / (-t1 - (u * 2.0d0))
else if (u <= 9.8d+145) then
tmp = -v * (t1 / ((t1 + u) * (t1 + u)))
else
tmp = (t1 / (u / v)) / (-u - t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -5.4e+188) {
tmp = (-v * (t1 / u)) / (t1 + u);
} else if (u <= -1.2e-132) {
tmp = -t1 * ((v / (t1 + u)) / (t1 + u));
} else if (u <= 7.2e-151) {
tmp = v / (-t1 - (u * 2.0));
} else if (u <= 9.8e+145) {
tmp = -v * (t1 / ((t1 + u) * (t1 + u)));
} else {
tmp = (t1 / (u / v)) / (-u - t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -5.4e+188: tmp = (-v * (t1 / u)) / (t1 + u) elif u <= -1.2e-132: tmp = -t1 * ((v / (t1 + u)) / (t1 + u)) elif u <= 7.2e-151: tmp = v / (-t1 - (u * 2.0)) elif u <= 9.8e+145: tmp = -v * (t1 / ((t1 + u) * (t1 + u))) else: tmp = (t1 / (u / v)) / (-u - t1) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -5.4e+188) tmp = Float64(Float64(Float64(-v) * Float64(t1 / u)) / Float64(t1 + u)); elseif (u <= -1.2e-132) tmp = Float64(Float64(-t1) * Float64(Float64(v / Float64(t1 + u)) / Float64(t1 + u))); elseif (u <= 7.2e-151) tmp = Float64(v / Float64(Float64(-t1) - Float64(u * 2.0))); elseif (u <= 9.8e+145) tmp = Float64(Float64(-v) * Float64(t1 / Float64(Float64(t1 + u) * Float64(t1 + u)))); else tmp = Float64(Float64(t1 / Float64(u / v)) / Float64(Float64(-u) - t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -5.4e+188) tmp = (-v * (t1 / u)) / (t1 + u); elseif (u <= -1.2e-132) tmp = -t1 * ((v / (t1 + u)) / (t1 + u)); elseif (u <= 7.2e-151) tmp = v / (-t1 - (u * 2.0)); elseif (u <= 9.8e+145) tmp = -v * (t1 / ((t1 + u) * (t1 + u))); else tmp = (t1 / (u / v)) / (-u - t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -5.4e+188], N[(N[((-v) * N[(t1 / u), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, -1.2e-132], N[((-t1) * N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 7.2e-151], N[(v / N[((-t1) - N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 9.8e+145], N[((-v) * N[(t1 / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t1 / N[(u / v), $MachinePrecision]), $MachinePrecision] / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -5.4 \cdot 10^{+188}:\\
\;\;\;\;\frac{\left(-v\right) \cdot \frac{t1}{u}}{t1 + u}\\
\mathbf{elif}\;u \leq -1.2 \cdot 10^{-132}:\\
\;\;\;\;\left(-t1\right) \cdot \frac{\frac{v}{t1 + u}}{t1 + u}\\
\mathbf{elif}\;u \leq 7.2 \cdot 10^{-151}:\\
\;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\
\mathbf{elif}\;u \leq 9.8 \cdot 10^{+145}:\\
\;\;\;\;\left(-v\right) \cdot \frac{t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{t1}{\frac{u}{v}}}{\left(-u\right) - t1}\\
\end{array}
\end{array}
if u < -5.4e188Initial program 68.7%
associate-/l*69.2%
distribute-lft-neg-out69.2%
distribute-rgt-neg-in69.2%
associate-/r*84.8%
distribute-neg-frac284.8%
Simplified84.8%
distribute-frac-neg284.8%
distribute-rgt-neg-out84.8%
associate-/r*69.2%
distribute-lft-neg-out69.2%
associate-/l*68.7%
times-frac99.8%
frac-2neg99.8%
associate-*r/99.9%
add-sqr-sqrt43.1%
sqrt-unprod71.2%
sqr-neg71.2%
sqrt-unprod41.0%
add-sqr-sqrt68.7%
add-sqr-sqrt65.4%
sqrt-unprod69.2%
sqr-neg69.2%
sqrt-prod3.3%
add-sqr-sqrt99.9%
Applied egg-rr99.9%
Taylor expanded in t1 around 0 99.9%
if -5.4e188 < u < -1.20000000000000008e-132Initial program 77.0%
associate-/l*80.6%
distribute-lft-neg-out80.6%
distribute-rgt-neg-in80.6%
associate-/r*89.4%
distribute-neg-frac289.4%
Simplified89.4%
if -1.20000000000000008e-132 < u < 7.20000000000000064e-151Initial program 50.9%
associate-/l*54.5%
distribute-lft-neg-out54.5%
distribute-rgt-neg-in54.5%
associate-/r*63.4%
distribute-neg-frac263.4%
Simplified63.4%
associate-*r/98.5%
+-commutative98.5%
distribute-neg-in98.5%
sub-neg98.5%
associate-*l/98.5%
clear-num98.4%
frac-2neg98.4%
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-sqrt45.7%
sqrt-unprod23.5%
sqr-neg23.5%
sqrt-unprod6.7%
add-sqr-sqrt11.5%
add-sqr-sqrt4.8%
sqrt-unprod41.7%
Applied egg-rr100.0%
Taylor expanded in u around 0 94.1%
*-commutative94.1%
Simplified94.1%
if 7.20000000000000064e-151 < u < 9.80000000000000006e145Initial program 86.3%
associate-*l/88.0%
*-commutative88.0%
Simplified88.0%
if 9.80000000000000006e145 < u Initial program 75.5%
associate-/l*76.1%
distribute-lft-neg-out76.1%
distribute-rgt-neg-in76.1%
associate-/r*90.4%
distribute-neg-frac290.4%
Simplified90.4%
Taylor expanded in t1 around 0 90.4%
associate-*r/99.9%
frac-2neg99.9%
clear-num100.0%
un-div-inv100.0%
remove-double-neg100.0%
Applied egg-rr100.0%
Final simplification92.8%
(FPCore (u v t1) :precision binary64 (if (<= t1 -4.4e+132) (/ v (- (- t1) (* u 2.0))) (if (<= t1 4e+107) (* (- t1) (/ (/ v (+ t1 u)) (+ t1 u))) (/ v (- t1)))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -4.4e+132) {
tmp = v / (-t1 - (u * 2.0));
} else if (t1 <= 4e+107) {
tmp = -t1 * ((v / (t1 + u)) / (t1 + u));
} else {
tmp = v / -t1;
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (t1 <= (-4.4d+132)) then
tmp = v / (-t1 - (u * 2.0d0))
else if (t1 <= 4d+107) then
tmp = -t1 * ((v / (t1 + u)) / (t1 + u))
else
tmp = v / -t1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -4.4e+132) {
tmp = v / (-t1 - (u * 2.0));
} else if (t1 <= 4e+107) {
tmp = -t1 * ((v / (t1 + u)) / (t1 + u));
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -4.4e+132: tmp = v / (-t1 - (u * 2.0)) elif t1 <= 4e+107: tmp = -t1 * ((v / (t1 + u)) / (t1 + u)) else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -4.4e+132) tmp = Float64(v / Float64(Float64(-t1) - Float64(u * 2.0))); elseif (t1 <= 4e+107) tmp = Float64(Float64(-t1) * Float64(Float64(v / Float64(t1 + u)) / Float64(t1 + u))); else tmp = Float64(v / Float64(-t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -4.4e+132) tmp = v / (-t1 - (u * 2.0)); elseif (t1 <= 4e+107) tmp = -t1 * ((v / (t1 + u)) / (t1 + u)); else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -4.4e+132], N[(v / N[((-t1) - N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 4e+107], N[((-t1) * N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -4.4 \cdot 10^{+132}:\\
\;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\
\mathbf{elif}\;t1 \leq 4 \cdot 10^{+107}:\\
\;\;\;\;\left(-t1\right) \cdot \frac{\frac{v}{t1 + u}}{t1 + u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if t1 < -4.39999999999999977e132Initial program 38.4%
associate-/l*44.6%
distribute-lft-neg-out44.6%
distribute-rgt-neg-in44.6%
associate-/r*66.9%
distribute-neg-frac266.9%
Simplified66.9%
associate-*r/99.8%
+-commutative99.8%
distribute-neg-in99.8%
sub-neg99.8%
associate-*l/100.0%
clear-num100.0%
frac-2neg100.0%
frac-times94.8%
*-un-lft-identity94.8%
frac-2neg94.8%
sub-neg94.8%
distribute-neg-in94.8%
+-commutative94.8%
remove-double-neg94.8%
add-sqr-sqrt94.6%
sqrt-unprod18.0%
sqr-neg18.0%
sqrt-unprod0.0%
add-sqr-sqrt33.5%
add-sqr-sqrt30.5%
sqrt-unprod34.3%
Applied egg-rr94.8%
Taylor expanded in u around 0 89.9%
*-commutative89.9%
Simplified89.9%
if -4.39999999999999977e132 < t1 < 3.9999999999999999e107Initial program 84.9%
associate-/l*85.8%
distribute-lft-neg-out85.8%
distribute-rgt-neg-in85.8%
associate-/r*90.2%
distribute-neg-frac290.2%
Simplified90.2%
if 3.9999999999999999e107 < t1 Initial program 46.7%
associate-/l*41.7%
distribute-lft-neg-out41.7%
distribute-rgt-neg-in41.7%
associate-/r*59.8%
distribute-neg-frac259.8%
Simplified59.8%
Taylor expanded in t1 around inf 86.7%
associate-*r/86.7%
neg-mul-186.7%
Simplified86.7%
Final simplification89.5%
(FPCore (u v t1)
:precision binary64
(if (<= u -5.8e-40)
(/ (/ t1 (/ u v)) (- (- u) t1))
(if (<= u 1.55e-13)
(/ v (- (- t1) (* u 2.0)))
(* (/ v (+ t1 u)) (* t1 (/ -1.0 u))))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -5.8e-40) {
tmp = (t1 / (u / v)) / (-u - t1);
} else if (u <= 1.55e-13) {
tmp = v / (-t1 - (u * 2.0));
} else {
tmp = (v / (t1 + u)) * (t1 * (-1.0 / 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 <= (-5.8d-40)) then
tmp = (t1 / (u / v)) / (-u - t1)
else if (u <= 1.55d-13) then
tmp = v / (-t1 - (u * 2.0d0))
else
tmp = (v / (t1 + u)) * (t1 * ((-1.0d0) / u))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -5.8e-40) {
tmp = (t1 / (u / v)) / (-u - t1);
} else if (u <= 1.55e-13) {
tmp = v / (-t1 - (u * 2.0));
} else {
tmp = (v / (t1 + u)) * (t1 * (-1.0 / u));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -5.8e-40: tmp = (t1 / (u / v)) / (-u - t1) elif u <= 1.55e-13: tmp = v / (-t1 - (u * 2.0)) else: tmp = (v / (t1 + u)) * (t1 * (-1.0 / u)) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -5.8e-40) tmp = Float64(Float64(t1 / Float64(u / v)) / Float64(Float64(-u) - t1)); elseif (u <= 1.55e-13) tmp = Float64(v / Float64(Float64(-t1) - Float64(u * 2.0))); else tmp = Float64(Float64(v / Float64(t1 + u)) * Float64(t1 * Float64(-1.0 / u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -5.8e-40) tmp = (t1 / (u / v)) / (-u - t1); elseif (u <= 1.55e-13) tmp = v / (-t1 - (u * 2.0)); else tmp = (v / (t1 + u)) * (t1 * (-1.0 / u)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -5.8e-40], N[(N[(t1 / N[(u / v), $MachinePrecision]), $MachinePrecision] / N[((-u) - t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 1.55e-13], N[(v / N[((-t1) - N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(t1 * N[(-1.0 / u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -5.8 \cdot 10^{-40}:\\
\;\;\;\;\frac{\frac{t1}{\frac{u}{v}}}{\left(-u\right) - t1}\\
\mathbf{elif}\;u \leq 1.55 \cdot 10^{-13}:\\
\;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{t1 + u} \cdot \left(t1 \cdot \frac{-1}{u}\right)\\
\end{array}
\end{array}
if u < -5.7999999999999998e-40Initial program 74.9%
associate-/l*74.2%
distribute-lft-neg-out74.2%
distribute-rgt-neg-in74.2%
associate-/r*87.2%
distribute-neg-frac287.2%
Simplified87.2%
Taylor expanded in t1 around 0 76.6%
associate-*r/80.2%
frac-2neg80.2%
clear-num80.2%
un-div-inv80.2%
remove-double-neg80.2%
Applied egg-rr80.2%
if -5.7999999999999998e-40 < u < 1.55e-13Initial program 63.2%
associate-/l*66.4%
distribute-lft-neg-out66.4%
distribute-rgt-neg-in66.4%
associate-/r*73.4%
distribute-neg-frac273.4%
Simplified73.4%
associate-*r/96.7%
+-commutative96.7%
distribute-neg-in96.7%
sub-neg96.7%
associate-*l/97.3%
clear-num97.3%
frac-2neg97.3%
frac-times99.9%
*-un-lft-identity99.9%
frac-2neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
+-commutative99.9%
remove-double-neg99.9%
add-sqr-sqrt48.3%
sqrt-unprod29.2%
sqr-neg29.2%
sqrt-unprod9.0%
add-sqr-sqrt15.9%
add-sqr-sqrt7.5%
sqrt-unprod47.2%
Applied egg-rr99.9%
Taylor expanded in u around 0 80.4%
*-commutative80.4%
Simplified80.4%
if 1.55e-13 < u Initial program 81.3%
associate-/l*79.7%
distribute-lft-neg-out79.7%
distribute-rgt-neg-in79.7%
associate-/r*88.5%
distribute-neg-frac288.5%
Simplified88.5%
associate-*r/99.7%
+-commutative99.7%
distribute-neg-in99.7%
sub-neg99.7%
associate-*l/98.2%
clear-num98.1%
frac-2neg98.1%
frac-times93.3%
*-un-lft-identity93.3%
frac-2neg93.3%
sub-neg93.3%
distribute-neg-in93.3%
+-commutative93.3%
remove-double-neg93.3%
add-sqr-sqrt45.6%
sqrt-unprod53.7%
sqr-neg53.7%
sqrt-unprod27.9%
add-sqr-sqrt52.0%
add-sqr-sqrt8.8%
sqrt-unprod75.8%
Applied egg-rr93.3%
neg-mul-193.3%
times-frac98.1%
Applied egg-rr98.1%
*-commutative98.1%
associate-/r/98.2%
Simplified98.2%
Taylor expanded in t1 around 0 81.4%
Final simplification80.6%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -5.2e-39) (not (<= t1 1.55e-34))) (/ v (- (- t1) (* u 2.0))) (* t1 (/ v (* (+ t1 u) (- u))))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -5.2e-39) || !(t1 <= 1.55e-34)) {
tmp = v / (-t1 - (u * 2.0));
} else {
tmp = t1 * (v / ((t1 + u) * -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-39)) .or. (.not. (t1 <= 1.55d-34))) then
tmp = v / (-t1 - (u * 2.0d0))
else
tmp = t1 * (v / ((t1 + u) * -u))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -5.2e-39) || !(t1 <= 1.55e-34)) {
tmp = v / (-t1 - (u * 2.0));
} else {
tmp = t1 * (v / ((t1 + u) * -u));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -5.2e-39) or not (t1 <= 1.55e-34): tmp = v / (-t1 - (u * 2.0)) else: tmp = t1 * (v / ((t1 + u) * -u)) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -5.2e-39) || !(t1 <= 1.55e-34)) tmp = Float64(v / Float64(Float64(-t1) - Float64(u * 2.0))); else tmp = Float64(t1 * Float64(v / Float64(Float64(t1 + u) * Float64(-u)))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -5.2e-39) || ~((t1 <= 1.55e-34))) tmp = v / (-t1 - (u * 2.0)); else tmp = t1 * (v / ((t1 + u) * -u)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -5.2e-39], N[Not[LessEqual[t1, 1.55e-34]], $MachinePrecision]], N[(v / N[((-t1) - N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t1 * N[(v / N[(N[(t1 + u), $MachinePrecision] * (-u)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -5.2 \cdot 10^{-39} \lor \neg \left(t1 \leq 1.55 \cdot 10^{-34}\right):\\
\;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;t1 \cdot \frac{v}{\left(t1 + u\right) \cdot \left(-u\right)}\\
\end{array}
\end{array}
if t1 < -5.2e-39 or 1.5499999999999999e-34 < t1 Initial program 61.7%
associate-/l*62.1%
distribute-lft-neg-out62.1%
distribute-rgt-neg-in62.1%
associate-/r*75.9%
distribute-neg-frac275.9%
Simplified75.9%
associate-*r/99.9%
+-commutative99.9%
distribute-neg-in99.9%
sub-neg99.9%
associate-*l/99.9%
clear-num99.9%
frac-2neg99.9%
frac-times92.3%
*-un-lft-identity92.3%
frac-2neg92.3%
sub-neg92.3%
distribute-neg-in92.3%
+-commutative92.3%
remove-double-neg92.3%
add-sqr-sqrt46.2%
sqrt-unprod36.3%
sqr-neg36.3%
sqrt-unprod16.0%
add-sqr-sqrt32.6%
add-sqr-sqrt16.7%
sqrt-unprod52.2%
Applied egg-rr92.3%
Taylor expanded in u around 0 80.5%
*-commutative80.5%
Simplified80.5%
if -5.2e-39 < t1 < 1.5499999999999999e-34Initial program 85.3%
associate-/l*86.5%
distribute-lft-neg-out86.5%
distribute-rgt-neg-in86.5%
associate-/r*89.5%
distribute-neg-frac289.5%
Simplified89.5%
Taylor expanded in t1 around 0 77.2%
Taylor expanded in v around 0 76.1%
neg-mul-176.1%
distribute-neg-frac276.1%
Simplified76.1%
Final simplification78.6%
(FPCore (u v t1) :precision binary64 (if (or (<= t1 -5.4e-39) (not (<= t1 22000.0))) (/ v (- (- t1) (* u 2.0))) (* (- t1) (/ (/ v u) (+ t1 u)))))
double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -5.4e-39) || !(t1 <= 22000.0)) {
tmp = v / (-t1 - (u * 2.0));
} else {
tmp = -t1 * ((v / u) / (t1 + u));
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if ((t1 <= (-5.4d-39)) .or. (.not. (t1 <= 22000.0d0))) then
tmp = v / (-t1 - (u * 2.0d0))
else
tmp = -t1 * ((v / u) / (t1 + u))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((t1 <= -5.4e-39) || !(t1 <= 22000.0)) {
tmp = v / (-t1 - (u * 2.0));
} else {
tmp = -t1 * ((v / u) / (t1 + u));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (t1 <= -5.4e-39) or not (t1 <= 22000.0): tmp = v / (-t1 - (u * 2.0)) else: tmp = -t1 * ((v / u) / (t1 + u)) return tmp
function code(u, v, t1) tmp = 0.0 if ((t1 <= -5.4e-39) || !(t1 <= 22000.0)) tmp = Float64(v / Float64(Float64(-t1) - Float64(u * 2.0))); else tmp = Float64(Float64(-t1) * Float64(Float64(v / u) / Float64(t1 + u))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((t1 <= -5.4e-39) || ~((t1 <= 22000.0))) tmp = v / (-t1 - (u * 2.0)); else tmp = -t1 * ((v / u) / (t1 + u)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -5.4e-39], N[Not[LessEqual[t1, 22000.0]], $MachinePrecision]], N[(v / N[((-t1) - N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-t1) * N[(N[(v / u), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -5.4 \cdot 10^{-39} \lor \neg \left(t1 \leq 22000\right):\\
\;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\left(-t1\right) \cdot \frac{\frac{v}{u}}{t1 + u}\\
\end{array}
\end{array}
if t1 < -5.4000000000000001e-39 or 22000 < t1 Initial program 60.5%
associate-/l*60.9%
distribute-lft-neg-out60.9%
distribute-rgt-neg-in60.9%
associate-/r*74.7%
distribute-neg-frac274.7%
Simplified74.7%
associate-*r/99.9%
+-commutative99.9%
distribute-neg-in99.9%
sub-neg99.9%
associate-*l/99.9%
clear-num99.9%
frac-2neg99.9%
frac-times92.6%
*-un-lft-identity92.6%
frac-2neg92.6%
sub-neg92.6%
distribute-neg-in92.6%
+-commutative92.6%
remove-double-neg92.6%
add-sqr-sqrt48.5%
sqrt-unprod36.6%
sqr-neg36.6%
sqrt-unprod15.2%
add-sqr-sqrt32.6%
add-sqr-sqrt16.1%
sqrt-unprod50.5%
Applied egg-rr92.6%
Taylor expanded in u around 0 81.6%
*-commutative81.6%
Simplified81.6%
if -5.4000000000000001e-39 < t1 < 22000Initial program 85.4%
associate-/l*86.5%
distribute-lft-neg-out86.5%
distribute-rgt-neg-in86.5%
associate-/r*90.1%
distribute-neg-frac290.1%
Simplified90.1%
Taylor expanded in t1 around 0 76.1%
Final simplification79.1%
(FPCore (u v t1) :precision binary64 (if (or (<= u -7.2e-40) (not (<= u 2.2e-13))) (/ (/ t1 (/ u v)) (- (- u) t1)) (/ v (- (- t1) (* u 2.0)))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -7.2e-40) || !(u <= 2.2e-13)) {
tmp = (t1 / (u / v)) / (-u - t1);
} else {
tmp = v / (-t1 - (u * 2.0));
}
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-40)) .or. (.not. (u <= 2.2d-13))) then
tmp = (t1 / (u / v)) / (-u - t1)
else
tmp = v / (-t1 - (u * 2.0d0))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -7.2e-40) || !(u <= 2.2e-13)) {
tmp = (t1 / (u / v)) / (-u - t1);
} else {
tmp = v / (-t1 - (u * 2.0));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -7.2e-40) or not (u <= 2.2e-13): tmp = (t1 / (u / v)) / (-u - t1) else: tmp = v / (-t1 - (u * 2.0)) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -7.2e-40) || !(u <= 2.2e-13)) tmp = Float64(Float64(t1 / Float64(u / v)) / Float64(Float64(-u) - t1)); else tmp = Float64(v / Float64(Float64(-t1) - Float64(u * 2.0))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -7.2e-40) || ~((u <= 2.2e-13))) tmp = (t1 / (u / v)) / (-u - t1); else tmp = v / (-t1 - (u * 2.0)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -7.2e-40], N[Not[LessEqual[u, 2.2e-13]], $MachinePrecision]], N[(N[(t1 / N[(u / v), $MachinePrecision]), $MachinePrecision] / N[((-u) - t1), $MachinePrecision]), $MachinePrecision], N[(v / N[((-t1) - N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -7.2 \cdot 10^{-40} \lor \neg \left(u \leq 2.2 \cdot 10^{-13}\right):\\
\;\;\;\;\frac{\frac{t1}{\frac{u}{v}}}{\left(-u\right) - t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\
\end{array}
\end{array}
if u < -7.2e-40 or 2.19999999999999997e-13 < u Initial program 78.1%
associate-/l*77.0%
distribute-lft-neg-out77.0%
distribute-rgt-neg-in77.0%
associate-/r*87.9%
distribute-neg-frac287.9%
Simplified87.9%
Taylor expanded in t1 around 0 77.4%
associate-*r/79.6%
frac-2neg79.6%
clear-num79.6%
un-div-inv79.6%
remove-double-neg79.6%
Applied egg-rr79.6%
if -7.2e-40 < u < 2.19999999999999997e-13Initial program 63.2%
associate-/l*66.4%
distribute-lft-neg-out66.4%
distribute-rgt-neg-in66.4%
associate-/r*73.4%
distribute-neg-frac273.4%
Simplified73.4%
associate-*r/96.7%
+-commutative96.7%
distribute-neg-in96.7%
sub-neg96.7%
associate-*l/97.3%
clear-num97.3%
frac-2neg97.3%
frac-times99.9%
*-un-lft-identity99.9%
frac-2neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
+-commutative99.9%
remove-double-neg99.9%
add-sqr-sqrt48.3%
sqrt-unprod29.2%
sqr-neg29.2%
sqrt-unprod9.0%
add-sqr-sqrt15.9%
add-sqr-sqrt7.5%
sqrt-unprod47.2%
Applied egg-rr99.9%
Taylor expanded in u around 0 80.4%
*-commutative80.4%
Simplified80.4%
Final simplification79.9%
(FPCore (u v t1) :precision binary64 (if (or (<= u -3.5e+79) (not (<= u 7.2e+136))) (* v (/ t1 (* u (- u t1)))) (/ v (- (- t1) (* u 2.0)))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -3.5e+79) || !(u <= 7.2e+136)) {
tmp = v * (t1 / (u * (u - t1)));
} else {
tmp = v / (-t1 - (u * 2.0));
}
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+79)) .or. (.not. (u <= 7.2d+136))) then
tmp = v * (t1 / (u * (u - t1)))
else
tmp = v / (-t1 - (u * 2.0d0))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -3.5e+79) || !(u <= 7.2e+136)) {
tmp = v * (t1 / (u * (u - t1)));
} else {
tmp = v / (-t1 - (u * 2.0));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -3.5e+79) or not (u <= 7.2e+136): tmp = v * (t1 / (u * (u - t1))) else: tmp = v / (-t1 - (u * 2.0)) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -3.5e+79) || !(u <= 7.2e+136)) tmp = Float64(v * Float64(t1 / Float64(u * Float64(u - t1)))); else tmp = Float64(v / Float64(Float64(-t1) - Float64(u * 2.0))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -3.5e+79) || ~((u <= 7.2e+136))) tmp = v * (t1 / (u * (u - t1))); else tmp = v / (-t1 - (u * 2.0)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -3.5e+79], N[Not[LessEqual[u, 7.2e+136]], $MachinePrecision]], N[(v * N[(t1 / N[(u * N[(u - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v / N[((-t1) - N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.5 \cdot 10^{+79} \lor \neg \left(u \leq 7.2 \cdot 10^{+136}\right):\\
\;\;\;\;v \cdot \frac{t1}{u \cdot \left(u - t1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\
\end{array}
\end{array}
if u < -3.4999999999999998e79 or 7.20000000000000011e136 < u Initial program 73.9%
associate-/l*74.4%
distribute-lft-neg-out74.4%
distribute-rgt-neg-in74.4%
associate-/r*89.8%
distribute-neg-frac289.8%
Simplified89.8%
Taylor expanded in t1 around 0 86.4%
associate-/l/74.4%
associate-*r/73.9%
*-commutative73.9%
add-sqr-sqrt47.8%
sqrt-unprod73.9%
sqr-neg73.9%
sqrt-unprod26.1%
add-sqr-sqrt66.0%
Applied egg-rr66.0%
*-commutative66.0%
associate-/l*66.6%
+-commutative66.6%
distribute-lft-in56.9%
add-sqr-sqrt22.6%
sqrt-unprod41.4%
sqr-neg41.4%
sqrt-unprod33.0%
add-sqr-sqrt60.3%
distribute-lft-neg-out60.3%
*-commutative60.3%
sub-neg60.3%
distribute-rgt-out--66.6%
Applied egg-rr66.6%
if -3.4999999999999998e79 < u < 7.20000000000000011e136Initial program 70.7%
associate-/l*71.5%
distribute-lft-neg-out71.5%
distribute-rgt-neg-in71.5%
associate-/r*77.6%
distribute-neg-frac277.6%
Simplified77.6%
associate-*r/97.8%
+-commutative97.8%
distribute-neg-in97.8%
sub-neg97.8%
associate-*l/97.5%
clear-num97.4%
frac-2neg97.4%
frac-times99.2%
*-un-lft-identity99.2%
frac-2neg99.2%
sub-neg99.2%
distribute-neg-in99.2%
+-commutative99.2%
remove-double-neg99.2%
add-sqr-sqrt48.1%
sqrt-unprod35.3%
sqr-neg35.3%
sqrt-unprod10.9%
add-sqr-sqrt20.3%
add-sqr-sqrt8.6%
sqrt-unprod51.6%
Applied egg-rr99.2%
Taylor expanded in u around 0 69.4%
*-commutative69.4%
Simplified69.4%
Final simplification68.5%
(FPCore (u v t1) :precision binary64 (if (or (<= u -3.6e+114) (not (<= u 1.35e+163))) (* v (/ (/ t1 u) t1)) (/ v (- (- t1) (* u 2.0)))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -3.6e+114) || !(u <= 1.35e+163)) {
tmp = v * ((t1 / u) / t1);
} else {
tmp = v / (-t1 - (u * 2.0));
}
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.6d+114)) .or. (.not. (u <= 1.35d+163))) then
tmp = v * ((t1 / u) / t1)
else
tmp = v / (-t1 - (u * 2.0d0))
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -3.6e+114) || !(u <= 1.35e+163)) {
tmp = v * ((t1 / u) / t1);
} else {
tmp = v / (-t1 - (u * 2.0));
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -3.6e+114) or not (u <= 1.35e+163): tmp = v * ((t1 / u) / t1) else: tmp = v / (-t1 - (u * 2.0)) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -3.6e+114) || !(u <= 1.35e+163)) tmp = Float64(v * Float64(Float64(t1 / u) / t1)); else tmp = Float64(v / Float64(Float64(-t1) - Float64(u * 2.0))); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -3.6e+114) || ~((u <= 1.35e+163))) tmp = v * ((t1 / u) / t1); else tmp = v / (-t1 - (u * 2.0)); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -3.6e+114], N[Not[LessEqual[u, 1.35e+163]], $MachinePrecision]], N[(v * N[(N[(t1 / u), $MachinePrecision] / t1), $MachinePrecision]), $MachinePrecision], N[(v / N[((-t1) - N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.6 \cdot 10^{+114} \lor \neg \left(u \leq 1.35 \cdot 10^{+163}\right):\\
\;\;\;\;v \cdot \frac{\frac{t1}{u}}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\
\end{array}
\end{array}
if u < -3.6000000000000001e114 or 1.35e163 < u Initial program 73.4%
associate-/l*73.8%
distribute-lft-neg-out73.8%
distribute-rgt-neg-in73.8%
associate-/r*89.4%
distribute-neg-frac289.4%
Simplified89.4%
Taylor expanded in t1 around 0 88.0%
Taylor expanded in u around 0 41.7%
mul-1-neg41.7%
associate-/r*41.4%
distribute-neg-frac241.4%
Simplified41.4%
clear-num41.4%
un-div-inv41.4%
div-inv41.4%
add-sqr-sqrt22.2%
sqrt-unprod49.5%
sqr-neg49.5%
sqrt-unprod19.0%
add-sqr-sqrt41.4%
clear-num41.4%
Applied egg-rr41.4%
associate-/r*46.3%
associate-/r/60.1%
Applied egg-rr60.1%
if -3.6000000000000001e114 < u < 1.35e163Initial program 71.2%
associate-/l*72.0%
distribute-lft-neg-out72.0%
distribute-rgt-neg-in72.0%
associate-/r*78.7%
distribute-neg-frac278.7%
Simplified78.7%
associate-*r/98.0%
+-commutative98.0%
distribute-neg-in98.0%
sub-neg98.0%
associate-*l/96.6%
clear-num96.6%
frac-2neg96.6%
frac-times98.2%
*-un-lft-identity98.2%
frac-2neg98.2%
sub-neg98.2%
distribute-neg-in98.2%
+-commutative98.2%
remove-double-neg98.2%
add-sqr-sqrt47.5%
sqrt-unprod35.7%
sqr-neg35.7%
sqrt-unprod11.8%
add-sqr-sqrt22.8%
add-sqr-sqrt11.3%
sqrt-unprod51.9%
Applied egg-rr98.2%
Taylor expanded in u around 0 67.9%
*-commutative67.9%
Simplified67.9%
Final simplification65.7%
(FPCore (u v t1) :precision binary64 (if (or (<= u -4.4e+114) (not (<= u 8e+146))) (* v (/ (/ t1 u) t1)) (/ (- v) (+ t1 u))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -4.4e+114) || !(u <= 8e+146)) {
tmp = v * ((t1 / u) / 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 <= (-4.4d+114)) .or. (.not. (u <= 8d+146))) then
tmp = v * ((t1 / u) / 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 <= -4.4e+114) || !(u <= 8e+146)) {
tmp = v * ((t1 / u) / t1);
} else {
tmp = -v / (t1 + u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -4.4e+114) or not (u <= 8e+146): tmp = v * ((t1 / u) / t1) else: tmp = -v / (t1 + u) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -4.4e+114) || !(u <= 8e+146)) tmp = Float64(v * Float64(Float64(t1 / u) / t1)); else tmp = Float64(Float64(-v) / Float64(t1 + u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -4.4e+114) || ~((u <= 8e+146))) tmp = v * ((t1 / u) / t1); else tmp = -v / (t1 + u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -4.4e+114], N[Not[LessEqual[u, 8e+146]], $MachinePrecision]], N[(v * N[(N[(t1 / u), $MachinePrecision] / t1), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -4.4 \cdot 10^{+114} \lor \neg \left(u \leq 8 \cdot 10^{+146}\right):\\
\;\;\;\;v \cdot \frac{\frac{t1}{u}}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\end{array}
\end{array}
if u < -4.4000000000000001e114 or 7.99999999999999947e146 < u Initial program 74.1%
associate-/l*74.5%
distribute-lft-neg-out74.5%
distribute-rgt-neg-in74.5%
associate-/r*89.6%
distribute-neg-frac289.6%
Simplified89.6%
Taylor expanded in t1 around 0 88.3%
Taylor expanded in u around 0 42.0%
mul-1-neg42.0%
associate-/r*41.7%
distribute-neg-frac241.7%
Simplified41.7%
clear-num41.7%
un-div-inv41.7%
div-inv41.7%
add-sqr-sqrt21.6%
sqrt-unprod50.8%
sqr-neg50.8%
sqrt-unprod19.9%
add-sqr-sqrt41.7%
clear-num41.7%
Applied egg-rr41.7%
associate-/r*46.5%
associate-/r/59.9%
Applied egg-rr59.9%
if -4.4000000000000001e114 < u < 7.99999999999999947e146Initial program 70.8%
associate-/l*71.6%
distribute-lft-neg-out71.6%
distribute-rgt-neg-in71.6%
associate-/r*78.5%
distribute-neg-frac278.5%
Simplified78.5%
distribute-frac-neg278.5%
distribute-rgt-neg-out78.5%
associate-/r*71.6%
distribute-lft-neg-out71.6%
associate-/l*70.8%
times-frac96.6%
frac-2neg96.6%
associate-*r/97.8%
add-sqr-sqrt46.9%
sqrt-unprod35.5%
sqr-neg35.5%
sqrt-unprod11.9%
add-sqr-sqrt21.9%
add-sqr-sqrt10.9%
sqrt-unprod51.2%
sqr-neg51.2%
sqrt-prod50.1%
add-sqr-sqrt97.8%
Applied egg-rr97.8%
Taylor expanded in t1 around inf 67.7%
mul-1-neg67.7%
Simplified67.7%
Final simplification65.4%
(FPCore (u v t1) :precision binary64 (if (or (<= u -2.2e+159) (not (<= u 9e+111))) (/ v u) (/ v (- t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.2e+159) || !(u <= 9e+111)) {
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.2d+159)) .or. (.not. (u <= 9d+111))) 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.2e+159) || !(u <= 9e+111)) {
tmp = v / u;
} else {
tmp = v / -t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -2.2e+159) or not (u <= 9e+111): tmp = v / u else: tmp = v / -t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -2.2e+159) || !(u <= 9e+111)) 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.2e+159) || ~((u <= 9e+111))) tmp = v / u; else tmp = v / -t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.2e+159], N[Not[LessEqual[u, 9e+111]], $MachinePrecision]], N[(v / u), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.2 \cdot 10^{+159} \lor \neg \left(u \leq 9 \cdot 10^{+111}\right):\\
\;\;\;\;\frac{v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\
\end{array}
\end{array}
if u < -2.1999999999999999e159 or 9.00000000000000001e111 < u Initial program 73.4%
associate-/l*73.3%
distribute-lft-neg-out73.3%
distribute-rgt-neg-in73.3%
associate-/r*87.5%
distribute-neg-frac287.5%
Simplified87.5%
Taylor expanded in t1 around 0 87.5%
associate-/l/73.3%
associate-*r/73.4%
*-commutative73.4%
add-sqr-sqrt35.6%
sqrt-unprod70.7%
sqr-neg70.7%
sqrt-unprod35.1%
add-sqr-sqrt70.7%
Applied egg-rr70.7%
Taylor expanded in t1 around inf 45.6%
if -2.1999999999999999e159 < u < 9.00000000000000001e111Initial program 71.1%
associate-/l*72.2%
distribute-lft-neg-out72.2%
distribute-rgt-neg-in72.2%
associate-/r*79.4%
distribute-neg-frac279.4%
Simplified79.4%
Taylor expanded in t1 around inf 64.3%
associate-*r/64.3%
neg-mul-164.3%
Simplified64.3%
Final simplification59.1%
(FPCore (u v t1) :precision binary64 (if (<= u -4.8e+160) (/ v u) (if (<= u 1.28e+113) (/ v (- t1)) (/ v (- u)))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -4.8e+160) {
tmp = v / u;
} else if (u <= 1.28e+113) {
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 <= (-4.8d+160)) then
tmp = v / u
else if (u <= 1.28d+113) 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 <= -4.8e+160) {
tmp = v / u;
} else if (u <= 1.28e+113) {
tmp = v / -t1;
} else {
tmp = v / -u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -4.8e+160: tmp = v / u elif u <= 1.28e+113: tmp = v / -t1 else: tmp = v / -u return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -4.8e+160) tmp = Float64(v / u); elseif (u <= 1.28e+113) tmp = Float64(v / Float64(-t1)); else tmp = Float64(v / Float64(-u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -4.8e+160) tmp = v / u; elseif (u <= 1.28e+113) tmp = v / -t1; else tmp = v / -u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -4.8e+160], N[(v / u), $MachinePrecision], If[LessEqual[u, 1.28e+113], N[(v / (-t1)), $MachinePrecision], N[(v / (-u)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -4.8 \cdot 10^{+160}:\\
\;\;\;\;\frac{v}{u}\\
\mathbf{elif}\;u \leq 1.28 \cdot 10^{+113}:\\
\;\;\;\;\frac{v}{-t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{-u}\\
\end{array}
\end{array}
if u < -4.8000000000000003e160Initial program 67.7%
associate-/l*68.2%
distribute-lft-neg-out68.2%
distribute-rgt-neg-in68.2%
associate-/r*85.8%
distribute-neg-frac285.8%
Simplified85.8%
Taylor expanded in t1 around 0 85.8%
associate-/l/68.2%
associate-*r/67.7%
*-commutative67.7%
add-sqr-sqrt64.6%
sqrt-unprod67.7%
sqr-neg67.7%
sqrt-unprod3.1%
add-sqr-sqrt67.7%
Applied egg-rr67.7%
Taylor expanded in t1 around inf 46.3%
if -4.8000000000000003e160 < u < 1.27999999999999994e113Initial program 71.1%
associate-/l*72.2%
distribute-lft-neg-out72.2%
distribute-rgt-neg-in72.2%
associate-/r*79.4%
distribute-neg-frac279.4%
Simplified79.4%
Taylor expanded in t1 around inf 64.3%
associate-*r/64.3%
neg-mul-164.3%
Simplified64.3%
if 1.27999999999999994e113 < u Initial program 77.9%
associate-/l*77.4%
distribute-lft-neg-out77.4%
distribute-rgt-neg-in77.4%
associate-/r*88.8%
distribute-neg-frac288.8%
Simplified88.8%
Taylor expanded in t1 around 0 88.8%
Taylor expanded in t1 around inf 45.6%
associate-*r/45.6%
mul-1-neg45.6%
Simplified45.6%
Final simplification59.1%
(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(t1 / Float64(t1 + u)) * Float64(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 71.8%
times-frac97.5%
distribute-frac-neg97.5%
distribute-neg-frac297.5%
+-commutative97.5%
distribute-neg-in97.5%
unsub-neg97.5%
Simplified97.5%
Final simplification97.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 71.8%
associate-/l*72.5%
distribute-lft-neg-out72.5%
distribute-rgt-neg-in72.5%
associate-/r*81.7%
distribute-neg-frac281.7%
Simplified81.7%
distribute-frac-neg281.7%
distribute-rgt-neg-out81.7%
associate-/r*72.5%
distribute-lft-neg-out72.5%
associate-/l*71.8%
times-frac97.5%
frac-2neg97.5%
associate-*r/98.3%
add-sqr-sqrt46.5%
sqrt-unprod44.2%
sqr-neg44.2%
sqrt-unprod18.9%
add-sqr-sqrt35.5%
add-sqr-sqrt19.0%
sqrt-unprod56.5%
sqr-neg56.5%
sqrt-prod47.6%
add-sqr-sqrt98.3%
Applied egg-rr98.3%
Taylor expanded in t1 around inf 60.2%
mul-1-neg60.2%
Simplified60.2%
Final simplification60.2%
(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 71.8%
associate-/l*72.5%
distribute-lft-neg-out72.5%
distribute-rgt-neg-in72.5%
associate-/r*81.7%
distribute-neg-frac281.7%
Simplified81.7%
Taylor expanded in t1 around 0 52.4%
associate-/l/48.4%
associate-*r/47.0%
*-commutative47.0%
add-sqr-sqrt24.4%
sqrt-unprod40.8%
sqr-neg40.8%
sqrt-unprod13.7%
add-sqr-sqrt29.9%
Applied egg-rr29.9%
Taylor expanded in t1 around inf 16.6%
Final simplification16.6%
herbie shell --seed 2024060
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))