
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1): return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 * v) / ((t1 + u) * (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1): return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1) return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u))) end
function tmp = code(u, v, t1) tmp = (-t1 * v) / ((t1 + u) * (t1 + u)); end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}
(FPCore (u v t1) :precision binary64 (/ (* (/ v (+ t1 u)) (- t1)) (+ t1 u)))
double code(double u, double v, double t1) {
return ((v / (t1 + u)) * -t1) / (t1 + u);
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = ((v / (t1 + u)) * -t1) / (t1 + u)
end function
public static double code(double u, double v, double t1) {
return ((v / (t1 + u)) * -t1) / (t1 + u);
}
def code(u, v, t1): return ((v / (t1 + u)) * -t1) / (t1 + u)
function code(u, v, t1) return Float64(Float64(Float64(v / Float64(t1 + u)) * Float64(-t1)) / Float64(t1 + u)) end
function tmp = code(u, v, t1) tmp = ((v / (t1 + u)) * -t1) / (t1 + u); end
code[u_, v_, t1_] := N[(N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * (-t1)), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{v}{t1 + u} \cdot \left(-t1\right)}{t1 + u}
\end{array}
Initial program 73.8%
associate-/r*85.5%
associate-/l*98.5%
Simplified98.5%
div-inv98.3%
clear-num99.2%
add-sqr-sqrt50.9%
sqrt-unprod45.8%
sqr-neg45.8%
sqrt-unprod15.6%
add-sqr-sqrt35.6%
distribute-lft-neg-in35.6%
distribute-rgt-neg-in35.6%
add-sqr-sqrt15.6%
sqrt-unprod45.8%
sqr-neg45.8%
sqrt-unprod50.9%
add-sqr-sqrt99.2%
Applied egg-rr99.2%
Final simplification99.2%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (* v (/ (- t1) (* (+ t1 u) (+ t1 u))))))
(if (<= t1 -1.06e+154)
(/ (- v) t1)
(if (<= t1 -1.26e-185)
t_1
(if (<= t1 2.8e-146)
(/ (/ (- t1) (/ u v)) u)
(if (<= t1 3.2e+136) t_1 (/ v (- u t1))))))))
double code(double u, double v, double t1) {
double t_1 = v * (-t1 / ((t1 + u) * (t1 + u)));
double tmp;
if (t1 <= -1.06e+154) {
tmp = -v / t1;
} else if (t1 <= -1.26e-185) {
tmp = t_1;
} else if (t1 <= 2.8e-146) {
tmp = (-t1 / (u / v)) / u;
} else if (t1 <= 3.2e+136) {
tmp = t_1;
} else {
tmp = v / (u - t1);
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: t_1
real(8) :: tmp
t_1 = v * (-t1 / ((t1 + u) * (t1 + u)))
if (t1 <= (-1.06d+154)) then
tmp = -v / t1
else if (t1 <= (-1.26d-185)) then
tmp = t_1
else if (t1 <= 2.8d-146) then
tmp = (-t1 / (u / v)) / u
else if (t1 <= 3.2d+136) then
tmp = t_1
else
tmp = v / (u - t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = v * (-t1 / ((t1 + u) * (t1 + u)));
double tmp;
if (t1 <= -1.06e+154) {
tmp = -v / t1;
} else if (t1 <= -1.26e-185) {
tmp = t_1;
} else if (t1 <= 2.8e-146) {
tmp = (-t1 / (u / v)) / u;
} else if (t1 <= 3.2e+136) {
tmp = t_1;
} else {
tmp = v / (u - t1);
}
return tmp;
}
def code(u, v, t1): t_1 = v * (-t1 / ((t1 + u) * (t1 + u))) tmp = 0 if t1 <= -1.06e+154: tmp = -v / t1 elif t1 <= -1.26e-185: tmp = t_1 elif t1 <= 2.8e-146: tmp = (-t1 / (u / v)) / u elif t1 <= 3.2e+136: tmp = t_1 else: tmp = v / (u - t1) return tmp
function code(u, v, t1) t_1 = Float64(v * Float64(Float64(-t1) / Float64(Float64(t1 + u) * Float64(t1 + u)))) tmp = 0.0 if (t1 <= -1.06e+154) tmp = Float64(Float64(-v) / t1); elseif (t1 <= -1.26e-185) tmp = t_1; elseif (t1 <= 2.8e-146) tmp = Float64(Float64(Float64(-t1) / Float64(u / v)) / u); elseif (t1 <= 3.2e+136) tmp = t_1; else tmp = Float64(v / Float64(u - t1)); end return tmp end
function tmp_2 = code(u, v, t1) t_1 = v * (-t1 / ((t1 + u) * (t1 + u))); tmp = 0.0; if (t1 <= -1.06e+154) tmp = -v / t1; elseif (t1 <= -1.26e-185) tmp = t_1; elseif (t1 <= 2.8e-146) tmp = (-t1 / (u / v)) / u; elseif (t1 <= 3.2e+136) tmp = t_1; else tmp = v / (u - t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v * N[((-t1) / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -1.06e+154], N[((-v) / t1), $MachinePrecision], If[LessEqual[t1, -1.26e-185], t$95$1, If[LessEqual[t1, 2.8e-146], N[(N[((-t1) / N[(u / v), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision], If[LessEqual[t1, 3.2e+136], t$95$1, N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
\mathbf{if}\;t1 \leq -1.06 \cdot 10^{+154}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{elif}\;t1 \leq -1.26 \cdot 10^{-185}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t1 \leq 2.8 \cdot 10^{-146}:\\
\;\;\;\;\frac{\frac{-t1}{\frac{u}{v}}}{u}\\
\mathbf{elif}\;t1 \leq 3.2 \cdot 10^{+136}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u - t1}\\
\end{array}
\end{array}
if t1 < -1.06e154Initial program 32.6%
associate-*l/34.2%
*-commutative34.2%
Simplified34.2%
Taylor expanded in t1 around inf 100.0%
associate-*r/100.0%
neg-mul-1100.0%
Simplified100.0%
if -1.06e154 < t1 < -1.2599999999999999e-185 or 2.80000000000000003e-146 < t1 < 3.19999999999999988e136Initial program 87.4%
associate-*l/93.1%
*-commutative93.1%
Simplified93.1%
if -1.2599999999999999e-185 < t1 < 2.80000000000000003e-146Initial program 71.3%
associate-/r*86.7%
associate-/l*98.2%
Simplified98.2%
div-inv98.1%
clear-num98.3%
add-sqr-sqrt56.4%
sqrt-unprod47.3%
sqr-neg47.3%
sqrt-unprod13.6%
add-sqr-sqrt41.8%
distribute-lft-neg-in41.8%
distribute-rgt-neg-in41.8%
add-sqr-sqrt13.6%
sqrt-unprod47.3%
sqr-neg47.3%
sqrt-unprod56.4%
add-sqr-sqrt98.3%
Applied egg-rr98.3%
Taylor expanded in t1 around 0 71.3%
mul-1-neg71.3%
*-commutative71.3%
unpow271.3%
associate-/r*77.2%
associate-*r/80.3%
Simplified80.3%
associate-*r/77.2%
associate-*l/81.1%
clear-num81.1%
associate-*l/81.2%
*-un-lft-identity81.2%
Applied egg-rr81.2%
if 3.19999999999999988e136 < t1 Initial program 55.7%
associate-*l/56.7%
*-commutative56.7%
Simplified56.7%
associate-/r*99.3%
associate-*r/100.0%
*-commutative100.0%
associate-/r/96.4%
div-inv96.0%
clear-num95.9%
associate-/r/95.9%
clear-num99.6%
*-commutative99.6%
clear-num95.9%
div-inv96.0%
frac-2neg96.0%
remove-double-neg96.0%
associate-*l/96.2%
Applied egg-rr51.0%
Taylor expanded in t1 around inf 45.7%
frac-2neg45.7%
associate-/r/45.7%
sub-neg45.7%
distribute-neg-in45.7%
add-sqr-sqrt26.4%
sqrt-unprod47.9%
sqr-neg47.9%
sqrt-unprod19.2%
add-sqr-sqrt45.8%
distribute-neg-in45.8%
+-commutative45.8%
distribute-neg-in45.8%
add-sqr-sqrt26.6%
sqrt-unprod47.9%
sqr-neg47.9%
sqrt-unprod19.2%
add-sqr-sqrt45.7%
add-sqr-sqrt21.0%
sqrt-unprod63.0%
sqr-neg63.0%
sqrt-unprod49.9%
add-sqr-sqrt94.5%
Applied egg-rr94.5%
associate-*l/94.8%
*-lft-identity94.8%
sub-neg94.8%
Simplified94.8%
Final simplification91.2%
(FPCore (u v t1) :precision binary64 (if (<= t1 -1.2e-67) (/ (- v) (+ t1 u)) (if (<= t1 7.3e-41) (/ (* v (/ (- t1) u)) u) (/ v (- u t1)))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.2e-67) {
tmp = -v / (t1 + u);
} else if (t1 <= 7.3e-41) {
tmp = (v * (-t1 / u)) / u;
} else {
tmp = v / (u - t1);
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (t1 <= (-1.2d-67)) then
tmp = -v / (t1 + u)
else if (t1 <= 7.3d-41) then
tmp = (v * (-t1 / u)) / u
else
tmp = v / (u - t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.2e-67) {
tmp = -v / (t1 + u);
} else if (t1 <= 7.3e-41) {
tmp = (v * (-t1 / u)) / u;
} else {
tmp = v / (u - t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -1.2e-67: tmp = -v / (t1 + u) elif t1 <= 7.3e-41: tmp = (v * (-t1 / u)) / u else: tmp = v / (u - t1) return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -1.2e-67) tmp = Float64(Float64(-v) / Float64(t1 + u)); elseif (t1 <= 7.3e-41) tmp = Float64(Float64(v * Float64(Float64(-t1) / u)) / u); else tmp = Float64(v / Float64(u - t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -1.2e-67) tmp = -v / (t1 + u); elseif (t1 <= 7.3e-41) tmp = (v * (-t1 / u)) / u; else tmp = v / (u - t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -1.2e-67], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 7.3e-41], N[(N[(v * N[((-t1) / u), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.2 \cdot 10^{-67}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{elif}\;t1 \leq 7.3 \cdot 10^{-41}:\\
\;\;\;\;\frac{v \cdot \frac{-t1}{u}}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u - t1}\\
\end{array}
\end{array}
if t1 < -1.2e-67Initial program 72.7%
associate-/r*82.6%
associate-/l*99.4%
Simplified99.4%
Taylor expanded in t1 around inf 80.7%
neg-mul-180.7%
Simplified80.7%
if -1.2e-67 < t1 < 7.30000000000000026e-41Initial program 75.8%
associate-/r*89.0%
associate-/l*98.1%
Simplified98.1%
div-inv98.0%
clear-num98.1%
add-sqr-sqrt51.6%
sqrt-unprod54.6%
sqr-neg54.6%
sqrt-unprod15.5%
add-sqr-sqrt37.2%
distribute-lft-neg-in37.2%
distribute-rgt-neg-in37.2%
add-sqr-sqrt15.5%
sqrt-unprod54.6%
sqr-neg54.6%
sqrt-unprod51.6%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
Taylor expanded in t1 around 0 69.0%
mul-1-neg69.0%
*-commutative69.0%
unpow269.0%
associate-/r*74.8%
associate-*r/76.7%
Simplified76.7%
if 7.30000000000000026e-41 < t1 Initial program 72.2%
associate-*l/76.5%
*-commutative76.5%
Simplified76.5%
associate-/r*97.1%
associate-*r/99.9%
*-commutative99.9%
associate-/r/98.1%
div-inv97.9%
clear-num97.8%
associate-/r/97.8%
clear-num99.6%
*-commutative99.6%
clear-num97.8%
div-inv97.9%
frac-2neg97.9%
remove-double-neg97.9%
associate-*l/98.0%
Applied egg-rr45.0%
Taylor expanded in t1 around inf 34.9%
frac-2neg34.9%
associate-/r/33.7%
sub-neg33.7%
distribute-neg-in33.7%
add-sqr-sqrt19.9%
sqrt-unprod37.1%
sqr-neg37.1%
sqrt-unprod13.7%
add-sqr-sqrt33.9%
distribute-neg-in33.9%
+-commutative33.9%
distribute-neg-in33.9%
add-sqr-sqrt20.2%
sqrt-unprod37.3%
sqr-neg37.3%
sqrt-unprod13.8%
add-sqr-sqrt33.7%
add-sqr-sqrt14.2%
sqrt-unprod53.0%
sqr-neg53.0%
sqrt-unprod52.5%
add-sqr-sqrt87.7%
Applied egg-rr87.7%
associate-*l/87.9%
*-lft-identity87.9%
sub-neg87.9%
Simplified87.9%
Final simplification81.1%
(FPCore (u v t1) :precision binary64 (if (<= t1 -1.25e-67) (/ (- v) (+ t1 u)) (if (<= t1 3.3e-41) (/ (/ (- t1) (/ u v)) u) (/ v (- u t1)))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.25e-67) {
tmp = -v / (t1 + u);
} else if (t1 <= 3.3e-41) {
tmp = (-t1 / (u / v)) / u;
} else {
tmp = v / (u - t1);
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (t1 <= (-1.25d-67)) then
tmp = -v / (t1 + u)
else if (t1 <= 3.3d-41) then
tmp = (-t1 / (u / v)) / u
else
tmp = v / (u - t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.25e-67) {
tmp = -v / (t1 + u);
} else if (t1 <= 3.3e-41) {
tmp = (-t1 / (u / v)) / u;
} else {
tmp = v / (u - t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -1.25e-67: tmp = -v / (t1 + u) elif t1 <= 3.3e-41: tmp = (-t1 / (u / v)) / u else: tmp = v / (u - t1) return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -1.25e-67) tmp = Float64(Float64(-v) / Float64(t1 + u)); elseif (t1 <= 3.3e-41) tmp = Float64(Float64(Float64(-t1) / Float64(u / v)) / u); else tmp = Float64(v / Float64(u - t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -1.25e-67) tmp = -v / (t1 + u); elseif (t1 <= 3.3e-41) tmp = (-t1 / (u / v)) / u; else tmp = v / (u - t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -1.25e-67], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 3.3e-41], N[(N[((-t1) / N[(u / v), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.25 \cdot 10^{-67}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\mathbf{elif}\;t1 \leq 3.3 \cdot 10^{-41}:\\
\;\;\;\;\frac{\frac{-t1}{\frac{u}{v}}}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u - t1}\\
\end{array}
\end{array}
if t1 < -1.25e-67Initial program 72.7%
associate-/r*82.6%
associate-/l*99.4%
Simplified99.4%
Taylor expanded in t1 around inf 80.7%
neg-mul-180.7%
Simplified80.7%
if -1.25e-67 < t1 < 3.30000000000000024e-41Initial program 75.8%
associate-/r*89.0%
associate-/l*98.1%
Simplified98.1%
div-inv98.0%
clear-num98.1%
add-sqr-sqrt51.6%
sqrt-unprod54.6%
sqr-neg54.6%
sqrt-unprod15.5%
add-sqr-sqrt37.2%
distribute-lft-neg-in37.2%
distribute-rgt-neg-in37.2%
add-sqr-sqrt15.5%
sqrt-unprod54.6%
sqr-neg54.6%
sqrt-unprod51.6%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
Taylor expanded in t1 around 0 69.0%
mul-1-neg69.0%
*-commutative69.0%
unpow269.0%
associate-/r*74.8%
associate-*r/76.7%
Simplified76.7%
associate-*r/74.8%
associate-*l/77.9%
clear-num77.9%
associate-*l/77.9%
*-un-lft-identity77.9%
Applied egg-rr77.9%
if 3.30000000000000024e-41 < t1 Initial program 72.2%
associate-*l/76.5%
*-commutative76.5%
Simplified76.5%
associate-/r*97.1%
associate-*r/99.9%
*-commutative99.9%
associate-/r/98.1%
div-inv97.9%
clear-num97.8%
associate-/r/97.8%
clear-num99.6%
*-commutative99.6%
clear-num97.8%
div-inv97.9%
frac-2neg97.9%
remove-double-neg97.9%
associate-*l/98.0%
Applied egg-rr45.0%
Taylor expanded in t1 around inf 34.9%
frac-2neg34.9%
associate-/r/33.7%
sub-neg33.7%
distribute-neg-in33.7%
add-sqr-sqrt19.9%
sqrt-unprod37.1%
sqr-neg37.1%
sqrt-unprod13.7%
add-sqr-sqrt33.9%
distribute-neg-in33.9%
+-commutative33.9%
distribute-neg-in33.9%
add-sqr-sqrt20.2%
sqrt-unprod37.3%
sqr-neg37.3%
sqrt-unprod13.8%
add-sqr-sqrt33.7%
add-sqr-sqrt14.2%
sqrt-unprod53.0%
sqr-neg53.0%
sqrt-unprod52.5%
add-sqr-sqrt87.7%
Applied egg-rr87.7%
associate-*l/87.9%
*-lft-identity87.9%
sub-neg87.9%
Simplified87.9%
Final simplification81.6%
(FPCore (u v t1) :precision binary64 (if (or (<= u -1.55e+118) (not (<= u 5.5e+158))) (* v (/ (/ t1 u) u)) (/ v (- u t1))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.55e+118) || !(u <= 5.5e+158)) {
tmp = v * ((t1 / u) / u);
} else {
tmp = v / (u - t1);
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if ((u <= (-1.55d+118)) .or. (.not. (u <= 5.5d+158))) then
tmp = v * ((t1 / u) / u)
else
tmp = v / (u - t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if ((u <= -1.55e+118) || !(u <= 5.5e+158)) {
tmp = v * ((t1 / u) / u);
} else {
tmp = v / (u - t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -1.55e+118) or not (u <= 5.5e+158): tmp = v * ((t1 / u) / u) else: tmp = v / (u - t1) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -1.55e+118) || !(u <= 5.5e+158)) tmp = Float64(v * Float64(Float64(t1 / u) / u)); else tmp = Float64(v / Float64(u - t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -1.55e+118) || ~((u <= 5.5e+158))) tmp = v * ((t1 / u) / u); else tmp = v / (u - t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.55e+118], N[Not[LessEqual[u, 5.5e+158]], $MachinePrecision]], N[(v * N[(N[(t1 / u), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.55 \cdot 10^{+118} \lor \neg \left(u \leq 5.5 \cdot 10^{+158}\right):\\
\;\;\;\;v \cdot \frac{\frac{t1}{u}}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u - t1}\\
\end{array}
\end{array}
if u < -1.54999999999999993e118 or 5.4999999999999998e158 < u Initial program 86.3%
associate-*l/85.0%
*-commutative85.0%
Simplified85.0%
Taylor expanded in t1 around 0 85.0%
associate-*r/85.0%
neg-mul-185.0%
unpow285.0%
Simplified85.0%
add-sqr-sqrt32.8%
sqrt-unprod70.6%
sqr-neg70.6%
sqrt-unprod50.6%
times-frac49.1%
Applied egg-rr49.1%
times-frac50.6%
rem-square-sqrt83.4%
*-rgt-identity83.4%
times-frac80.4%
associate-*r/80.4%
*-rgt-identity80.4%
Simplified80.4%
if -1.54999999999999993e118 < u < 5.4999999999999998e158Initial program 69.8%
associate-*l/75.0%
*-commutative75.0%
Simplified75.0%
associate-/r*98.3%
associate-*r/99.1%
*-commutative99.1%
associate-/r/98.0%
div-inv97.7%
clear-num97.6%
associate-/r/97.5%
clear-num98.6%
*-commutative98.6%
clear-num97.5%
div-inv97.7%
frac-2neg97.7%
remove-double-neg97.7%
associate-*l/97.9%
Applied egg-rr42.1%
Taylor expanded in t1 around inf 16.6%
frac-2neg16.6%
associate-/r/16.6%
sub-neg16.6%
distribute-neg-in16.6%
add-sqr-sqrt7.8%
sqrt-unprod16.6%
sqr-neg16.6%
sqrt-unprod9.0%
add-sqr-sqrt17.2%
distribute-neg-in17.2%
+-commutative17.2%
distribute-neg-in17.2%
add-sqr-sqrt8.3%
sqrt-unprod17.0%
sqr-neg17.0%
sqrt-unprod8.7%
add-sqr-sqrt16.6%
add-sqr-sqrt10.0%
sqrt-unprod37.3%
sqr-neg37.3%
sqrt-unprod32.5%
add-sqr-sqrt70.6%
Applied egg-rr70.6%
associate-*l/70.9%
*-lft-identity70.9%
sub-neg70.9%
Simplified70.9%
Final simplification73.2%
(FPCore (u v t1) :precision binary64 (if (<= u -2.6e+119) (/ v (/ (* u u) t1)) (if (<= u 3.8e+158) (/ v (- u t1)) (* v (/ (/ t1 u) u)))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -2.6e+119) {
tmp = v / ((u * u) / t1);
} else if (u <= 3.8e+158) {
tmp = v / (u - t1);
} else {
tmp = 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 (u <= (-2.6d+119)) then
tmp = v / ((u * u) / t1)
else if (u <= 3.8d+158) then
tmp = v / (u - t1)
else
tmp = v * ((t1 / u) / u)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -2.6e+119) {
tmp = v / ((u * u) / t1);
} else if (u <= 3.8e+158) {
tmp = v / (u - t1);
} else {
tmp = v * ((t1 / u) / u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -2.6e+119: tmp = v / ((u * u) / t1) elif u <= 3.8e+158: tmp = v / (u - t1) else: tmp = v * ((t1 / u) / u) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -2.6e+119) tmp = Float64(v / Float64(Float64(u * u) / t1)); elseif (u <= 3.8e+158) tmp = Float64(v / Float64(u - t1)); else tmp = Float64(v * Float64(Float64(t1 / u) / u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -2.6e+119) tmp = v / ((u * u) / t1); elseif (u <= 3.8e+158) tmp = v / (u - t1); else tmp = v * ((t1 / u) / u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -2.6e+119], N[(v / N[(N[(u * u), $MachinePrecision] / t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 3.8e+158], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision], N[(v * N[(N[(t1 / u), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.6 \cdot 10^{+119}:\\
\;\;\;\;\frac{v}{\frac{u \cdot u}{t1}}\\
\mathbf{elif}\;u \leq 3.8 \cdot 10^{+158}:\\
\;\;\;\;\frac{v}{u - t1}\\
\mathbf{else}:\\
\;\;\;\;v \cdot \frac{\frac{t1}{u}}{u}\\
\end{array}
\end{array}
if u < -2.6e119Initial program 84.2%
associate-*l/81.7%
*-commutative81.7%
Simplified81.7%
Taylor expanded in t1 around 0 81.7%
associate-*r/81.7%
neg-mul-181.7%
unpow281.7%
Simplified81.7%
clear-num81.7%
un-div-inv81.7%
add-sqr-sqrt38.2%
sqrt-unprod61.5%
sqr-neg61.5%
sqrt-unprod40.8%
add-sqr-sqrt78.9%
Applied egg-rr78.9%
if -2.6e119 < u < 3.7999999999999998e158Initial program 69.8%
associate-*l/75.0%
*-commutative75.0%
Simplified75.0%
associate-/r*98.3%
associate-*r/99.1%
*-commutative99.1%
associate-/r/98.0%
div-inv97.7%
clear-num97.6%
associate-/r/97.5%
clear-num98.6%
*-commutative98.6%
clear-num97.5%
div-inv97.7%
frac-2neg97.7%
remove-double-neg97.7%
associate-*l/97.9%
Applied egg-rr42.1%
Taylor expanded in t1 around inf 16.6%
frac-2neg16.6%
associate-/r/16.6%
sub-neg16.6%
distribute-neg-in16.6%
add-sqr-sqrt7.8%
sqrt-unprod16.6%
sqr-neg16.6%
sqrt-unprod9.0%
add-sqr-sqrt17.2%
distribute-neg-in17.2%
+-commutative17.2%
distribute-neg-in17.2%
add-sqr-sqrt8.3%
sqrt-unprod17.0%
sqr-neg17.0%
sqrt-unprod8.7%
add-sqr-sqrt16.6%
add-sqr-sqrt10.0%
sqrt-unprod37.3%
sqr-neg37.3%
sqrt-unprod32.5%
add-sqr-sqrt70.6%
Applied egg-rr70.6%
associate-*l/70.9%
*-lft-identity70.9%
sub-neg70.9%
Simplified70.9%
if 3.7999999999999998e158 < u Initial program 89.1%
associate-*l/89.3%
*-commutative89.3%
Simplified89.3%
Taylor expanded in t1 around 0 89.3%
associate-*r/89.3%
neg-mul-189.3%
unpow289.3%
Simplified89.3%
add-sqr-sqrt25.9%
sqrt-unprod82.3%
sqr-neg82.3%
sqrt-unprod63.4%
times-frac63.4%
Applied egg-rr63.4%
times-frac63.4%
rem-square-sqrt89.3%
*-rgt-identity89.3%
times-frac89.3%
associate-*r/89.3%
*-rgt-identity89.3%
Simplified89.3%
Final simplification73.9%
(FPCore (u v t1) :precision binary64 (if (or (<= u -2.1e+118) (not (<= u 2.2e+154))) (/ (- v) u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.1e+118) || !(u <= 2.2e+154)) {
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.1d+118)) .or. (.not. (u <= 2.2d+154))) 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.1e+118) || !(u <= 2.2e+154)) {
tmp = -v / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -2.1e+118) or not (u <= 2.2e+154): tmp = -v / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -2.1e+118) || !(u <= 2.2e+154)) 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 <= -2.1e+118) || ~((u <= 2.2e+154))) tmp = -v / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.1e+118], N[Not[LessEqual[u, 2.2e+154]], $MachinePrecision]], N[((-v) / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.1 \cdot 10^{+118} \lor \neg \left(u \leq 2.2 \cdot 10^{+154}\right):\\
\;\;\;\;\frac{-v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -2.1e118 or 2.2000000000000001e154 < u Initial program 85.3%
associate-/r*95.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t1 around 0 93.8%
mul-1-neg93.8%
associate-/l*97.0%
distribute-neg-frac97.0%
Simplified97.0%
Taylor expanded in t1 around inf 43.9%
neg-mul-143.9%
distribute-neg-frac43.9%
Simplified43.9%
if -2.1e118 < u < 2.2000000000000001e154Initial program 70.0%
associate-*l/75.2%
*-commutative75.2%
Simplified75.2%
Taylor expanded in t1 around inf 69.2%
associate-*r/69.2%
neg-mul-169.2%
Simplified69.2%
Final simplification62.9%
(FPCore (u v t1) :precision binary64 (if (<= u -4.6e+118) (/ v u) (if (<= u 1.55e+154) (/ (- v) t1) (/ v u))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -4.6e+118) {
tmp = v / u;
} else if (u <= 1.55e+154) {
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.6d+118)) then
tmp = v / u
else if (u <= 1.55d+154) 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.6e+118) {
tmp = v / u;
} else if (u <= 1.55e+154) {
tmp = -v / t1;
} else {
tmp = v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -4.6e+118: tmp = v / u elif u <= 1.55e+154: tmp = -v / t1 else: tmp = v / u return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -4.6e+118) tmp = Float64(v / u); elseif (u <= 1.55e+154) tmp = Float64(Float64(-v) / t1); else tmp = Float64(v / u); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -4.6e+118) tmp = v / u; elseif (u <= 1.55e+154) tmp = -v / t1; else tmp = v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -4.6e+118], N[(v / u), $MachinePrecision], If[LessEqual[u, 1.55e+154], N[((-v) / t1), $MachinePrecision], N[(v / u), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -4.6 \cdot 10^{+118}:\\
\;\;\;\;\frac{v}{u}\\
\mathbf{elif}\;u \leq 1.55 \cdot 10^{+154}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\
\end{array}
\end{array}
if u < -4.60000000000000032e118 or 1.5500000000000001e154 < u Initial program 85.3%
associate-*l/84.0%
*-commutative84.0%
Simplified84.0%
associate-/r*89.3%
associate-*r/97.4%
*-commutative97.4%
associate-/r/99.9%
div-inv99.9%
clear-num99.9%
associate-/r/99.9%
clear-num99.9%
*-commutative99.9%
clear-num99.9%
div-inv99.9%
frac-2neg99.9%
remove-double-neg99.9%
associate-*l/97.4%
Applied egg-rr94.4%
Taylor expanded in t1 around 0 94.5%
neg-mul-194.5%
distribute-neg-frac94.5%
Simplified94.5%
clear-num94.3%
associate-/r/94.5%
clear-num94.5%
add-sqr-sqrt52.0%
sqrt-unprod85.5%
sqr-neg85.5%
sqrt-unprod39.3%
add-sqr-sqrt82.3%
Applied egg-rr82.3%
Taylor expanded in u around 0 43.8%
if -4.60000000000000032e118 < u < 1.5500000000000001e154Initial program 70.0%
associate-*l/75.2%
*-commutative75.2%
Simplified75.2%
Taylor expanded in t1 around inf 69.2%
associate-*r/69.2%
neg-mul-169.2%
Simplified69.2%
Final simplification62.8%
(FPCore (u v t1) :precision binary64 (if (<= t1 -1.2e+52) (/ v t1) (if (<= t1 9e+123) (/ v u) (/ v t1))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -1.2e+52) {
tmp = v / t1;
} else if (t1 <= 9e+123) {
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 (t1 <= (-1.2d+52)) then
tmp = v / t1
else if (t1 <= 9d+123) 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 (t1 <= -1.2e+52) {
tmp = v / t1;
} else if (t1 <= 9e+123) {
tmp = v / u;
} else {
tmp = v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -1.2e+52: tmp = v / t1 elif t1 <= 9e+123: tmp = v / u else: tmp = v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -1.2e+52) tmp = Float64(v / t1); elseif (t1 <= 9e+123) tmp = Float64(v / u); else tmp = Float64(v / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -1.2e+52) tmp = v / t1; elseif (t1 <= 9e+123) tmp = v / u; else tmp = v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -1.2e+52], N[(v / t1), $MachinePrecision], If[LessEqual[t1, 9e+123], N[(v / u), $MachinePrecision], N[(v / t1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.2 \cdot 10^{+52}:\\
\;\;\;\;\frac{v}{t1}\\
\mathbf{elif}\;t1 \leq 9 \cdot 10^{+123}:\\
\;\;\;\;\frac{v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{v}{t1}\\
\end{array}
\end{array}
if t1 < -1.2e52 or 8.99999999999999965e123 < t1 Initial program 57.9%
associate-*l/60.0%
*-commutative60.0%
Simplified60.0%
associate-/r*97.9%
associate-*r/99.9%
*-commutative99.9%
associate-/r/98.0%
div-inv97.6%
clear-num97.5%
associate-/r/97.6%
clear-num99.6%
*-commutative99.6%
clear-num97.6%
div-inv97.6%
frac-2neg97.6%
remove-double-neg97.6%
associate-*l/97.8%
Applied egg-rr46.9%
Taylor expanded in t1 around inf 38.2%
Taylor expanded in t1 around inf 35.8%
if -1.2e52 < t1 < 8.99999999999999965e123Initial program 81.8%
associate-*l/86.1%
*-commutative86.1%
Simplified86.1%
associate-/r*95.1%
associate-*r/98.0%
*-commutative98.0%
associate-/r/98.7%
div-inv98.5%
clear-num98.5%
associate-/r/98.4%
clear-num98.5%
*-commutative98.5%
clear-num98.4%
div-inv98.5%
frac-2neg98.5%
remove-double-neg98.5%
associate-*l/97.8%
Applied egg-rr59.2%
Taylor expanded in t1 around 0 61.1%
neg-mul-161.1%
distribute-neg-frac61.1%
Simplified61.1%
clear-num61.0%
associate-/r/61.0%
clear-num61.0%
add-sqr-sqrt28.4%
sqrt-unprod45.3%
sqr-neg45.3%
sqrt-unprod19.0%
add-sqr-sqrt35.2%
Applied egg-rr35.2%
Taylor expanded in u around 0 18.6%
Final simplification24.3%
(FPCore (u v t1) :precision binary64 (/ v (- u t1)))
double code(double u, double v, double t1) {
return v / (u - t1);
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = v / (u - t1)
end function
public static double code(double u, double v, double t1) {
return v / (u - t1);
}
def code(u, v, t1): return v / (u - t1)
function code(u, v, t1) return Float64(v / Float64(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 73.8%
associate-*l/77.4%
*-commutative77.4%
Simplified77.4%
associate-/r*96.0%
associate-*r/98.7%
*-commutative98.7%
associate-/r/98.5%
div-inv98.2%
clear-num98.2%
associate-/r/98.1%
clear-num98.9%
*-commutative98.9%
clear-num98.1%
div-inv98.2%
frac-2neg98.2%
remove-double-neg98.2%
associate-*l/97.8%
Applied egg-rr55.1%
Taylor expanded in t1 around inf 23.9%
frac-2neg23.9%
associate-/r/23.1%
sub-neg23.1%
distribute-neg-in23.1%
add-sqr-sqrt12.9%
sqrt-unprod32.0%
sqr-neg32.0%
sqrt-unprod10.4%
add-sqr-sqrt23.6%
distribute-neg-in23.6%
+-commutative23.6%
distribute-neg-in23.6%
add-sqr-sqrt13.2%
sqrt-unprod32.3%
sqr-neg32.3%
sqrt-unprod10.3%
add-sqr-sqrt23.1%
add-sqr-sqrt11.6%
sqrt-unprod38.7%
sqr-neg38.7%
sqrt-unprod31.5%
add-sqr-sqrt64.4%
Applied egg-rr64.4%
associate-*l/64.6%
*-lft-identity64.6%
sub-neg64.6%
Simplified64.6%
Final simplification64.6%
(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.8%
associate-*l/77.4%
*-commutative77.4%
Simplified77.4%
associate-/r*96.0%
associate-*r/98.7%
*-commutative98.7%
associate-/r/98.5%
div-inv98.2%
clear-num98.2%
associate-/r/98.1%
clear-num98.9%
*-commutative98.9%
clear-num98.1%
div-inv98.2%
frac-2neg98.2%
remove-double-neg98.2%
associate-*l/97.8%
Applied egg-rr55.1%
Taylor expanded in t1 around inf 23.9%
Taylor expanded in t1 around inf 14.0%
Final simplification14.0%
herbie shell --seed 2023287
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))