
(FPCore (v w r) :precision binary64 (- (- (+ 3.0 (/ 2.0 (* r r))) (/ (* (* 0.125 (- 3.0 (* 2.0 v))) (* (* (* w w) r) r)) (- 1.0 v))) 4.5))
double code(double v, double w, double r) {
return ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
code = ((3.0d0 + (2.0d0 / (r * r))) - (((0.125d0 * (3.0d0 - (2.0d0 * v))) * (((w * w) * r) * r)) / (1.0d0 - v))) - 4.5d0
end function
public static double code(double v, double w, double r) {
return ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5;
}
def code(v, w, r): return ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5
function code(v, w, r) return Float64(Float64(Float64(3.0 + Float64(2.0 / Float64(r * r))) - Float64(Float64(Float64(0.125 * Float64(3.0 - Float64(2.0 * v))) * Float64(Float64(Float64(w * w) * r) * r)) / Float64(1.0 - v))) - 4.5) end
function tmp = code(v, w, r) tmp = ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5; end
code[v_, w_, r_] := N[(N[(N[(3.0 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(0.125 * N[(3.0 - N[(2.0 * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(w * w), $MachinePrecision] * r), $MachinePrecision] * r), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (v w r) :precision binary64 (- (- (+ 3.0 (/ 2.0 (* r r))) (/ (* (* 0.125 (- 3.0 (* 2.0 v))) (* (* (* w w) r) r)) (- 1.0 v))) 4.5))
double code(double v, double w, double r) {
return ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
code = ((3.0d0 + (2.0d0 / (r * r))) - (((0.125d0 * (3.0d0 - (2.0d0 * v))) * (((w * w) * r) * r)) / (1.0d0 - v))) - 4.5d0
end function
public static double code(double v, double w, double r) {
return ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5;
}
def code(v, w, r): return ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5
function code(v, w, r) return Float64(Float64(Float64(3.0 + Float64(2.0 / Float64(r * r))) - Float64(Float64(Float64(0.125 * Float64(3.0 - Float64(2.0 * v))) * Float64(Float64(Float64(w * w) * r) * r)) / Float64(1.0 - v))) - 4.5) end
function tmp = code(v, w, r) tmp = ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5; end
code[v_, w_, r_] := N[(N[(N[(3.0 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(0.125 * N[(3.0 - N[(2.0 * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(w * w), $MachinePrecision] * r), $MachinePrecision] * r), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5
\end{array}
(FPCore (v w r) :precision binary64 (+ (* (/ (fma v 0.25 -0.375) (- 1.0 v)) (pow (* r w) 2.0)) (fma 2.0 (pow r -2.0) -1.5)))
double code(double v, double w, double r) {
return ((fma(v, 0.25, -0.375) / (1.0 - v)) * pow((r * w), 2.0)) + fma(2.0, pow(r, -2.0), -1.5);
}
function code(v, w, r) return Float64(Float64(Float64(fma(v, 0.25, -0.375) / Float64(1.0 - v)) * (Float64(r * w) ^ 2.0)) + fma(2.0, (r ^ -2.0), -1.5)) end
code[v_, w_, r_] := N[(N[(N[(N[(v * 0.25 + -0.375), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision] * N[Power[N[(r * w), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[Power[r, -2.0], $MachinePrecision] + -1.5), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(v, 0.25, -0.375\right)}{1 - v} \cdot {\left(r \cdot w\right)}^{2} + \mathsf{fma}\left(2, {r}^{-2}, -1.5\right)
\end{array}
Initial program 83.6%
sub-neg83.6%
+-commutative83.6%
associate--l+83.6%
associate-/l*86.9%
distribute-neg-frac86.9%
associate-/r/86.9%
fma-def86.9%
sub-neg86.9%
Simplified80.3%
fma-udef80.3%
unswap-sqr99.8%
pow299.8%
div-inv99.8%
fma-def99.8%
pow299.8%
pow-flip99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (v w r)
:precision binary64
(+
(-
(+ 3.0 (/ 2.0 (* r r)))
(/
(* 0.125 (+ 3.0 (* v -2.0)))
(pow (cbrt (/ (- 1.0 v) (pow (* r w) 2.0))) 3.0)))
-4.5))
double code(double v, double w, double r) {
return ((3.0 + (2.0 / (r * r))) - ((0.125 * (3.0 + (v * -2.0))) / pow(cbrt(((1.0 - v) / pow((r * w), 2.0))), 3.0))) + -4.5;
}
public static double code(double v, double w, double r) {
return ((3.0 + (2.0 / (r * r))) - ((0.125 * (3.0 + (v * -2.0))) / Math.pow(Math.cbrt(((1.0 - v) / Math.pow((r * w), 2.0))), 3.0))) + -4.5;
}
function code(v, w, r) return Float64(Float64(Float64(3.0 + Float64(2.0 / Float64(r * r))) - Float64(Float64(0.125 * Float64(3.0 + Float64(v * -2.0))) / (cbrt(Float64(Float64(1.0 - v) / (Float64(r * w) ^ 2.0))) ^ 3.0))) + -4.5) end
code[v_, w_, r_] := N[(N[(N[(3.0 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(0.125 * N[(3.0 + N[(v * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[N[Power[N[(N[(1.0 - v), $MachinePrecision] / N[Power[N[(r * w), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -4.5), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{0.125 \cdot \left(3 + v \cdot -2\right)}{{\left(\sqrt[3]{\frac{1 - v}{{\left(r \cdot w\right)}^{2}}}\right)}^{3}}\right) + -4.5
\end{array}
Initial program 83.6%
sub-neg83.6%
associate-/l*86.9%
cancel-sign-sub-inv86.9%
metadata-eval86.9%
*-commutative86.9%
*-commutative86.9%
metadata-eval86.9%
Simplified86.9%
add-cube-cbrt86.8%
pow386.8%
associate-*r*80.1%
unswap-sqr99.6%
pow299.6%
Applied egg-rr99.6%
Final simplification99.6%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= (* w w) 1e+307)
(+
t_0
(- -1.5 (* (* r (* w (* r w))) (/ (+ 0.375 (* v -0.25)) (- 1.0 v)))))
(+ -4.5 (- (+ 3.0 t_0) (* (pow (* r w) 2.0) 0.375))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((w * w) <= 1e+307) {
tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * ((0.375 + (v * -0.25)) / (1.0 - v))));
} else {
tmp = -4.5 + ((3.0 + t_0) - (pow((r * w), 2.0) * 0.375));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
if ((w * w) <= 1d+307) then
tmp = t_0 + ((-1.5d0) - ((r * (w * (r * w))) * ((0.375d0 + (v * (-0.25d0))) / (1.0d0 - v))))
else
tmp = (-4.5d0) + ((3.0d0 + t_0) - (((r * w) ** 2.0d0) * 0.375d0))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((w * w) <= 1e+307) {
tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * ((0.375 + (v * -0.25)) / (1.0 - v))));
} else {
tmp = -4.5 + ((3.0 + t_0) - (Math.pow((r * w), 2.0) * 0.375));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if (w * w) <= 1e+307: tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * ((0.375 + (v * -0.25)) / (1.0 - v)))) else: tmp = -4.5 + ((3.0 + t_0) - (math.pow((r * w), 2.0) * 0.375)) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (Float64(w * w) <= 1e+307) tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(r * Float64(w * Float64(r * w))) * Float64(Float64(0.375 + Float64(v * -0.25)) / Float64(1.0 - v))))); else tmp = Float64(-4.5 + Float64(Float64(3.0 + t_0) - Float64((Float64(r * w) ^ 2.0) * 0.375))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if ((w * w) <= 1e+307) tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * ((0.375 + (v * -0.25)) / (1.0 - v)))); else tmp = -4.5 + ((3.0 + t_0) - (((r * w) ^ 2.0) * 0.375)); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(w * w), $MachinePrecision], 1e+307], N[(t$95$0 + N[(-1.5 - N[(N[(r * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(0.375 + N[(v * -0.25), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 + N[(N[(3.0 + t$95$0), $MachinePrecision] - N[(N[Power[N[(r * w), $MachinePrecision], 2.0], $MachinePrecision] * 0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;w \cdot w \leq 10^{+307}:\\
\;\;\;\;t_0 + \left(-1.5 - \left(r \cdot \left(w \cdot \left(r \cdot w\right)\right)\right) \cdot \frac{0.375 + v \cdot -0.25}{1 - v}\right)\\
\mathbf{else}:\\
\;\;\;\;-4.5 + \left(\left(3 + t_0\right) - {\left(r \cdot w\right)}^{2} \cdot 0.375\right)\\
\end{array}
\end{array}
if (*.f64 w w) < 9.99999999999999986e306Initial program 93.6%
associate--l-93.6%
+-commutative93.6%
associate--l+93.6%
+-commutative93.6%
associate--r+93.6%
metadata-eval93.6%
associate-*l/98.1%
*-commutative98.1%
*-commutative98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in r around 0 98.1%
*-commutative98.1%
unpow298.1%
associate-*r*99.9%
*-commutative99.9%
Simplified99.9%
if 9.99999999999999986e306 < (*.f64 w w) Initial program 54.8%
sub-neg54.8%
associate-/l*54.8%
cancel-sign-sub-inv54.8%
metadata-eval54.8%
*-commutative54.8%
*-commutative54.8%
metadata-eval54.8%
Simplified54.8%
Taylor expanded in v around 0 54.8%
*-commutative54.8%
*-commutative54.8%
unpow254.8%
unpow254.8%
swap-sqr98.8%
unpow298.8%
*-commutative98.8%
Simplified98.8%
Final simplification99.6%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= (* w w) 4e+289)
(+
t_0
(- -1.5 (* (* r (* w (* r w))) (/ (+ 0.375 (* v -0.25)) (- 1.0 v)))))
(+ t_0 (- (* (pow (* r w) 2.0) -0.25) 1.5)))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((w * w) <= 4e+289) {
tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * ((0.375 + (v * -0.25)) / (1.0 - v))));
} else {
tmp = t_0 + ((pow((r * w), 2.0) * -0.25) - 1.5);
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
if ((w * w) <= 4d+289) then
tmp = t_0 + ((-1.5d0) - ((r * (w * (r * w))) * ((0.375d0 + (v * (-0.25d0))) / (1.0d0 - v))))
else
tmp = t_0 + ((((r * w) ** 2.0d0) * (-0.25d0)) - 1.5d0)
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((w * w) <= 4e+289) {
tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * ((0.375 + (v * -0.25)) / (1.0 - v))));
} else {
tmp = t_0 + ((Math.pow((r * w), 2.0) * -0.25) - 1.5);
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if (w * w) <= 4e+289: tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * ((0.375 + (v * -0.25)) / (1.0 - v)))) else: tmp = t_0 + ((math.pow((r * w), 2.0) * -0.25) - 1.5) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (Float64(w * w) <= 4e+289) tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(r * Float64(w * Float64(r * w))) * Float64(Float64(0.375 + Float64(v * -0.25)) / Float64(1.0 - v))))); else tmp = Float64(t_0 + Float64(Float64((Float64(r * w) ^ 2.0) * -0.25) - 1.5)); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if ((w * w) <= 4e+289) tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * ((0.375 + (v * -0.25)) / (1.0 - v)))); else tmp = t_0 + ((((r * w) ^ 2.0) * -0.25) - 1.5); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(w * w), $MachinePrecision], 4e+289], N[(t$95$0 + N[(-1.5 - N[(N[(r * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(0.375 + N[(v * -0.25), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(N[Power[N[(r * w), $MachinePrecision], 2.0], $MachinePrecision] * -0.25), $MachinePrecision] - 1.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;w \cdot w \leq 4 \cdot 10^{+289}:\\
\;\;\;\;t_0 + \left(-1.5 - \left(r \cdot \left(w \cdot \left(r \cdot w\right)\right)\right) \cdot \frac{0.375 + v \cdot -0.25}{1 - v}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left({\left(r \cdot w\right)}^{2} \cdot -0.25 - 1.5\right)\\
\end{array}
\end{array}
if (*.f64 w w) < 4.0000000000000002e289Initial program 94.0%
associate--l-94.0%
+-commutative94.0%
associate--l+94.0%
+-commutative94.0%
associate--r+94.0%
metadata-eval94.0%
associate-*l/98.1%
*-commutative98.1%
*-commutative98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in r around 0 98.1%
*-commutative98.1%
unpow298.1%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
if 4.0000000000000002e289 < (*.f64 w w) Initial program 55.4%
sub-neg55.4%
+-commutative55.4%
associate--l+55.4%
associate-/l*56.8%
distribute-neg-frac56.8%
associate-/r/56.8%
fma-def56.8%
sub-neg56.8%
Simplified56.8%
Taylor expanded in v around inf 56.8%
associate--l+56.8%
associate-*r/56.8%
metadata-eval56.8%
unpow256.8%
*-commutative56.8%
unpow256.8%
unpow256.8%
Simplified56.8%
unswap-sqr98.8%
unpow298.8%
*-commutative98.8%
Applied egg-rr98.8%
Final simplification99.6%
(FPCore (v w r)
:precision binary64
(if (<= r 7e-140)
(* 2.0 (pow r -2.0))
(+
(/ 2.0 (* r r))
(- -1.5 (* (* r (* w (* r w))) (/ (+ 0.375 (* v -0.25)) (- 1.0 v)))))))
double code(double v, double w, double r) {
double tmp;
if (r <= 7e-140) {
tmp = 2.0 * pow(r, -2.0);
} else {
tmp = (2.0 / (r * r)) + (-1.5 - ((r * (w * (r * w))) * ((0.375 + (v * -0.25)) / (1.0 - v))));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: tmp
if (r <= 7d-140) then
tmp = 2.0d0 * (r ** (-2.0d0))
else
tmp = (2.0d0 / (r * r)) + ((-1.5d0) - ((r * (w * (r * w))) * ((0.375d0 + (v * (-0.25d0))) / (1.0d0 - v))))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double tmp;
if (r <= 7e-140) {
tmp = 2.0 * Math.pow(r, -2.0);
} else {
tmp = (2.0 / (r * r)) + (-1.5 - ((r * (w * (r * w))) * ((0.375 + (v * -0.25)) / (1.0 - v))));
}
return tmp;
}
def code(v, w, r): tmp = 0 if r <= 7e-140: tmp = 2.0 * math.pow(r, -2.0) else: tmp = (2.0 / (r * r)) + (-1.5 - ((r * (w * (r * w))) * ((0.375 + (v * -0.25)) / (1.0 - v)))) return tmp
function code(v, w, r) tmp = 0.0 if (r <= 7e-140) tmp = Float64(2.0 * (r ^ -2.0)); else tmp = Float64(Float64(2.0 / Float64(r * r)) + Float64(-1.5 - Float64(Float64(r * Float64(w * Float64(r * w))) * Float64(Float64(0.375 + Float64(v * -0.25)) / Float64(1.0 - v))))); end return tmp end
function tmp_2 = code(v, w, r) tmp = 0.0; if (r <= 7e-140) tmp = 2.0 * (r ^ -2.0); else tmp = (2.0 / (r * r)) + (-1.5 - ((r * (w * (r * w))) * ((0.375 + (v * -0.25)) / (1.0 - v)))); end tmp_2 = tmp; end
code[v_, w_, r_] := If[LessEqual[r, 7e-140], N[(2.0 * N[Power[r, -2.0], $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + N[(-1.5 - N[(N[(r * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(0.375 + N[(v * -0.25), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 7 \cdot 10^{-140}:\\
\;\;\;\;2 \cdot {r}^{-2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{r \cdot r} + \left(-1.5 - \left(r \cdot \left(w \cdot \left(r \cdot w\right)\right)\right) \cdot \frac{0.375 + v \cdot -0.25}{1 - v}\right)\\
\end{array}
\end{array}
if r < 6.9999999999999996e-140Initial program 79.3%
sub-neg79.3%
associate-/l*81.6%
cancel-sign-sub-inv81.6%
metadata-eval81.6%
*-commutative81.6%
*-commutative81.6%
metadata-eval81.6%
Simplified81.6%
Taylor expanded in v around 0 72.4%
*-commutative72.4%
*-commutative72.4%
unpow272.4%
unpow272.4%
swap-sqr93.9%
unpow293.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in r around 0 56.5%
unpow256.5%
Simplified56.5%
div-inv56.5%
pow256.5%
pow-flip56.6%
metadata-eval56.6%
Applied egg-rr56.6%
if 6.9999999999999996e-140 < r Initial program 91.5%
associate--l-91.5%
+-commutative91.5%
associate--l+91.5%
+-commutative91.5%
associate--r+91.5%
metadata-eval91.5%
associate-*l/96.6%
*-commutative96.6%
*-commutative96.6%
*-commutative96.6%
Simplified96.6%
Taylor expanded in r around 0 96.6%
*-commutative96.6%
unpow296.6%
associate-*r*99.9%
*-commutative99.9%
Simplified99.9%
Final simplification72.0%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= r 2.2e-134)
t_0
(+
t_0
(- -1.5 (* (/ (+ 0.375 (* v -0.25)) (- 1.0 v)) (* r (* r (* w w)))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 2.2e-134) {
tmp = t_0;
} else {
tmp = t_0 + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (r * (w * w)))));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
if (r <= 2.2d-134) then
tmp = t_0
else
tmp = t_0 + ((-1.5d0) - (((0.375d0 + (v * (-0.25d0))) / (1.0d0 - v)) * (r * (r * (w * w)))))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 2.2e-134) {
tmp = t_0;
} else {
tmp = t_0 + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (r * (w * w)))));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if r <= 2.2e-134: tmp = t_0 else: tmp = t_0 + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (r * (w * w))))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (r <= 2.2e-134) tmp = t_0; else tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(Float64(0.375 + Float64(v * -0.25)) / Float64(1.0 - v)) * Float64(r * Float64(r * Float64(w * w)))))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (r <= 2.2e-134) tmp = t_0; else tmp = t_0 + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (r * (w * w))))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r, 2.2e-134], t$95$0, N[(t$95$0 + N[(-1.5 - N[(N[(N[(0.375 + N[(v * -0.25), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision] * N[(r * N[(r * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 2.2 \cdot 10^{-134}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - \frac{0.375 + v \cdot -0.25}{1 - v} \cdot \left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right)\right)\\
\end{array}
\end{array}
if r < 2.2e-134Initial program 78.8%
sub-neg78.8%
associate-/l*81.1%
cancel-sign-sub-inv81.1%
metadata-eval81.1%
*-commutative81.1%
*-commutative81.1%
metadata-eval81.1%
Simplified81.1%
Taylor expanded in v around 0 71.9%
*-commutative71.9%
*-commutative71.9%
unpow271.9%
unpow271.9%
swap-sqr93.9%
unpow293.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in r around 0 56.8%
unpow256.8%
Simplified56.8%
if 2.2e-134 < r Initial program 92.5%
associate--l-92.5%
+-commutative92.5%
associate--l+92.5%
+-commutative92.5%
associate--r+92.5%
metadata-eval92.5%
associate-*l/97.7%
*-commutative97.7%
*-commutative97.7%
*-commutative97.7%
Simplified97.7%
Final simplification71.2%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= r 8e-149)
t_0
(+
t_0
(- -1.5 (* (* r (* w (* r w))) (/ (+ 0.375 (* v -0.25)) (- 1.0 v))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 8e-149) {
tmp = t_0;
} else {
tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * ((0.375 + (v * -0.25)) / (1.0 - v))));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
if (r <= 8d-149) then
tmp = t_0
else
tmp = t_0 + ((-1.5d0) - ((r * (w * (r * w))) * ((0.375d0 + (v * (-0.25d0))) / (1.0d0 - v))))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 8e-149) {
tmp = t_0;
} else {
tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * ((0.375 + (v * -0.25)) / (1.0 - v))));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if r <= 8e-149: tmp = t_0 else: tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * ((0.375 + (v * -0.25)) / (1.0 - v)))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (r <= 8e-149) tmp = t_0; else tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(r * Float64(w * Float64(r * w))) * Float64(Float64(0.375 + Float64(v * -0.25)) / Float64(1.0 - v))))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (r <= 8e-149) tmp = t_0; else tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * ((0.375 + (v * -0.25)) / (1.0 - v)))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r, 8e-149], t$95$0, N[(t$95$0 + N[(-1.5 - N[(N[(r * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(0.375 + N[(v * -0.25), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 8 \cdot 10^{-149}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - \left(r \cdot \left(w \cdot \left(r \cdot w\right)\right)\right) \cdot \frac{0.375 + v \cdot -0.25}{1 - v}\right)\\
\end{array}
\end{array}
if r < 7.99999999999999983e-149Initial program 79.2%
sub-neg79.2%
associate-/l*81.5%
cancel-sign-sub-inv81.5%
metadata-eval81.5%
*-commutative81.5%
*-commutative81.5%
metadata-eval81.5%
Simplified81.5%
Taylor expanded in v around 0 72.2%
*-commutative72.2%
*-commutative72.2%
unpow272.2%
unpow272.2%
swap-sqr93.8%
unpow293.8%
*-commutative93.8%
Simplified93.8%
Taylor expanded in r around 0 56.2%
unpow256.2%
Simplified56.2%
if 7.99999999999999983e-149 < r Initial program 91.5%
associate--l-91.5%
+-commutative91.5%
associate--l+91.5%
+-commutative91.5%
associate--r+91.5%
metadata-eval91.5%
associate-*l/96.7%
*-commutative96.7%
*-commutative96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in r around 0 96.7%
*-commutative96.7%
unpow296.7%
associate-*r*99.9%
*-commutative99.9%
Simplified99.9%
Final simplification71.9%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= r 1.35e-132)
t_0
(if (<= r 2.5e+144)
(+ t_0 (- (* -0.375 (* (* r r) (* w w))) 1.5))
(* -0.25 (* (* r w) (* r w)))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 1.35e-132) {
tmp = t_0;
} else if (r <= 2.5e+144) {
tmp = t_0 + ((-0.375 * ((r * r) * (w * w))) - 1.5);
} else {
tmp = -0.25 * ((r * w) * (r * w));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
if (r <= 1.35d-132) then
tmp = t_0
else if (r <= 2.5d+144) then
tmp = t_0 + (((-0.375d0) * ((r * r) * (w * w))) - 1.5d0)
else
tmp = (-0.25d0) * ((r * w) * (r * w))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 1.35e-132) {
tmp = t_0;
} else if (r <= 2.5e+144) {
tmp = t_0 + ((-0.375 * ((r * r) * (w * w))) - 1.5);
} else {
tmp = -0.25 * ((r * w) * (r * w));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if r <= 1.35e-132: tmp = t_0 elif r <= 2.5e+144: tmp = t_0 + ((-0.375 * ((r * r) * (w * w))) - 1.5) else: tmp = -0.25 * ((r * w) * (r * w)) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (r <= 1.35e-132) tmp = t_0; elseif (r <= 2.5e+144) tmp = Float64(t_0 + Float64(Float64(-0.375 * Float64(Float64(r * r) * Float64(w * w))) - 1.5)); else tmp = Float64(-0.25 * Float64(Float64(r * w) * Float64(r * w))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (r <= 1.35e-132) tmp = t_0; elseif (r <= 2.5e+144) tmp = t_0 + ((-0.375 * ((r * r) * (w * w))) - 1.5); else tmp = -0.25 * ((r * w) * (r * w)); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r, 1.35e-132], t$95$0, If[LessEqual[r, 2.5e+144], N[(t$95$0 + N[(N[(-0.375 * N[(N[(r * r), $MachinePrecision] * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.5), $MachinePrecision]), $MachinePrecision], N[(-0.25 * N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 1.35 \cdot 10^{-132}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;r \leq 2.5 \cdot 10^{+144}:\\
\;\;\;\;t_0 + \left(-0.375 \cdot \left(\left(r \cdot r\right) \cdot \left(w \cdot w\right)\right) - 1.5\right)\\
\mathbf{else}:\\
\;\;\;\;-0.25 \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)\\
\end{array}
\end{array}
if r < 1.34999999999999995e-132Initial program 78.8%
sub-neg78.8%
associate-/l*81.1%
cancel-sign-sub-inv81.1%
metadata-eval81.1%
*-commutative81.1%
*-commutative81.1%
metadata-eval81.1%
Simplified81.1%
Taylor expanded in v around 0 71.9%
*-commutative71.9%
*-commutative71.9%
unpow271.9%
unpow271.9%
swap-sqr93.9%
unpow293.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in r around 0 56.8%
unpow256.8%
Simplified56.8%
if 1.34999999999999995e-132 < r < 2.5e144Initial program 95.2%
sub-neg95.2%
+-commutative95.2%
associate--l+95.2%
associate-/l*98.3%
distribute-neg-frac98.3%
associate-/r/98.3%
fma-def98.3%
sub-neg98.3%
Simplified98.2%
Taylor expanded in v around 0 93.2%
associate--l+93.2%
associate-*r/93.2%
metadata-eval93.2%
unpow293.2%
*-commutative93.2%
unpow293.2%
unpow293.2%
Simplified93.2%
if 2.5e144 < r Initial program 86.1%
sub-neg86.1%
+-commutative86.1%
associate--l+86.1%
associate-/l*96.4%
distribute-neg-frac96.4%
associate-/r/96.4%
fma-def96.4%
sub-neg96.4%
Simplified67.8%
Taylor expanded in r around inf 67.8%
Taylor expanded in v around inf 67.8%
*-commutative67.8%
unpow267.8%
*-commutative67.8%
unpow267.8%
swap-sqr86.4%
unpow286.4%
*-commutative86.4%
Simplified86.4%
unpow286.4%
*-commutative86.4%
*-commutative86.4%
Applied egg-rr86.4%
Final simplification68.9%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= r 3.6e-136)
t_0
(if (<= r 2.5e+144)
(+ t_0 (- (* -0.25 (* (* r r) (* w w))) 1.5))
(* -0.25 (* (* r w) (* r w)))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 3.6e-136) {
tmp = t_0;
} else if (r <= 2.5e+144) {
tmp = t_0 + ((-0.25 * ((r * r) * (w * w))) - 1.5);
} else {
tmp = -0.25 * ((r * w) * (r * w));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
if (r <= 3.6d-136) then
tmp = t_0
else if (r <= 2.5d+144) then
tmp = t_0 + (((-0.25d0) * ((r * r) * (w * w))) - 1.5d0)
else
tmp = (-0.25d0) * ((r * w) * (r * w))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 3.6e-136) {
tmp = t_0;
} else if (r <= 2.5e+144) {
tmp = t_0 + ((-0.25 * ((r * r) * (w * w))) - 1.5);
} else {
tmp = -0.25 * ((r * w) * (r * w));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if r <= 3.6e-136: tmp = t_0 elif r <= 2.5e+144: tmp = t_0 + ((-0.25 * ((r * r) * (w * w))) - 1.5) else: tmp = -0.25 * ((r * w) * (r * w)) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (r <= 3.6e-136) tmp = t_0; elseif (r <= 2.5e+144) tmp = Float64(t_0 + Float64(Float64(-0.25 * Float64(Float64(r * r) * Float64(w * w))) - 1.5)); else tmp = Float64(-0.25 * Float64(Float64(r * w) * Float64(r * w))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (r <= 3.6e-136) tmp = t_0; elseif (r <= 2.5e+144) tmp = t_0 + ((-0.25 * ((r * r) * (w * w))) - 1.5); else tmp = -0.25 * ((r * w) * (r * w)); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r, 3.6e-136], t$95$0, If[LessEqual[r, 2.5e+144], N[(t$95$0 + N[(N[(-0.25 * N[(N[(r * r), $MachinePrecision] * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.5), $MachinePrecision]), $MachinePrecision], N[(-0.25 * N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 3.6 \cdot 10^{-136}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;r \leq 2.5 \cdot 10^{+144}:\\
\;\;\;\;t_0 + \left(-0.25 \cdot \left(\left(r \cdot r\right) \cdot \left(w \cdot w\right)\right) - 1.5\right)\\
\mathbf{else}:\\
\;\;\;\;-0.25 \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)\\
\end{array}
\end{array}
if r < 3.5999999999999998e-136Initial program 78.8%
sub-neg78.8%
associate-/l*81.1%
cancel-sign-sub-inv81.1%
metadata-eval81.1%
*-commutative81.1%
*-commutative81.1%
metadata-eval81.1%
Simplified81.1%
Taylor expanded in v around 0 71.9%
*-commutative71.9%
*-commutative71.9%
unpow271.9%
unpow271.9%
swap-sqr93.9%
unpow293.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in r around 0 56.8%
unpow256.8%
Simplified56.8%
if 3.5999999999999998e-136 < r < 2.5e144Initial program 95.2%
sub-neg95.2%
+-commutative95.2%
associate--l+95.2%
associate-/l*98.3%
distribute-neg-frac98.3%
associate-/r/98.3%
fma-def98.3%
sub-neg98.3%
Simplified98.2%
Taylor expanded in v around inf 95.7%
associate--l+95.7%
associate-*r/95.7%
metadata-eval95.7%
unpow295.7%
*-commutative95.7%
unpow295.7%
unpow295.7%
Simplified95.7%
if 2.5e144 < r Initial program 86.1%
sub-neg86.1%
+-commutative86.1%
associate--l+86.1%
associate-/l*96.4%
distribute-neg-frac96.4%
associate-/r/96.4%
fma-def96.4%
sub-neg96.4%
Simplified67.8%
Taylor expanded in r around inf 67.8%
Taylor expanded in v around inf 67.8%
*-commutative67.8%
unpow267.8%
*-commutative67.8%
unpow267.8%
swap-sqr86.4%
unpow286.4%
*-commutative86.4%
Simplified86.4%
unpow286.4%
*-commutative86.4%
*-commutative86.4%
Applied egg-rr86.4%
Final simplification69.5%
(FPCore (v w r)
:precision binary64
(if (or (<= r 5.5e+23)
(and (not (<= r 4.2e+63))
(or (<= r 2e+95) (and (not (<= r 4.6e+123)) (<= r 5.2e+142)))))
(+ -1.5 (/ 2.0 (* r r)))
(* -0.25 (* r (* r (* w w))))))
double code(double v, double w, double r) {
double tmp;
if ((r <= 5.5e+23) || (!(r <= 4.2e+63) && ((r <= 2e+95) || (!(r <= 4.6e+123) && (r <= 5.2e+142))))) {
tmp = -1.5 + (2.0 / (r * r));
} else {
tmp = -0.25 * (r * (r * (w * w)));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: tmp
if ((r <= 5.5d+23) .or. (.not. (r <= 4.2d+63)) .and. (r <= 2d+95) .or. (.not. (r <= 4.6d+123)) .and. (r <= 5.2d+142)) then
tmp = (-1.5d0) + (2.0d0 / (r * r))
else
tmp = (-0.25d0) * (r * (r * (w * w)))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double tmp;
if ((r <= 5.5e+23) || (!(r <= 4.2e+63) && ((r <= 2e+95) || (!(r <= 4.6e+123) && (r <= 5.2e+142))))) {
tmp = -1.5 + (2.0 / (r * r));
} else {
tmp = -0.25 * (r * (r * (w * w)));
}
return tmp;
}
def code(v, w, r): tmp = 0 if (r <= 5.5e+23) or (not (r <= 4.2e+63) and ((r <= 2e+95) or (not (r <= 4.6e+123) and (r <= 5.2e+142)))): tmp = -1.5 + (2.0 / (r * r)) else: tmp = -0.25 * (r * (r * (w * w))) return tmp
function code(v, w, r) tmp = 0.0 if ((r <= 5.5e+23) || (!(r <= 4.2e+63) && ((r <= 2e+95) || (!(r <= 4.6e+123) && (r <= 5.2e+142))))) tmp = Float64(-1.5 + Float64(2.0 / Float64(r * r))); else tmp = Float64(-0.25 * Float64(r * Float64(r * Float64(w * w)))); end return tmp end
function tmp_2 = code(v, w, r) tmp = 0.0; if ((r <= 5.5e+23) || (~((r <= 4.2e+63)) && ((r <= 2e+95) || (~((r <= 4.6e+123)) && (r <= 5.2e+142))))) tmp = -1.5 + (2.0 / (r * r)); else tmp = -0.25 * (r * (r * (w * w))); end tmp_2 = tmp; end
code[v_, w_, r_] := If[Or[LessEqual[r, 5.5e+23], And[N[Not[LessEqual[r, 4.2e+63]], $MachinePrecision], Or[LessEqual[r, 2e+95], And[N[Not[LessEqual[r, 4.6e+123]], $MachinePrecision], LessEqual[r, 5.2e+142]]]]], N[(-1.5 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.25 * N[(r * N[(r * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 5.5 \cdot 10^{+23} \lor \neg \left(r \leq 4.2 \cdot 10^{+63}\right) \land \left(r \leq 2 \cdot 10^{+95} \lor \neg \left(r \leq 4.6 \cdot 10^{+123}\right) \land r \leq 5.2 \cdot 10^{+142}\right):\\
\;\;\;\;-1.5 + \frac{2}{r \cdot r}\\
\mathbf{else}:\\
\;\;\;\;-0.25 \cdot \left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right)\\
\end{array}
\end{array}
if r < 5.50000000000000004e23 or 4.2000000000000004e63 < r < 2.00000000000000004e95 or 4.59999999999999981e123 < r < 5.20000000000000043e142Initial program 82.9%
sub-neg82.9%
+-commutative82.9%
associate--l+82.9%
associate-/l*85.1%
distribute-neg-frac85.1%
associate-/r/85.1%
fma-def85.1%
sub-neg85.1%
Simplified80.8%
Taylor expanded in r around 0 71.4%
sub-neg71.4%
associate-*r/71.4%
metadata-eval71.4%
unpow271.4%
metadata-eval71.4%
Simplified71.4%
if 5.50000000000000004e23 < r < 4.2000000000000004e63 or 2.00000000000000004e95 < r < 4.59999999999999981e123 or 5.20000000000000043e142 < r Initial program 87.6%
sub-neg87.6%
+-commutative87.6%
associate--l+87.6%
associate-/l*97.4%
distribute-neg-frac97.4%
associate-/r/97.4%
fma-def97.4%
sub-neg97.4%
Simplified77.1%
Taylor expanded in r around inf 64.4%
Taylor expanded in v around inf 72.1%
*-commutative72.1%
unpow272.1%
*-commutative72.1%
unpow272.1%
swap-sqr85.3%
unpow285.3%
*-commutative85.3%
Simplified85.3%
unpow285.3%
*-commutative85.3%
*-commutative85.3%
unswap-sqr72.1%
associate-*l*82.5%
Applied egg-rr82.5%
Final simplification73.0%
(FPCore (v w r)
:precision binary64
(if (or (<= r 6.5e+22)
(and (not (<= r 1.15e+71))
(or (<= r 5.8e+98) (and (not (<= r 4.8e+123)) (<= r 3.1e+142)))))
(+ -1.5 (/ 2.0 (* r r)))
(* -0.25 (* (* r w) (* r w)))))
double code(double v, double w, double r) {
double tmp;
if ((r <= 6.5e+22) || (!(r <= 1.15e+71) && ((r <= 5.8e+98) || (!(r <= 4.8e+123) && (r <= 3.1e+142))))) {
tmp = -1.5 + (2.0 / (r * r));
} else {
tmp = -0.25 * ((r * w) * (r * w));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: tmp
if ((r <= 6.5d+22) .or. (.not. (r <= 1.15d+71)) .and. (r <= 5.8d+98) .or. (.not. (r <= 4.8d+123)) .and. (r <= 3.1d+142)) then
tmp = (-1.5d0) + (2.0d0 / (r * r))
else
tmp = (-0.25d0) * ((r * w) * (r * w))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double tmp;
if ((r <= 6.5e+22) || (!(r <= 1.15e+71) && ((r <= 5.8e+98) || (!(r <= 4.8e+123) && (r <= 3.1e+142))))) {
tmp = -1.5 + (2.0 / (r * r));
} else {
tmp = -0.25 * ((r * w) * (r * w));
}
return tmp;
}
def code(v, w, r): tmp = 0 if (r <= 6.5e+22) or (not (r <= 1.15e+71) and ((r <= 5.8e+98) or (not (r <= 4.8e+123) and (r <= 3.1e+142)))): tmp = -1.5 + (2.0 / (r * r)) else: tmp = -0.25 * ((r * w) * (r * w)) return tmp
function code(v, w, r) tmp = 0.0 if ((r <= 6.5e+22) || (!(r <= 1.15e+71) && ((r <= 5.8e+98) || (!(r <= 4.8e+123) && (r <= 3.1e+142))))) tmp = Float64(-1.5 + Float64(2.0 / Float64(r * r))); else tmp = Float64(-0.25 * Float64(Float64(r * w) * Float64(r * w))); end return tmp end
function tmp_2 = code(v, w, r) tmp = 0.0; if ((r <= 6.5e+22) || (~((r <= 1.15e+71)) && ((r <= 5.8e+98) || (~((r <= 4.8e+123)) && (r <= 3.1e+142))))) tmp = -1.5 + (2.0 / (r * r)); else tmp = -0.25 * ((r * w) * (r * w)); end tmp_2 = tmp; end
code[v_, w_, r_] := If[Or[LessEqual[r, 6.5e+22], And[N[Not[LessEqual[r, 1.15e+71]], $MachinePrecision], Or[LessEqual[r, 5.8e+98], And[N[Not[LessEqual[r, 4.8e+123]], $MachinePrecision], LessEqual[r, 3.1e+142]]]]], N[(-1.5 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.25 * N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 6.5 \cdot 10^{+22} \lor \neg \left(r \leq 1.15 \cdot 10^{+71}\right) \land \left(r \leq 5.8 \cdot 10^{+98} \lor \neg \left(r \leq 4.8 \cdot 10^{+123}\right) \land r \leq 3.1 \cdot 10^{+142}\right):\\
\;\;\;\;-1.5 + \frac{2}{r \cdot r}\\
\mathbf{else}:\\
\;\;\;\;-0.25 \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)\\
\end{array}
\end{array}
if r < 6.49999999999999979e22 or 1.1500000000000001e71 < r < 5.8000000000000002e98 or 4.79999999999999978e123 < r < 3.0999999999999999e142Initial program 82.8%
sub-neg82.8%
+-commutative82.8%
associate--l+82.8%
associate-/l*85.0%
distribute-neg-frac85.0%
associate-/r/85.0%
fma-def85.0%
sub-neg85.0%
Simplified80.7%
Taylor expanded in r around 0 71.5%
sub-neg71.5%
associate-*r/71.5%
metadata-eval71.5%
unpow271.5%
metadata-eval71.5%
Simplified71.5%
if 6.49999999999999979e22 < r < 1.1500000000000001e71 or 5.8000000000000002e98 < r < 4.79999999999999978e123 or 3.0999999999999999e142 < r Initial program 88.2%
sub-neg88.2%
+-commutative88.2%
associate--l+88.2%
associate-/l*97.5%
distribute-neg-frac97.5%
associate-/r/97.5%
fma-def97.5%
sub-neg97.5%
Simplified78.2%
Taylor expanded in r around inf 63.8%
Taylor expanded in v around inf 71.0%
*-commutative71.0%
unpow271.0%
*-commutative71.0%
unpow271.0%
swap-sqr83.6%
unpow283.6%
*-commutative83.6%
Simplified83.6%
unpow283.6%
*-commutative83.6%
*-commutative83.6%
Applied egg-rr83.6%
Final simplification73.4%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (+ -1.5 (/ 2.0 (* r r)))))
(if (<= r 1.18e+24)
t_0
(if (<= r 3.6e+62)
(* -0.25 (* (* r r) (* w w)))
(if (or (<= r 1.9e+95) (and (not (<= r 1.4e+123)) (<= r 3.1e+142)))
t_0
(* -0.25 (* r (* r (* w w)))))))))
double code(double v, double w, double r) {
double t_0 = -1.5 + (2.0 / (r * r));
double tmp;
if (r <= 1.18e+24) {
tmp = t_0;
} else if (r <= 3.6e+62) {
tmp = -0.25 * ((r * r) * (w * w));
} else if ((r <= 1.9e+95) || (!(r <= 1.4e+123) && (r <= 3.1e+142))) {
tmp = t_0;
} else {
tmp = -0.25 * (r * (r * (w * w)));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: tmp
t_0 = (-1.5d0) + (2.0d0 / (r * r))
if (r <= 1.18d+24) then
tmp = t_0
else if (r <= 3.6d+62) then
tmp = (-0.25d0) * ((r * r) * (w * w))
else if ((r <= 1.9d+95) .or. (.not. (r <= 1.4d+123)) .and. (r <= 3.1d+142)) then
tmp = t_0
else
tmp = (-0.25d0) * (r * (r * (w * w)))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = -1.5 + (2.0 / (r * r));
double tmp;
if (r <= 1.18e+24) {
tmp = t_0;
} else if (r <= 3.6e+62) {
tmp = -0.25 * ((r * r) * (w * w));
} else if ((r <= 1.9e+95) || (!(r <= 1.4e+123) && (r <= 3.1e+142))) {
tmp = t_0;
} else {
tmp = -0.25 * (r * (r * (w * w)));
}
return tmp;
}
def code(v, w, r): t_0 = -1.5 + (2.0 / (r * r)) tmp = 0 if r <= 1.18e+24: tmp = t_0 elif r <= 3.6e+62: tmp = -0.25 * ((r * r) * (w * w)) elif (r <= 1.9e+95) or (not (r <= 1.4e+123) and (r <= 3.1e+142)): tmp = t_0 else: tmp = -0.25 * (r * (r * (w * w))) return tmp
function code(v, w, r) t_0 = Float64(-1.5 + Float64(2.0 / Float64(r * r))) tmp = 0.0 if (r <= 1.18e+24) tmp = t_0; elseif (r <= 3.6e+62) tmp = Float64(-0.25 * Float64(Float64(r * r) * Float64(w * w))); elseif ((r <= 1.9e+95) || (!(r <= 1.4e+123) && (r <= 3.1e+142))) tmp = t_0; else tmp = Float64(-0.25 * Float64(r * Float64(r * Float64(w * w)))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = -1.5 + (2.0 / (r * r)); tmp = 0.0; if (r <= 1.18e+24) tmp = t_0; elseif (r <= 3.6e+62) tmp = -0.25 * ((r * r) * (w * w)); elseif ((r <= 1.9e+95) || (~((r <= 1.4e+123)) && (r <= 3.1e+142))) tmp = t_0; else tmp = -0.25 * (r * (r * (w * w))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(-1.5 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r, 1.18e+24], t$95$0, If[LessEqual[r, 3.6e+62], N[(-0.25 * N[(N[(r * r), $MachinePrecision] * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[r, 1.9e+95], And[N[Not[LessEqual[r, 1.4e+123]], $MachinePrecision], LessEqual[r, 3.1e+142]]], t$95$0, N[(-0.25 * N[(r * N[(r * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -1.5 + \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 1.18 \cdot 10^{+24}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;r \leq 3.6 \cdot 10^{+62}:\\
\;\;\;\;-0.25 \cdot \left(\left(r \cdot r\right) \cdot \left(w \cdot w\right)\right)\\
\mathbf{elif}\;r \leq 1.9 \cdot 10^{+95} \lor \neg \left(r \leq 1.4 \cdot 10^{+123}\right) \land r \leq 3.1 \cdot 10^{+142}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;-0.25 \cdot \left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right)\\
\end{array}
\end{array}
if r < 1.17999999999999997e24 or 3.6e62 < r < 1.9e95 or 1.40000000000000006e123 < r < 3.0999999999999999e142Initial program 82.9%
sub-neg82.9%
+-commutative82.9%
associate--l+82.9%
associate-/l*85.1%
distribute-neg-frac85.1%
associate-/r/85.1%
fma-def85.1%
sub-neg85.1%
Simplified80.8%
Taylor expanded in r around 0 71.4%
sub-neg71.4%
associate-*r/71.4%
metadata-eval71.4%
unpow271.4%
metadata-eval71.4%
Simplified71.4%
if 1.17999999999999997e24 < r < 3.6e62Initial program 99.2%
sub-neg99.2%
+-commutative99.2%
associate--l+99.2%
associate-/l*99.2%
distribute-neg-frac99.2%
associate-/r/99.2%
fma-def99.2%
sub-neg99.2%
Simplified100.0%
Taylor expanded in r around inf 51.7%
Taylor expanded in v around inf 100.0%
*-commutative100.0%
unpow2100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
if 1.9e95 < r < 1.40000000000000006e123 or 3.0999999999999999e142 < r Initial program 87.0%
sub-neg87.0%
+-commutative87.0%
associate--l+87.0%
associate-/l*97.3%
distribute-neg-frac97.3%
associate-/r/97.3%
fma-def97.3%
sub-neg97.3%
Simplified75.8%
Taylor expanded in r around inf 65.1%
Taylor expanded in v around inf 70.5%
*-commutative70.5%
unpow270.5%
*-commutative70.5%
unpow270.5%
swap-sqr84.4%
unpow284.4%
*-commutative84.4%
Simplified84.4%
unpow284.4%
*-commutative84.4%
*-commutative84.4%
unswap-sqr70.5%
associate-*l*81.6%
Applied egg-rr81.6%
Final simplification73.0%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (+ -1.5 (/ 2.0 (* r r)))) (t_1 (* -0.25 (* (* r w) (* r w)))))
(if (<= r 1.9e+23)
t_0
(if (<= r 1.25e+71)
t_1
(if (<= r 6e+95)
t_0
(if (<= r 4.8e+123)
(* -0.25 (* w (* w (* r r))))
(if (<= r 3.1e+142) t_0 t_1)))))))
double code(double v, double w, double r) {
double t_0 = -1.5 + (2.0 / (r * r));
double t_1 = -0.25 * ((r * w) * (r * w));
double tmp;
if (r <= 1.9e+23) {
tmp = t_0;
} else if (r <= 1.25e+71) {
tmp = t_1;
} else if (r <= 6e+95) {
tmp = t_0;
} else if (r <= 4.8e+123) {
tmp = -0.25 * (w * (w * (r * r)));
} else if (r <= 3.1e+142) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (-1.5d0) + (2.0d0 / (r * r))
t_1 = (-0.25d0) * ((r * w) * (r * w))
if (r <= 1.9d+23) then
tmp = t_0
else if (r <= 1.25d+71) then
tmp = t_1
else if (r <= 6d+95) then
tmp = t_0
else if (r <= 4.8d+123) then
tmp = (-0.25d0) * (w * (w * (r * r)))
else if (r <= 3.1d+142) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = -1.5 + (2.0 / (r * r));
double t_1 = -0.25 * ((r * w) * (r * w));
double tmp;
if (r <= 1.9e+23) {
tmp = t_0;
} else if (r <= 1.25e+71) {
tmp = t_1;
} else if (r <= 6e+95) {
tmp = t_0;
} else if (r <= 4.8e+123) {
tmp = -0.25 * (w * (w * (r * r)));
} else if (r <= 3.1e+142) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(v, w, r): t_0 = -1.5 + (2.0 / (r * r)) t_1 = -0.25 * ((r * w) * (r * w)) tmp = 0 if r <= 1.9e+23: tmp = t_0 elif r <= 1.25e+71: tmp = t_1 elif r <= 6e+95: tmp = t_0 elif r <= 4.8e+123: tmp = -0.25 * (w * (w * (r * r))) elif r <= 3.1e+142: tmp = t_0 else: tmp = t_1 return tmp
function code(v, w, r) t_0 = Float64(-1.5 + Float64(2.0 / Float64(r * r))) t_1 = Float64(-0.25 * Float64(Float64(r * w) * Float64(r * w))) tmp = 0.0 if (r <= 1.9e+23) tmp = t_0; elseif (r <= 1.25e+71) tmp = t_1; elseif (r <= 6e+95) tmp = t_0; elseif (r <= 4.8e+123) tmp = Float64(-0.25 * Float64(w * Float64(w * Float64(r * r)))); elseif (r <= 3.1e+142) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(v, w, r) t_0 = -1.5 + (2.0 / (r * r)); t_1 = -0.25 * ((r * w) * (r * w)); tmp = 0.0; if (r <= 1.9e+23) tmp = t_0; elseif (r <= 1.25e+71) tmp = t_1; elseif (r <= 6e+95) tmp = t_0; elseif (r <= 4.8e+123) tmp = -0.25 * (w * (w * (r * r))); elseif (r <= 3.1e+142) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(-1.5 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-0.25 * N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r, 1.9e+23], t$95$0, If[LessEqual[r, 1.25e+71], t$95$1, If[LessEqual[r, 6e+95], t$95$0, If[LessEqual[r, 4.8e+123], N[(-0.25 * N[(w * N[(w * N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[r, 3.1e+142], t$95$0, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -1.5 + \frac{2}{r \cdot r}\\
t_1 := -0.25 \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)\\
\mathbf{if}\;r \leq 1.9 \cdot 10^{+23}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;r \leq 1.25 \cdot 10^{+71}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;r \leq 6 \cdot 10^{+95}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;r \leq 4.8 \cdot 10^{+123}:\\
\;\;\;\;-0.25 \cdot \left(w \cdot \left(w \cdot \left(r \cdot r\right)\right)\right)\\
\mathbf{elif}\;r \leq 3.1 \cdot 10^{+142}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if r < 1.89999999999999987e23 or 1.24999999999999993e71 < r < 5.99999999999999982e95 or 4.79999999999999978e123 < r < 3.0999999999999999e142Initial program 82.8%
sub-neg82.8%
+-commutative82.8%
associate--l+82.8%
associate-/l*85.0%
distribute-neg-frac85.0%
associate-/r/85.0%
fma-def85.0%
sub-neg85.0%
Simplified80.7%
Taylor expanded in r around 0 71.5%
sub-neg71.5%
associate-*r/71.5%
metadata-eval71.5%
unpow271.5%
metadata-eval71.5%
Simplified71.5%
if 1.89999999999999987e23 < r < 1.24999999999999993e71 or 3.0999999999999999e142 < r Initial program 87.9%
sub-neg87.9%
+-commutative87.9%
associate--l+87.9%
associate-/l*96.8%
distribute-neg-frac96.8%
associate-/r/96.8%
fma-def96.8%
sub-neg96.8%
Simplified71.9%
Taylor expanded in r around inf 65.7%
Taylor expanded in v around inf 68.8%
*-commutative68.8%
unpow268.8%
*-commutative68.8%
unpow268.8%
swap-sqr85.0%
unpow285.0%
*-commutative85.0%
Simplified85.0%
unpow285.0%
*-commutative85.0%
*-commutative85.0%
Applied egg-rr85.0%
if 5.99999999999999982e95 < r < 4.79999999999999978e123Initial program 89.5%
sub-neg89.5%
+-commutative89.5%
associate--l+89.5%
associate-/l*100.0%
distribute-neg-frac100.0%
associate-/r/100.0%
fma-def100.0%
sub-neg100.0%
Simplified99.8%
Taylor expanded in r around inf 57.3%
Taylor expanded in v around inf 78.7%
*-commutative78.7%
unpow278.7%
*-commutative78.7%
unpow278.7%
swap-sqr78.6%
unpow278.6%
*-commutative78.6%
Simplified78.6%
unpow278.6%
*-commutative78.6%
*-commutative78.6%
unswap-sqr78.7%
associate-*r*79.0%
Applied egg-rr79.0%
Final simplification73.4%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (+ -1.5 (/ 2.0 (* r r)))))
(if (<= r 7.6e+23)
t_0
(if (<= r 3.8e+58)
(/ (* -0.375 (* (* r r) (* w w))) (- 1.0 v))
(if (<= r 3e+95)
t_0
(if (<= r 4.2e+123)
(* -0.25 (* w (* w (* r r))))
(if (<= r 9.2e+142) t_0 (* -0.25 (* (* r w) (* r w))))))))))
double code(double v, double w, double r) {
double t_0 = -1.5 + (2.0 / (r * r));
double tmp;
if (r <= 7.6e+23) {
tmp = t_0;
} else if (r <= 3.8e+58) {
tmp = (-0.375 * ((r * r) * (w * w))) / (1.0 - v);
} else if (r <= 3e+95) {
tmp = t_0;
} else if (r <= 4.2e+123) {
tmp = -0.25 * (w * (w * (r * r)));
} else if (r <= 9.2e+142) {
tmp = t_0;
} else {
tmp = -0.25 * ((r * w) * (r * w));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: tmp
t_0 = (-1.5d0) + (2.0d0 / (r * r))
if (r <= 7.6d+23) then
tmp = t_0
else if (r <= 3.8d+58) then
tmp = ((-0.375d0) * ((r * r) * (w * w))) / (1.0d0 - v)
else if (r <= 3d+95) then
tmp = t_0
else if (r <= 4.2d+123) then
tmp = (-0.25d0) * (w * (w * (r * r)))
else if (r <= 9.2d+142) then
tmp = t_0
else
tmp = (-0.25d0) * ((r * w) * (r * w))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = -1.5 + (2.0 / (r * r));
double tmp;
if (r <= 7.6e+23) {
tmp = t_0;
} else if (r <= 3.8e+58) {
tmp = (-0.375 * ((r * r) * (w * w))) / (1.0 - v);
} else if (r <= 3e+95) {
tmp = t_0;
} else if (r <= 4.2e+123) {
tmp = -0.25 * (w * (w * (r * r)));
} else if (r <= 9.2e+142) {
tmp = t_0;
} else {
tmp = -0.25 * ((r * w) * (r * w));
}
return tmp;
}
def code(v, w, r): t_0 = -1.5 + (2.0 / (r * r)) tmp = 0 if r <= 7.6e+23: tmp = t_0 elif r <= 3.8e+58: tmp = (-0.375 * ((r * r) * (w * w))) / (1.0 - v) elif r <= 3e+95: tmp = t_0 elif r <= 4.2e+123: tmp = -0.25 * (w * (w * (r * r))) elif r <= 9.2e+142: tmp = t_0 else: tmp = -0.25 * ((r * w) * (r * w)) return tmp
function code(v, w, r) t_0 = Float64(-1.5 + Float64(2.0 / Float64(r * r))) tmp = 0.0 if (r <= 7.6e+23) tmp = t_0; elseif (r <= 3.8e+58) tmp = Float64(Float64(-0.375 * Float64(Float64(r * r) * Float64(w * w))) / Float64(1.0 - v)); elseif (r <= 3e+95) tmp = t_0; elseif (r <= 4.2e+123) tmp = Float64(-0.25 * Float64(w * Float64(w * Float64(r * r)))); elseif (r <= 9.2e+142) tmp = t_0; else tmp = Float64(-0.25 * Float64(Float64(r * w) * Float64(r * w))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = -1.5 + (2.0 / (r * r)); tmp = 0.0; if (r <= 7.6e+23) tmp = t_0; elseif (r <= 3.8e+58) tmp = (-0.375 * ((r * r) * (w * w))) / (1.0 - v); elseif (r <= 3e+95) tmp = t_0; elseif (r <= 4.2e+123) tmp = -0.25 * (w * (w * (r * r))); elseif (r <= 9.2e+142) tmp = t_0; else tmp = -0.25 * ((r * w) * (r * w)); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(-1.5 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r, 7.6e+23], t$95$0, If[LessEqual[r, 3.8e+58], N[(N[(-0.375 * N[(N[(r * r), $MachinePrecision] * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision], If[LessEqual[r, 3e+95], t$95$0, If[LessEqual[r, 4.2e+123], N[(-0.25 * N[(w * N[(w * N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[r, 9.2e+142], t$95$0, N[(-0.25 * N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -1.5 + \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 7.6 \cdot 10^{+23}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;r \leq 3.8 \cdot 10^{+58}:\\
\;\;\;\;\frac{-0.375 \cdot \left(\left(r \cdot r\right) \cdot \left(w \cdot w\right)\right)}{1 - v}\\
\mathbf{elif}\;r \leq 3 \cdot 10^{+95}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;r \leq 4.2 \cdot 10^{+123}:\\
\;\;\;\;-0.25 \cdot \left(w \cdot \left(w \cdot \left(r \cdot r\right)\right)\right)\\
\mathbf{elif}\;r \leq 9.2 \cdot 10^{+142}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;-0.25 \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)\\
\end{array}
\end{array}
if r < 7.5999999999999995e23 or 3.7999999999999999e58 < r < 2.99999999999999991e95 or 4.19999999999999988e123 < r < 9.20000000000000009e142Initial program 82.9%
sub-neg82.9%
+-commutative82.9%
associate--l+82.9%
associate-/l*85.1%
distribute-neg-frac85.1%
associate-/r/85.1%
fma-def85.1%
sub-neg85.1%
Simplified80.8%
Taylor expanded in r around 0 71.4%
sub-neg71.4%
associate-*r/71.4%
metadata-eval71.4%
unpow271.4%
metadata-eval71.4%
Simplified71.4%
if 7.5999999999999995e23 < r < 3.7999999999999999e58Initial program 99.2%
sub-neg99.2%
+-commutative99.2%
associate--l+99.2%
associate-/l*99.2%
distribute-neg-frac99.2%
associate-/r/99.2%
fma-def99.2%
sub-neg99.2%
Simplified100.0%
Taylor expanded in r around inf 51.7%
Taylor expanded in v around 0 51.1%
*-commutative51.1%
unpow251.1%
*-commutative51.1%
unpow251.1%
Simplified51.1%
if 2.99999999999999991e95 < r < 4.19999999999999988e123Initial program 89.5%
sub-neg89.5%
+-commutative89.5%
associate--l+89.5%
associate-/l*100.0%
distribute-neg-frac100.0%
associate-/r/100.0%
fma-def100.0%
sub-neg100.0%
Simplified99.8%
Taylor expanded in r around inf 57.3%
Taylor expanded in v around inf 78.7%
*-commutative78.7%
unpow278.7%
*-commutative78.7%
unpow278.7%
swap-sqr78.6%
unpow278.6%
*-commutative78.6%
Simplified78.6%
unpow278.6%
*-commutative78.6%
*-commutative78.6%
unswap-sqr78.7%
associate-*r*79.0%
Applied egg-rr79.0%
if 9.20000000000000009e142 < r Initial program 86.1%
sub-neg86.1%
+-commutative86.1%
associate--l+86.1%
associate-/l*96.4%
distribute-neg-frac96.4%
associate-/r/96.4%
fma-def96.4%
sub-neg96.4%
Simplified67.8%
Taylor expanded in r around inf 67.8%
Taylor expanded in v around inf 67.8%
*-commutative67.8%
unpow267.8%
*-commutative67.8%
unpow267.8%
swap-sqr86.4%
unpow286.4%
*-commutative86.4%
Simplified86.4%
unpow286.4%
*-commutative86.4%
*-commutative86.4%
Applied egg-rr86.4%
Final simplification73.1%
(FPCore (v w r) :precision binary64 (+ (/ 2.0 (* r r)) -4.5))
double code(double v, double w, double r) {
return (2.0 / (r * r)) + -4.5;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
code = (2.0d0 / (r * r)) + (-4.5d0)
end function
public static double code(double v, double w, double r) {
return (2.0 / (r * r)) + -4.5;
}
def code(v, w, r): return (2.0 / (r * r)) + -4.5
function code(v, w, r) return Float64(Float64(2.0 / Float64(r * r)) + -4.5) end
function tmp = code(v, w, r) tmp = (2.0 / (r * r)) + -4.5; end
code[v_, w_, r_] := N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + -4.5), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{r \cdot r} + -4.5
\end{array}
Initial program 83.6%
sub-neg83.6%
associate-/l*86.9%
cancel-sign-sub-inv86.9%
metadata-eval86.9%
*-commutative86.9%
*-commutative86.9%
metadata-eval86.9%
Simplified86.9%
Taylor expanded in v around 0 69.6%
unpow269.6%
unpow269.6%
Simplified69.6%
add-sqr-sqrt69.6%
sqrt-div69.6%
metadata-eval69.6%
unswap-sqr69.6%
*-commutative69.6%
*-commutative69.6%
sqrt-prod39.1%
add-sqr-sqrt59.9%
sqrt-div59.9%
metadata-eval59.9%
unswap-sqr70.6%
*-commutative70.6%
*-commutative70.6%
sqrt-prod44.4%
add-sqr-sqrt81.9%
Applied egg-rr81.9%
un-div-inv81.9%
Applied egg-rr81.9%
Taylor expanded in r around 0 50.9%
unpow250.9%
Simplified50.9%
Final simplification50.9%
(FPCore (v w r) :precision binary64 (+ -1.5 (/ 2.0 (* r r))))
double code(double v, double w, double r) {
return -1.5 + (2.0 / (r * r));
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
code = (-1.5d0) + (2.0d0 / (r * r))
end function
public static double code(double v, double w, double r) {
return -1.5 + (2.0 / (r * r));
}
def code(v, w, r): return -1.5 + (2.0 / (r * r))
function code(v, w, r) return Float64(-1.5 + Float64(2.0 / Float64(r * r))) end
function tmp = code(v, w, r) tmp = -1.5 + (2.0 / (r * r)); end
code[v_, w_, r_] := N[(-1.5 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-1.5 + \frac{2}{r \cdot r}
\end{array}
Initial program 83.6%
sub-neg83.6%
+-commutative83.6%
associate--l+83.6%
associate-/l*86.9%
distribute-neg-frac86.9%
associate-/r/86.9%
fma-def86.9%
sub-neg86.9%
Simplified80.3%
Taylor expanded in r around 0 63.2%
sub-neg63.2%
associate-*r/63.2%
metadata-eval63.2%
unpow263.2%
metadata-eval63.2%
Simplified63.2%
Final simplification63.2%
(FPCore (v w r) :precision binary64 (/ 2.0 (* r r)))
double code(double v, double w, double r) {
return 2.0 / (r * r);
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
code = 2.0d0 / (r * r)
end function
public static double code(double v, double w, double r) {
return 2.0 / (r * r);
}
def code(v, w, r): return 2.0 / (r * r)
function code(v, w, r) return Float64(2.0 / Float64(r * r)) end
function tmp = code(v, w, r) tmp = 2.0 / (r * r); end
code[v_, w_, r_] := N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{r \cdot r}
\end{array}
Initial program 83.6%
sub-neg83.6%
associate-/l*86.9%
cancel-sign-sub-inv86.9%
metadata-eval86.9%
*-commutative86.9%
*-commutative86.9%
metadata-eval86.9%
Simplified86.9%
Taylor expanded in v around 0 76.7%
*-commutative76.7%
*-commutative76.7%
unpow276.7%
unpow276.7%
swap-sqr93.2%
unpow293.2%
*-commutative93.2%
Simplified93.2%
Taylor expanded in r around 0 47.8%
unpow247.8%
Simplified47.8%
Final simplification47.8%
herbie shell --seed 2023200
(FPCore (v w r)
:name "Rosa's TurbineBenchmark"
:precision binary64
(- (- (+ 3.0 (/ 2.0 (* r r))) (/ (* (* 0.125 (- 3.0 (* 2.0 v))) (* (* (* w w) r) r)) (- 1.0 v))) 4.5))