
(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 (* (/ (- 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.4%
times-frac98.2%
Simplified98.2%
Final simplification98.2%
(FPCore (u v t1) :precision binary64 (if (or (<= u -2.4e+48) (not (<= u 2.4e+91))) (/ (- t1) (* u (/ u v))) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.4e+48) || !(u <= 2.4e+91)) {
tmp = -t1 / (u * (u / v));
} 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.4d+48)) .or. (.not. (u <= 2.4d+91))) then
tmp = -t1 / (u * (u / v))
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.4e+48) || !(u <= 2.4e+91)) {
tmp = -t1 / (u * (u / v));
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -2.4e+48) or not (u <= 2.4e+91): tmp = -t1 / (u * (u / v)) else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -2.4e+48) || !(u <= 2.4e+91)) tmp = Float64(Float64(-t1) / Float64(u * Float64(u / v))); else tmp = Float64(Float64(-v) / t1); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -2.4e+48) || ~((u <= 2.4e+91))) tmp = -t1 / (u * (u / v)); else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.4e+48], N[Not[LessEqual[u, 2.4e+91]], $MachinePrecision]], N[((-t1) / N[(u * N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.4 \cdot 10^{+48} \lor \neg \left(u \leq 2.4 \cdot 10^{+91}\right):\\
\;\;\;\;\frac{-t1}{u \cdot \frac{u}{v}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -2.4000000000000001e48 or 2.39999999999999983e91 < u Initial program 79.3%
times-frac96.5%
Simplified96.5%
Taylor expanded in t1 around 0 74.6%
associate-*r/74.6%
neg-mul-174.6%
unpow274.6%
Simplified74.6%
distribute-lft-neg-in74.6%
times-frac87.2%
add-sqr-sqrt38.7%
sqrt-unprod62.9%
sqr-neg62.9%
sqrt-unprod36.5%
add-sqr-sqrt64.3%
Applied egg-rr64.3%
*-commutative64.3%
Simplified64.3%
frac-times62.5%
Applied egg-rr62.5%
frac-2neg62.5%
distribute-frac-neg62.5%
remove-double-neg62.5%
distribute-lft-neg-in62.5%
frac-times64.3%
frac-2neg64.3%
*-commutative64.3%
clear-num65.2%
frac-times65.4%
*-commutative65.4%
*-un-lft-identity65.4%
add-sqr-sqrt29.8%
sqrt-unprod59.6%
sqr-neg59.6%
sqrt-unprod45.6%
add-sqr-sqrt89.0%
Applied egg-rr89.0%
if -2.4000000000000001e48 < u < 2.39999999999999983e91Initial program 69.7%
times-frac99.2%
Simplified99.2%
Taylor expanded in t1 around inf 82.3%
associate-*r/82.3%
neg-mul-182.3%
Simplified82.3%
Final simplification84.9%
(FPCore (u v t1) :precision binary64 (if (<= u -1.25e+47) (/ (- t1) (* u (/ u v))) (if (<= u 2.4e+91) (/ (- v) t1) (/ (* t1 (/ v u)) (- u)))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -1.25e+47) {
tmp = -t1 / (u * (u / v));
} else if (u <= 2.4e+91) {
tmp = -v / t1;
} else {
tmp = (t1 * (v / 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 <= (-1.25d+47)) then
tmp = -t1 / (u * (u / v))
else if (u <= 2.4d+91) then
tmp = -v / t1
else
tmp = (t1 * (v / u)) / -u
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -1.25e+47) {
tmp = -t1 / (u * (u / v));
} else if (u <= 2.4e+91) {
tmp = -v / t1;
} else {
tmp = (t1 * (v / u)) / -u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -1.25e+47: tmp = -t1 / (u * (u / v)) elif u <= 2.4e+91: tmp = -v / t1 else: tmp = (t1 * (v / u)) / -u return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -1.25e+47) tmp = Float64(Float64(-t1) / Float64(u * Float64(u / v))); elseif (u <= 2.4e+91) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(t1 * Float64(v / u)) / Float64(-u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -1.25e+47) tmp = -t1 / (u * (u / v)); elseif (u <= 2.4e+91) tmp = -v / t1; else tmp = (t1 * (v / u)) / -u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -1.25e+47], N[((-t1) / N[(u * N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 2.4e+91], N[((-v) / t1), $MachinePrecision], N[(N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.25 \cdot 10^{+47}:\\
\;\;\;\;\frac{-t1}{u \cdot \frac{u}{v}}\\
\mathbf{elif}\;u \leq 2.4 \cdot 10^{+91}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1 \cdot \frac{v}{u}}{-u}\\
\end{array}
\end{array}
if u < -1.25000000000000005e47Initial program 77.2%
times-frac97.1%
Simplified97.1%
Taylor expanded in t1 around 0 71.9%
associate-*r/71.9%
neg-mul-171.9%
unpow271.9%
Simplified71.9%
distribute-lft-neg-in71.9%
times-frac90.1%
add-sqr-sqrt48.2%
sqrt-unprod62.5%
sqr-neg62.5%
sqrt-unprod29.5%
add-sqr-sqrt62.8%
Applied egg-rr62.8%
*-commutative62.8%
Simplified62.8%
frac-times59.4%
Applied egg-rr59.4%
frac-2neg59.4%
distribute-frac-neg59.4%
remove-double-neg59.4%
distribute-lft-neg-in59.4%
frac-times62.8%
frac-2neg62.8%
*-commutative62.8%
clear-num64.5%
frac-times64.6%
*-commutative64.6%
*-un-lft-identity64.6%
add-sqr-sqrt25.3%
sqrt-unprod60.2%
sqr-neg60.2%
sqrt-unprod48.0%
add-sqr-sqrt93.3%
Applied egg-rr93.3%
if -1.25000000000000005e47 < u < 2.39999999999999983e91Initial program 69.7%
times-frac99.2%
Simplified99.2%
Taylor expanded in t1 around inf 82.3%
associate-*r/82.3%
neg-mul-182.3%
Simplified82.3%
if 2.39999999999999983e91 < u Initial program 81.7%
times-frac96.0%
Simplified96.0%
Taylor expanded in t1 around 0 77.7%
associate-*r/77.7%
neg-mul-177.7%
unpow277.7%
Simplified77.7%
distribute-rgt-neg-in77.7%
times-frac84.1%
Applied egg-rr84.1%
*-commutative84.1%
frac-2neg84.1%
remove-double-neg84.1%
associate-*l/82.0%
add-sqr-sqrt39.1%
sqrt-unprod56.8%
sqr-neg56.8%
sqrt-unprod32.8%
add-sqr-sqrt64.1%
*-commutative64.1%
associate-*l/63.9%
associate-*r/66.0%
div-inv66.0%
add-sqr-sqrt34.8%
sqrt-unprod59.0%
sqr-neg59.0%
sqrt-unprod42.9%
add-sqr-sqrt88.0%
div-inv88.0%
Applied egg-rr88.0%
Final simplification85.6%
(FPCore (u v t1) :precision binary64 (if (<= u -1.15e+47) (/ (- t1) (/ (+ t1 u) (/ v u))) (if (<= u 4.9e+91) (/ (- v) t1) (/ (* t1 (/ v u)) (- u)))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -1.15e+47) {
tmp = -t1 / ((t1 + u) / (v / u));
} else if (u <= 4.9e+91) {
tmp = -v / t1;
} else {
tmp = (t1 * (v / 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 <= (-1.15d+47)) then
tmp = -t1 / ((t1 + u) / (v / u))
else if (u <= 4.9d+91) then
tmp = -v / t1
else
tmp = (t1 * (v / u)) / -u
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (u <= -1.15e+47) {
tmp = -t1 / ((t1 + u) / (v / u));
} else if (u <= 4.9e+91) {
tmp = -v / t1;
} else {
tmp = (t1 * (v / u)) / -u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -1.15e+47: tmp = -t1 / ((t1 + u) / (v / u)) elif u <= 4.9e+91: tmp = -v / t1 else: tmp = (t1 * (v / u)) / -u return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -1.15e+47) tmp = Float64(Float64(-t1) / Float64(Float64(t1 + u) / Float64(v / u))); elseif (u <= 4.9e+91) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(t1 * Float64(v / u)) / Float64(-u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -1.15e+47) tmp = -t1 / ((t1 + u) / (v / u)); elseif (u <= 4.9e+91) tmp = -v / t1; else tmp = (t1 * (v / u)) / -u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -1.15e+47], N[((-t1) / N[(N[(t1 + u), $MachinePrecision] / N[(v / u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 4.9e+91], N[((-v) / t1), $MachinePrecision], N[(N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.15 \cdot 10^{+47}:\\
\;\;\;\;\frac{-t1}{\frac{t1 + u}{\frac{v}{u}}}\\
\mathbf{elif}\;u \leq 4.9 \cdot 10^{+91}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t1 \cdot \frac{v}{u}}{-u}\\
\end{array}
\end{array}
if u < -1.1499999999999999e47Initial program 77.2%
associate-/l*79.4%
associate-/l*93.3%
Simplified93.3%
Taylor expanded in t1 around 0 93.3%
if -1.1499999999999999e47 < u < 4.9000000000000003e91Initial program 69.7%
times-frac99.2%
Simplified99.2%
Taylor expanded in t1 around inf 82.3%
associate-*r/82.3%
neg-mul-182.3%
Simplified82.3%
if 4.9000000000000003e91 < u Initial program 81.7%
times-frac96.0%
Simplified96.0%
Taylor expanded in t1 around 0 77.7%
associate-*r/77.7%
neg-mul-177.7%
unpow277.7%
Simplified77.7%
distribute-rgt-neg-in77.7%
times-frac84.1%
Applied egg-rr84.1%
*-commutative84.1%
frac-2neg84.1%
remove-double-neg84.1%
associate-*l/82.0%
add-sqr-sqrt39.1%
sqrt-unprod56.8%
sqr-neg56.8%
sqrt-unprod32.8%
add-sqr-sqrt64.1%
*-commutative64.1%
associate-*l/63.9%
associate-*r/66.0%
div-inv66.0%
add-sqr-sqrt34.8%
sqrt-unprod59.0%
sqr-neg59.0%
sqrt-unprod42.9%
add-sqr-sqrt88.0%
div-inv88.0%
Applied egg-rr88.0%
Final simplification85.6%
(FPCore (u v t1) :precision binary64 (if (or (<= u -2.3e+55) (not (<= u 4.5e+150))) (* t1 (/ v (* u u))) (/ (- v) (+ t1 u))))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -2.3e+55) || !(u <= 4.5e+150)) {
tmp = t1 * (v / (u * u));
} 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 <= (-2.3d+55)) .or. (.not. (u <= 4.5d+150))) then
tmp = t1 * (v / (u * u))
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 <= -2.3e+55) || !(u <= 4.5e+150)) {
tmp = t1 * (v / (u * u));
} else {
tmp = -v / (t1 + u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -2.3e+55) or not (u <= 4.5e+150): tmp = t1 * (v / (u * u)) else: tmp = -v / (t1 + u) return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -2.3e+55) || !(u <= 4.5e+150)) tmp = Float64(t1 * Float64(v / Float64(u * u))); else tmp = Float64(Float64(-v) / Float64(t1 + u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if ((u <= -2.3e+55) || ~((u <= 4.5e+150))) tmp = t1 * (v / (u * u)); else tmp = -v / (t1 + u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.3e+55], N[Not[LessEqual[u, 4.5e+150]], $MachinePrecision]], N[(t1 * N[(v / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.3 \cdot 10^{+55} \lor \neg \left(u \leq 4.5 \cdot 10^{+150}\right):\\
\;\;\;\;t1 \cdot \frac{v}{u \cdot u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1 + u}\\
\end{array}
\end{array}
if u < -2.29999999999999987e55 or 4.5e150 < u Initial program 77.6%
times-frac97.2%
Simplified97.2%
Taylor expanded in t1 around 0 74.4%
associate-*r/74.4%
neg-mul-174.4%
unpow274.4%
Simplified74.4%
distribute-lft-neg-in74.4%
times-frac89.8%
add-sqr-sqrt40.6%
sqrt-unprod66.2%
sqr-neg66.2%
sqrt-unprod38.5%
add-sqr-sqrt70.0%
Applied egg-rr70.0%
associate-*l/70.0%
associate-*r/71.2%
associate-/r*71.5%
Simplified71.5%
if -2.29999999999999987e55 < u < 4.5e150Initial program 71.3%
times-frac98.7%
Simplified98.7%
Taylor expanded in t1 around inf 77.1%
associate-*r/77.1%
sub-neg77.1%
metadata-eval77.1%
Applied egg-rr77.1%
Taylor expanded in u around 0 79.5%
neg-mul-179.5%
Simplified79.5%
Final simplification76.7%
(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.4%
*-commutative73.4%
times-frac98.2%
neg-mul-198.2%
associate-/l*98.0%
associate-*r/98.1%
associate-/l*98.1%
associate-/l/98.1%
neg-mul-198.1%
*-lft-identity98.1%
metadata-eval98.1%
times-frac98.1%
neg-mul-198.1%
remove-double-neg98.1%
neg-mul-198.1%
sub0-neg98.1%
associate--r+98.1%
neg-sub098.1%
div-sub98.1%
distribute-frac-neg98.1%
*-inverses98.1%
metadata-eval98.1%
Simplified98.1%
Final simplification98.1%
(FPCore (u v t1) :precision binary64 (if (or (<= u -8.5e+144) (not (<= u 3.05e+184))) (/ (- v) u) (/ (- v) t1)))
double code(double u, double v, double t1) {
double tmp;
if ((u <= -8.5e+144) || !(u <= 3.05e+184)) {
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 <= (-8.5d+144)) .or. (.not. (u <= 3.05d+184))) 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 <= -8.5e+144) || !(u <= 3.05e+184)) {
tmp = -v / u;
} else {
tmp = -v / t1;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if (u <= -8.5e+144) or not (u <= 3.05e+184): tmp = -v / u else: tmp = -v / t1 return tmp
function code(u, v, t1) tmp = 0.0 if ((u <= -8.5e+144) || !(u <= 3.05e+184)) 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 <= -8.5e+144) || ~((u <= 3.05e+184))) tmp = -v / u; else tmp = -v / t1; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[Or[LessEqual[u, -8.5e+144], N[Not[LessEqual[u, 3.05e+184]], $MachinePrecision]], N[((-v) / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -8.5 \cdot 10^{+144} \lor \neg \left(u \leq 3.05 \cdot 10^{+184}\right):\\
\;\;\;\;\frac{-v}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\
\end{array}
\end{array}
if u < -8.4999999999999998e144 or 3.05000000000000004e184 < u Initial program 75.2%
times-frac99.0%
Simplified99.0%
Taylor expanded in t1 around 0 93.2%
mul-1-neg93.2%
Simplified93.2%
Taylor expanded in t1 around inf 36.7%
mul-1-neg36.7%
distribute-frac-neg36.7%
Simplified36.7%
if -8.4999999999999998e144 < u < 3.05000000000000004e184Initial program 72.8%
times-frac97.9%
Simplified97.9%
Taylor expanded in t1 around inf 73.0%
associate-*r/73.0%
neg-mul-173.0%
Simplified73.0%
Final simplification63.9%
(FPCore (u v t1) :precision binary64 (if (<= u -2.3e+92) (/ v (+ t1 u)) (if (<= u 4.8e+181) (/ (- v) t1) (/ (- v) u))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -2.3e+92) {
tmp = v / (t1 + u);
} else if (u <= 4.8e+181) {
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 <= (-2.3d+92)) then
tmp = v / (t1 + u)
else if (u <= 4.8d+181) 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 <= -2.3e+92) {
tmp = v / (t1 + u);
} else if (u <= 4.8e+181) {
tmp = -v / t1;
} else {
tmp = -v / u;
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -2.3e+92: tmp = v / (t1 + u) elif u <= 4.8e+181: tmp = -v / t1 else: tmp = -v / u return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -2.3e+92) tmp = Float64(v / Float64(t1 + u)); elseif (u <= 4.8e+181) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(-v) / u); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -2.3e+92) tmp = v / (t1 + u); elseif (u <= 4.8e+181) tmp = -v / t1; else tmp = -v / u; end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -2.3e+92], N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 4.8e+181], N[((-v) / t1), $MachinePrecision], N[((-v) / u), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.3 \cdot 10^{+92}:\\
\;\;\;\;\frac{v}{t1 + u}\\
\mathbf{elif}\;u \leq 4.8 \cdot 10^{+181}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{u}\\
\end{array}
\end{array}
if u < -2.29999999999999998e92Initial program 74.3%
times-frac96.5%
Simplified96.5%
Taylor expanded in t1 around inf 29.1%
associate-*r/27.1%
sub-neg27.1%
metadata-eval27.1%
Applied egg-rr27.1%
Taylor expanded in u around 0 40.1%
neg-mul-140.1%
Simplified40.1%
expm1-log1p-u39.7%
expm1-udef62.4%
add-sqr-sqrt21.6%
sqrt-unprod59.8%
sqr-neg59.8%
sqrt-unprod40.7%
add-sqr-sqrt62.9%
Applied egg-rr62.9%
expm1-def36.9%
expm1-log1p37.0%
Simplified37.0%
if -2.29999999999999998e92 < u < 4.80000000000000004e181Initial program 71.7%
times-frac98.3%
Simplified98.3%
Taylor expanded in t1 around inf 75.1%
associate-*r/75.1%
neg-mul-175.1%
Simplified75.1%
if 4.80000000000000004e181 < u Initial program 81.9%
times-frac99.9%
Simplified99.9%
Taylor expanded in t1 around 0 94.0%
mul-1-neg94.0%
Simplified94.0%
Taylor expanded in t1 around inf 37.8%
mul-1-neg37.8%
distribute-frac-neg37.8%
Simplified37.8%
Final simplification64.0%
(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.4%
times-frac98.2%
Simplified98.2%
Taylor expanded in t1 around inf 60.0%
associate-*r/59.0%
sub-neg59.0%
metadata-eval59.0%
Applied egg-rr59.0%
Taylor expanded in u around 0 66.0%
neg-mul-166.0%
Simplified66.0%
Final simplification66.0%
(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(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.4%
times-frac98.2%
Simplified98.2%
Taylor expanded in t1 around inf 59.8%
associate-*r/59.8%
neg-mul-159.8%
Simplified59.8%
Final simplification59.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.4%
times-frac98.2%
Simplified98.2%
Taylor expanded in t1 around inf 60.0%
Taylor expanded in u around inf 13.5%
Final simplification13.5%
herbie shell --seed 2023224
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))