
(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 16 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}
NOTE: r should be positive before calling this function
(FPCore (v w r)
:precision binary64
(if (<= r 2e+140)
(+
(fma 2.0 (pow r -2.0) -1.5)
(* (/ (fma v 0.25 -0.375) (- 1.0 v)) (* w (* w (* r r)))))
(+
(/ 2.0 (* r r))
(- -1.5 (* r (* (* w (* r w)) (/ (+ 0.375 (* v -0.25)) (- 1.0 v))))))))r = abs(r);
double code(double v, double w, double r) {
double tmp;
if (r <= 2e+140) {
tmp = fma(2.0, pow(r, -2.0), -1.5) + ((fma(v, 0.25, -0.375) / (1.0 - v)) * (w * (w * (r * r))));
} else {
tmp = (2.0 / (r * r)) + (-1.5 - (r * ((w * (r * w)) * ((0.375 + (v * -0.25)) / (1.0 - v)))));
}
return tmp;
}
r = abs(r) function code(v, w, r) tmp = 0.0 if (r <= 2e+140) tmp = Float64(fma(2.0, (r ^ -2.0), -1.5) + Float64(Float64(fma(v, 0.25, -0.375) / Float64(1.0 - v)) * Float64(w * Float64(w * Float64(r * r))))); else tmp = Float64(Float64(2.0 / Float64(r * r)) + Float64(-1.5 - Float64(r * Float64(Float64(w * Float64(r * w)) * Float64(Float64(0.375 + Float64(v * -0.25)) / Float64(1.0 - v)))))); end return tmp end
NOTE: r should be positive before calling this function code[v_, w_, r_] := If[LessEqual[r, 2e+140], N[(N[(2.0 * N[Power[r, -2.0], $MachinePrecision] + -1.5), $MachinePrecision] + N[(N[(N[(v * 0.25 + -0.375), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision] * N[(w * N[(w * N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + N[(-1.5 - N[(r * N[(N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision] * N[(N[(0.375 + N[(v * -0.25), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
r = |r|\\
\\
\begin{array}{l}
\mathbf{if}\;r \leq 2 \cdot 10^{+140}:\\
\;\;\;\;\mathsf{fma}\left(2, {r}^{-2}, -1.5\right) + \frac{\mathsf{fma}\left(v, 0.25, -0.375\right)}{1 - v} \cdot \left(w \cdot \left(w \cdot \left(r \cdot r\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{r \cdot r} + \left(-1.5 - r \cdot \left(\left(w \cdot \left(r \cdot w\right)\right) \cdot \frac{0.375 + v \cdot -0.25}{1 - v}\right)\right)\\
\end{array}
\end{array}
if r < 2.00000000000000012e140Initial program 88.5%
sub-neg88.5%
+-commutative88.5%
associate--l+88.5%
associate-/l*90.0%
distribute-neg-frac90.0%
associate-/r/90.0%
fma-def90.0%
sub-neg90.0%
Simplified84.7%
fma-udef84.7%
unswap-sqr99.8%
pow299.8%
div-inv99.8%
fma-def99.8%
pow299.8%
pow-flip99.8%
metadata-eval99.8%
Applied egg-rr99.8%
unpow299.8%
unswap-sqr84.8%
associate-*r*92.4%
Applied egg-rr92.4%
if 2.00000000000000012e140 < r Initial program 91.1%
associate--l-91.1%
+-commutative91.1%
associate--l+91.1%
+-commutative91.1%
associate--r+91.1%
metadata-eval91.1%
associate-*l/91.1%
*-commutative91.1%
*-commutative91.1%
*-commutative91.1%
Simplified91.1%
Taylor expanded in r around 0 91.1%
unpow291.1%
*-commutative91.1%
associate-*r*99.9%
*-commutative99.9%
Simplified99.9%
pow199.9%
associate-*l*99.9%
associate-*l*99.9%
Applied egg-rr99.9%
Final simplification93.6%
NOTE: r should be positive before calling this function (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)))
r = abs(r);
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);
}
r = abs(r) 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
NOTE: r should be positive before calling this function 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}
r = |r|\\
\\
\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 88.9%
sub-neg88.9%
+-commutative88.9%
associate--l+88.9%
associate-/l*90.2%
distribute-neg-frac90.2%
associate-/r/90.2%
fma-def90.2%
sub-neg90.2%
Simplified83.0%
fma-udef83.0%
unswap-sqr99.8%
pow299.8%
div-inv99.8%
fma-def99.8%
pow299.8%
pow-flip99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Final simplification99.8%
NOTE: r should be positive before calling this function
(FPCore (v w r)
:precision binary64
(-
(-
(+ 3.0 (/ 2.0 (* r r)))
(pow
(cbrt (/ (* 0.125 (+ 3.0 (* v -2.0))) (/ (- 1.0 v) (pow (* r w) 2.0))))
3.0))
4.5))r = abs(r);
double code(double v, double w, double r) {
return ((3.0 + (2.0 / (r * r))) - pow(cbrt(((0.125 * (3.0 + (v * -2.0))) / ((1.0 - v) / pow((r * w), 2.0)))), 3.0)) - 4.5;
}
r = Math.abs(r);
public static double code(double v, double w, double r) {
return ((3.0 + (2.0 / (r * r))) - Math.pow(Math.cbrt(((0.125 * (3.0 + (v * -2.0))) / ((1.0 - v) / Math.pow((r * w), 2.0)))), 3.0)) - 4.5;
}
r = abs(r) function code(v, w, r) return Float64(Float64(Float64(3.0 + Float64(2.0 / Float64(r * r))) - (cbrt(Float64(Float64(0.125 * Float64(3.0 + Float64(v * -2.0))) / Float64(Float64(1.0 - v) / (Float64(r * w) ^ 2.0)))) ^ 3.0)) - 4.5) end
NOTE: r should be positive before calling this function code[v_, w_, r_] := N[(N[(N[(3.0 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Power[N[Power[N[(N[(0.125 * N[(3.0 + N[(v * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 - v), $MachinePrecision] / N[Power[N[(r * w), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision]
\begin{array}{l}
r = |r|\\
\\
\left(\left(3 + \frac{2}{r \cdot r}\right) - {\left(\sqrt[3]{\frac{0.125 \cdot \left(3 + v \cdot -2\right)}{\frac{1 - v}{{\left(r \cdot w\right)}^{2}}}}\right)}^{3}\right) - 4.5
\end{array}
Initial program 88.9%
add-cube-cbrt88.8%
pow388.8%
associate-/l*90.0%
cancel-sign-sub-inv90.0%
metadata-eval90.0%
associate-*l*82.9%
*-commutative82.9%
unswap-sqr99.6%
pow299.6%
Applied egg-rr99.6%
Final simplification99.6%
NOTE: r should be positive before calling this function
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= r 2e-108)
(+ t_0 (- -1.5 (* 0.25 (pow (* r w) 2.0))))
(+
t_0
(- -1.5 (* (/ (+ 0.375 (* v -0.25)) (- 1.0 v)) (* r (* w (* r w)))))))))r = abs(r);
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 2e-108) {
tmp = t_0 + (-1.5 - (0.25 * pow((r * w), 2.0)));
} else {
tmp = t_0 + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (w * (r * w)))));
}
return tmp;
}
NOTE: r should be positive before calling this function
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 <= 2d-108) then
tmp = t_0 + ((-1.5d0) - (0.25d0 * ((r * w) ** 2.0d0)))
else
tmp = t_0 + ((-1.5d0) - (((0.375d0 + (v * (-0.25d0))) / (1.0d0 - v)) * (r * (w * (r * w)))))
end if
code = tmp
end function
r = Math.abs(r);
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 2e-108) {
tmp = t_0 + (-1.5 - (0.25 * Math.pow((r * w), 2.0)));
} else {
tmp = t_0 + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (w * (r * w)))));
}
return tmp;
}
r = abs(r) def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if r <= 2e-108: tmp = t_0 + (-1.5 - (0.25 * math.pow((r * w), 2.0))) else: tmp = t_0 + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (w * (r * w))))) return tmp
r = abs(r) function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (r <= 2e-108) tmp = Float64(t_0 + Float64(-1.5 - Float64(0.25 * (Float64(r * w) ^ 2.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(w * Float64(r * w)))))); end return tmp end
r = abs(r) function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (r <= 2e-108) tmp = t_0 + (-1.5 - (0.25 * ((r * w) ^ 2.0))); else tmp = t_0 + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (w * (r * w))))); end tmp_2 = tmp; end
NOTE: r should be positive before calling this function
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r, 2e-108], N[(t$95$0 + N[(-1.5 - N[(0.25 * N[Power[N[(r * w), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
r = |r|\\
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 2 \cdot 10^{-108}:\\
\;\;\;\;t_0 + \left(-1.5 - 0.25 \cdot {\left(r \cdot w\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - \frac{0.375 + v \cdot -0.25}{1 - v} \cdot \left(r \cdot \left(w \cdot \left(r \cdot w\right)\right)\right)\right)\\
\end{array}
\end{array}
if r < 2.00000000000000008e-108Initial program 86.4%
associate--l-86.4%
+-commutative86.4%
associate--l+86.4%
+-commutative86.4%
associate--r+86.4%
metadata-eval86.4%
associate-*l/86.6%
*-commutative86.6%
*-commutative86.6%
*-commutative86.6%
Simplified86.6%
Taylor expanded in v around inf 76.0%
*-commutative76.0%
unpow276.0%
*-commutative76.0%
unpow276.0%
swap-sqr92.6%
unpow292.6%
*-commutative92.6%
Simplified92.6%
if 2.00000000000000008e-108 < r Initial program 93.1%
associate--l-93.1%
+-commutative93.1%
associate--l+93.1%
+-commutative93.1%
associate--r+93.1%
metadata-eval93.1%
associate-*l/96.0%
*-commutative96.0%
*-commutative96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in r around 0 96.0%
unpow296.0%
*-commutative96.0%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
Final simplification95.4%
NOTE: r should be positive before calling this function
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= r 2.4e-108)
(+ t_0 (- -1.5 (* 0.25 (pow (* r w) 2.0))))
(+
t_0
(- -1.5 (* r (* (* w (* r w)) (/ (+ 0.375 (* v -0.25)) (- 1.0 v)))))))))r = abs(r);
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 2.4e-108) {
tmp = t_0 + (-1.5 - (0.25 * pow((r * w), 2.0)));
} else {
tmp = t_0 + (-1.5 - (r * ((w * (r * w)) * ((0.375 + (v * -0.25)) / (1.0 - v)))));
}
return tmp;
}
NOTE: r should be positive before calling this function
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.4d-108) then
tmp = t_0 + ((-1.5d0) - (0.25d0 * ((r * w) ** 2.0d0)))
else
tmp = t_0 + ((-1.5d0) - (r * ((w * (r * w)) * ((0.375d0 + (v * (-0.25d0))) / (1.0d0 - v)))))
end if
code = tmp
end function
r = Math.abs(r);
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 2.4e-108) {
tmp = t_0 + (-1.5 - (0.25 * Math.pow((r * w), 2.0)));
} else {
tmp = t_0 + (-1.5 - (r * ((w * (r * w)) * ((0.375 + (v * -0.25)) / (1.0 - v)))));
}
return tmp;
}
r = abs(r) def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if r <= 2.4e-108: tmp = t_0 + (-1.5 - (0.25 * math.pow((r * w), 2.0))) else: tmp = t_0 + (-1.5 - (r * ((w * (r * w)) * ((0.375 + (v * -0.25)) / (1.0 - v))))) return tmp
r = abs(r) function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (r <= 2.4e-108) tmp = Float64(t_0 + Float64(-1.5 - Float64(0.25 * (Float64(r * w) ^ 2.0)))); else tmp = Float64(t_0 + Float64(-1.5 - Float64(r * Float64(Float64(w * Float64(r * w)) * Float64(Float64(0.375 + Float64(v * -0.25)) / Float64(1.0 - v)))))); end return tmp end
r = abs(r) function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (r <= 2.4e-108) tmp = t_0 + (-1.5 - (0.25 * ((r * w) ^ 2.0))); else tmp = t_0 + (-1.5 - (r * ((w * (r * w)) * ((0.375 + (v * -0.25)) / (1.0 - v))))); end tmp_2 = tmp; end
NOTE: r should be positive before calling this function
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r, 2.4e-108], N[(t$95$0 + N[(-1.5 - N[(0.25 * N[Power[N[(r * w), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(-1.5 - N[(r * N[(N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision] * N[(N[(0.375 + N[(v * -0.25), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
r = |r|\\
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 2.4 \cdot 10^{-108}:\\
\;\;\;\;t_0 + \left(-1.5 - 0.25 \cdot {\left(r \cdot w\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - r \cdot \left(\left(w \cdot \left(r \cdot w\right)\right) \cdot \frac{0.375 + v \cdot -0.25}{1 - v}\right)\right)\\
\end{array}
\end{array}
if r < 2.40000000000000017e-108Initial program 86.4%
associate--l-86.4%
+-commutative86.4%
associate--l+86.4%
+-commutative86.4%
associate--r+86.4%
metadata-eval86.4%
associate-*l/86.6%
*-commutative86.6%
*-commutative86.6%
*-commutative86.6%
Simplified86.6%
Taylor expanded in v around inf 76.0%
*-commutative76.0%
unpow276.0%
*-commutative76.0%
unpow276.0%
swap-sqr92.6%
unpow292.6%
*-commutative92.6%
Simplified92.6%
if 2.40000000000000017e-108 < r Initial program 93.1%
associate--l-93.1%
+-commutative93.1%
associate--l+93.1%
+-commutative93.1%
associate--r+93.1%
metadata-eval93.1%
associate-*l/96.0%
*-commutative96.0%
*-commutative96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in r around 0 96.0%
unpow296.0%
*-commutative96.0%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
pow199.8%
associate-*l*99.8%
associate-*l*99.8%
Applied egg-rr99.8%
Final simplification95.4%
NOTE: r should be positive before calling this function
(FPCore (v w r)
:precision binary64
(if (<= r 4.3e-117)
(* 2.0 (pow r -2.0))
(+
(/ 2.0 (* r r))
(- -1.5 (* (/ (+ 0.375 (* v -0.25)) (- 1.0 v)) (* r (* w (* r w))))))))r = abs(r);
double code(double v, double w, double r) {
double tmp;
if (r <= 4.3e-117) {
tmp = 2.0 * pow(r, -2.0);
} else {
tmp = (2.0 / (r * r)) + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (w * (r * w)))));
}
return tmp;
}
NOTE: r should be positive before calling this function
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 <= 4.3d-117) then
tmp = 2.0d0 * (r ** (-2.0d0))
else
tmp = (2.0d0 / (r * r)) + ((-1.5d0) - (((0.375d0 + (v * (-0.25d0))) / (1.0d0 - v)) * (r * (w * (r * w)))))
end if
code = tmp
end function
r = Math.abs(r);
public static double code(double v, double w, double r) {
double tmp;
if (r <= 4.3e-117) {
tmp = 2.0 * Math.pow(r, -2.0);
} else {
tmp = (2.0 / (r * r)) + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (w * (r * w)))));
}
return tmp;
}
r = abs(r) def code(v, w, r): tmp = 0 if r <= 4.3e-117: tmp = 2.0 * math.pow(r, -2.0) else: tmp = (2.0 / (r * r)) + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (w * (r * w))))) return tmp
r = abs(r) function code(v, w, r) tmp = 0.0 if (r <= 4.3e-117) tmp = Float64(2.0 * (r ^ -2.0)); else tmp = Float64(Float64(2.0 / Float64(r * r)) + Float64(-1.5 - Float64(Float64(Float64(0.375 + Float64(v * -0.25)) / Float64(1.0 - v)) * Float64(r * Float64(w * Float64(r * w)))))); end return tmp end
r = abs(r) function tmp_2 = code(v, w, r) tmp = 0.0; if (r <= 4.3e-117) tmp = 2.0 * (r ^ -2.0); else tmp = (2.0 / (r * r)) + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (w * (r * w))))); end tmp_2 = tmp; end
NOTE: r should be positive before calling this function code[v_, w_, r_] := If[LessEqual[r, 4.3e-117], N[(2.0 * N[Power[r, -2.0], $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + N[(-1.5 - N[(N[(N[(0.375 + N[(v * -0.25), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision] * N[(r * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
r = |r|\\
\\
\begin{array}{l}
\mathbf{if}\;r \leq 4.3 \cdot 10^{-117}:\\
\;\;\;\;2 \cdot {r}^{-2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{r \cdot r} + \left(-1.5 - \frac{0.375 + v \cdot -0.25}{1 - v} \cdot \left(r \cdot \left(w \cdot \left(r \cdot w\right)\right)\right)\right)\\
\end{array}
\end{array}
if r < 4.3e-117Initial program 86.2%
sub-neg86.2%
+-commutative86.2%
associate--l+86.2%
associate-/l*86.4%
distribute-neg-frac86.4%
associate-/r/86.5%
fma-def86.5%
sub-neg86.5%
Simplified79.3%
fma-udef79.3%
unswap-sqr99.8%
pow299.8%
div-inv99.8%
fma-def99.8%
pow299.8%
pow-flip99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in r around 0 55.0%
unpow255.0%
Simplified55.0%
expm1-log1p-u85.2%
expm1-udef85.2%
div-inv85.2%
pow285.2%
pow-flip85.2%
metadata-eval85.2%
Applied egg-rr53.6%
expm1-def85.2%
expm1-log1p86.5%
Simplified55.0%
if 4.3e-117 < r Initial program 93.3%
associate--l-93.3%
+-commutative93.3%
associate--l+93.3%
+-commutative93.3%
associate--r+93.3%
metadata-eval93.3%
associate-*l/96.1%
*-commutative96.1%
*-commutative96.1%
*-commutative96.1%
Simplified96.1%
Taylor expanded in r around 0 96.1%
unpow296.1%
*-commutative96.1%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
Final simplification72.4%
NOTE: r should be positive before calling this function
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= r 2e-115)
t_0
(+
t_0
(- -1.5 (* (/ (+ 0.375 (* v -0.25)) (- 1.0 v)) (* r (* r (* w w)))))))))r = abs(r);
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 2e-115) {
tmp = t_0;
} else {
tmp = t_0 + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (r * (w * w)))));
}
return tmp;
}
NOTE: r should be positive before calling this function
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 <= 2d-115) 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
r = Math.abs(r);
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 2e-115) {
tmp = t_0;
} else {
tmp = t_0 + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (r * (w * w)))));
}
return tmp;
}
r = abs(r) def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if r <= 2e-115: tmp = t_0 else: tmp = t_0 + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (r * (w * w))))) return tmp
r = abs(r) function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (r <= 2e-115) 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
r = abs(r) function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (r <= 2e-115) 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
NOTE: r should be positive before calling this function
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r, 2e-115], 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}
r = |r|\\
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 2 \cdot 10^{-115}:\\
\;\;\;\;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.0000000000000001e-115Initial program 86.2%
sub-neg86.2%
+-commutative86.2%
associate--l+86.2%
associate-/l*86.4%
distribute-neg-frac86.4%
associate-/r/86.5%
fma-def86.5%
sub-neg86.5%
Simplified79.3%
fma-udef79.3%
unswap-sqr99.8%
pow299.8%
div-inv99.8%
fma-def99.8%
pow299.8%
pow-flip99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in r around 0 55.0%
unpow255.0%
Simplified55.0%
if 2.0000000000000001e-115 < r Initial program 93.3%
associate--l-93.3%
+-commutative93.3%
associate--l+93.3%
+-commutative93.3%
associate--r+93.3%
metadata-eval93.3%
associate-*l/96.1%
*-commutative96.1%
*-commutative96.1%
*-commutative96.1%
Simplified96.1%
Final simplification70.9%
NOTE: r should be positive before calling this function
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= r 2.2e-116)
t_0
(+
t_0
(- -1.5 (* (/ (+ 0.375 (* v -0.25)) (- 1.0 v)) (* r (* w (* r w)))))))))r = abs(r);
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 2.2e-116) {
tmp = t_0;
} else {
tmp = t_0 + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (w * (r * w)))));
}
return tmp;
}
NOTE: r should be positive before calling this function
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-116) then
tmp = t_0
else
tmp = t_0 + ((-1.5d0) - (((0.375d0 + (v * (-0.25d0))) / (1.0d0 - v)) * (r * (w * (r * w)))))
end if
code = tmp
end function
r = Math.abs(r);
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 2.2e-116) {
tmp = t_0;
} else {
tmp = t_0 + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (w * (r * w)))));
}
return tmp;
}
r = abs(r) def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if r <= 2.2e-116: tmp = t_0 else: tmp = t_0 + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (w * (r * w))))) return tmp
r = abs(r) function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (r <= 2.2e-116) 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(w * Float64(r * w)))))); end return tmp end
r = abs(r) function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (r <= 2.2e-116) tmp = t_0; else tmp = t_0 + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (w * (r * w))))); end tmp_2 = tmp; end
NOTE: r should be positive before calling this function
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r, 2.2e-116], 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[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
r = |r|\\
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 2.2 \cdot 10^{-116}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - \frac{0.375 + v \cdot -0.25}{1 - v} \cdot \left(r \cdot \left(w \cdot \left(r \cdot w\right)\right)\right)\right)\\
\end{array}
\end{array}
if r < 2.2000000000000001e-116Initial program 86.2%
sub-neg86.2%
+-commutative86.2%
associate--l+86.2%
associate-/l*86.4%
distribute-neg-frac86.4%
associate-/r/86.5%
fma-def86.5%
sub-neg86.5%
Simplified79.3%
fma-udef79.3%
unswap-sqr99.8%
pow299.8%
div-inv99.8%
fma-def99.8%
pow299.8%
pow-flip99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in r around 0 55.0%
unpow255.0%
Simplified55.0%
if 2.2000000000000001e-116 < r Initial program 93.3%
associate--l-93.3%
+-commutative93.3%
associate--l+93.3%
+-commutative93.3%
associate--r+93.3%
metadata-eval93.3%
associate-*l/96.1%
*-commutative96.1%
*-commutative96.1%
*-commutative96.1%
Simplified96.1%
Taylor expanded in r around 0 96.1%
unpow296.1%
*-commutative96.1%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
Final simplification72.3%
NOTE: r should be positive before calling this function
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= r 7.2e-116)
t_0
(if (<= r 3e+152)
(+ t_0 (- (* (* r r) (* -0.25 (* w w))) 1.5))
(* -0.25 (* (* r w) (* r w)))))))r = abs(r);
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 7.2e-116) {
tmp = t_0;
} else if (r <= 3e+152) {
tmp = t_0 + (((r * r) * (-0.25 * (w * w))) - 1.5);
} else {
tmp = -0.25 * ((r * w) * (r * w));
}
return tmp;
}
NOTE: r should be positive before calling this function
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 <= 7.2d-116) then
tmp = t_0
else if (r <= 3d+152) then
tmp = t_0 + (((r * r) * ((-0.25d0) * (w * w))) - 1.5d0)
else
tmp = (-0.25d0) * ((r * w) * (r * w))
end if
code = tmp
end function
r = Math.abs(r);
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 7.2e-116) {
tmp = t_0;
} else if (r <= 3e+152) {
tmp = t_0 + (((r * r) * (-0.25 * (w * w))) - 1.5);
} else {
tmp = -0.25 * ((r * w) * (r * w));
}
return tmp;
}
r = abs(r) def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if r <= 7.2e-116: tmp = t_0 elif r <= 3e+152: tmp = t_0 + (((r * r) * (-0.25 * (w * w))) - 1.5) else: tmp = -0.25 * ((r * w) * (r * w)) return tmp
r = abs(r) function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (r <= 7.2e-116) tmp = t_0; elseif (r <= 3e+152) tmp = Float64(t_0 + Float64(Float64(Float64(r * r) * Float64(-0.25 * Float64(w * w))) - 1.5)); else tmp = Float64(-0.25 * Float64(Float64(r * w) * Float64(r * w))); end return tmp end
r = abs(r) function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (r <= 7.2e-116) tmp = t_0; elseif (r <= 3e+152) tmp = t_0 + (((r * r) * (-0.25 * (w * w))) - 1.5); else tmp = -0.25 * ((r * w) * (r * w)); end tmp_2 = tmp; end
NOTE: r should be positive before calling this function
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r, 7.2e-116], t$95$0, If[LessEqual[r, 3e+152], N[(t$95$0 + N[(N[(N[(r * r), $MachinePrecision] * N[(-0.25 * 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}
r = |r|\\
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 7.2 \cdot 10^{-116}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;r \leq 3 \cdot 10^{+152}:\\
\;\;\;\;t_0 + \left(\left(r \cdot r\right) \cdot \left(-0.25 \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 < 7.19999999999999951e-116Initial program 86.2%
sub-neg86.2%
+-commutative86.2%
associate--l+86.2%
associate-/l*86.4%
distribute-neg-frac86.4%
associate-/r/86.5%
fma-def86.5%
sub-neg86.5%
Simplified79.3%
fma-udef79.3%
unswap-sqr99.8%
pow299.8%
div-inv99.8%
fma-def99.8%
pow299.8%
pow-flip99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in r around 0 55.0%
unpow255.0%
Simplified55.0%
if 7.19999999999999951e-116 < r < 2.99999999999999991e152Initial program 94.9%
sub-neg94.9%
+-commutative94.9%
associate--l+94.9%
associate-/l*99.7%
distribute-neg-frac99.7%
associate-/r/99.8%
fma-def99.8%
sub-neg99.8%
Simplified99.7%
Taylor expanded in v around inf 91.6%
associate--l+91.6%
associate-*r/91.6%
metadata-eval91.6%
unpow291.6%
unpow291.6%
associate-*r*91.6%
unpow291.6%
Simplified91.6%
if 2.99999999999999991e152 < r Initial program 90.9%
associate--l-90.9%
+-commutative90.9%
associate--l+90.9%
+-commutative90.9%
associate--r+90.9%
metadata-eval90.9%
associate-*l/90.9%
*-commutative90.9%
*-commutative90.9%
*-commutative90.9%
Simplified90.9%
expm1-log1p-u90.9%
expm1-udef90.9%
div-inv90.9%
pow290.9%
pow-flip90.9%
metadata-eval90.9%
Applied egg-rr90.9%
expm1-def90.9%
expm1-log1p90.9%
Simplified90.9%
Taylor expanded in v around inf 73.6%
*-commutative73.6%
unpow273.6%
*-commutative73.6%
unpow273.6%
Simplified73.6%
Taylor expanded in r around inf 73.6%
*-commutative73.6%
*-commutative73.6%
unpow273.6%
unpow273.6%
swap-sqr84.8%
unpow284.8%
*-commutative84.8%
Simplified84.8%
*-commutative84.8%
unpow284.8%
Applied egg-rr84.8%
Final simplification68.0%
NOTE: r should be positive before calling this function
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= r 2.3e-114)
t_0
(if (<= r 3e+152)
(+ t_0 (- (* -0.375 (* (* r r) (* w w))) 1.5))
(* -0.25 (* (* r w) (* r w)))))))r = abs(r);
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 2.3e-114) {
tmp = t_0;
} else if (r <= 3e+152) {
tmp = t_0 + ((-0.375 * ((r * r) * (w * w))) - 1.5);
} else {
tmp = -0.25 * ((r * w) * (r * w));
}
return tmp;
}
NOTE: r should be positive before calling this function
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.3d-114) then
tmp = t_0
else if (r <= 3d+152) 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
r = Math.abs(r);
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 2.3e-114) {
tmp = t_0;
} else if (r <= 3e+152) {
tmp = t_0 + ((-0.375 * ((r * r) * (w * w))) - 1.5);
} else {
tmp = -0.25 * ((r * w) * (r * w));
}
return tmp;
}
r = abs(r) def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if r <= 2.3e-114: tmp = t_0 elif r <= 3e+152: tmp = t_0 + ((-0.375 * ((r * r) * (w * w))) - 1.5) else: tmp = -0.25 * ((r * w) * (r * w)) return tmp
r = abs(r) function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (r <= 2.3e-114) tmp = t_0; elseif (r <= 3e+152) 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
r = abs(r) function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (r <= 2.3e-114) tmp = t_0; elseif (r <= 3e+152) tmp = t_0 + ((-0.375 * ((r * r) * (w * w))) - 1.5); else tmp = -0.25 * ((r * w) * (r * w)); end tmp_2 = tmp; end
NOTE: r should be positive before calling this function
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r, 2.3e-114], t$95$0, If[LessEqual[r, 3e+152], 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}
r = |r|\\
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 2.3 \cdot 10^{-114}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;r \leq 3 \cdot 10^{+152}:\\
\;\;\;\;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 < 2.2999999999999999e-114Initial program 86.2%
sub-neg86.2%
+-commutative86.2%
associate--l+86.2%
associate-/l*86.4%
distribute-neg-frac86.4%
associate-/r/86.5%
fma-def86.5%
sub-neg86.5%
Simplified79.3%
fma-udef79.3%
unswap-sqr99.8%
pow299.8%
div-inv99.8%
fma-def99.8%
pow299.8%
pow-flip99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in r around 0 55.0%
unpow255.0%
Simplified55.0%
if 2.2999999999999999e-114 < r < 2.99999999999999991e152Initial program 94.9%
sub-neg94.9%
+-commutative94.9%
associate--l+94.9%
associate-/l*99.7%
distribute-neg-frac99.7%
associate-/r/99.8%
fma-def99.8%
sub-neg99.8%
Simplified99.7%
Taylor expanded in v around 0 90.5%
associate--l+90.5%
associate-*r/90.5%
metadata-eval90.5%
unpow290.5%
*-commutative90.5%
unpow290.5%
*-commutative90.5%
unpow290.5%
Simplified90.5%
if 2.99999999999999991e152 < r Initial program 90.9%
associate--l-90.9%
+-commutative90.9%
associate--l+90.9%
+-commutative90.9%
associate--r+90.9%
metadata-eval90.9%
associate-*l/90.9%
*-commutative90.9%
*-commutative90.9%
*-commutative90.9%
Simplified90.9%
expm1-log1p-u90.9%
expm1-udef90.9%
div-inv90.9%
pow290.9%
pow-flip90.9%
metadata-eval90.9%
Applied egg-rr90.9%
expm1-def90.9%
expm1-log1p90.9%
Simplified90.9%
Taylor expanded in v around inf 73.6%
*-commutative73.6%
unpow273.6%
*-commutative73.6%
unpow273.6%
Simplified73.6%
Taylor expanded in r around inf 73.6%
*-commutative73.6%
*-commutative73.6%
unpow273.6%
unpow273.6%
swap-sqr84.8%
unpow284.8%
*-commutative84.8%
Simplified84.8%
*-commutative84.8%
unpow284.8%
Applied egg-rr84.8%
Final simplification67.8%
NOTE: r should be positive before calling this function
(FPCore (v w r)
:precision binary64
(let* ((t_0 (+ -1.5 (/ 2.0 (* r r)))))
(if (<= r 1.2)
t_0
(if (<= r 2.45e+35)
(* -0.25 (* w (* w (* r r))))
(if (<= r 5.6e+59) t_0 (* -0.25 (* (* r w) (* r w))))))))r = abs(r);
double code(double v, double w, double r) {
double t_0 = -1.5 + (2.0 / (r * r));
double tmp;
if (r <= 1.2) {
tmp = t_0;
} else if (r <= 2.45e+35) {
tmp = -0.25 * (w * (w * (r * r)));
} else if (r <= 5.6e+59) {
tmp = t_0;
} else {
tmp = -0.25 * ((r * w) * (r * w));
}
return tmp;
}
NOTE: r should be positive before calling this function
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.2d0) then
tmp = t_0
else if (r <= 2.45d+35) then
tmp = (-0.25d0) * (w * (w * (r * r)))
else if (r <= 5.6d+59) then
tmp = t_0
else
tmp = (-0.25d0) * ((r * w) * (r * w))
end if
code = tmp
end function
r = Math.abs(r);
public static double code(double v, double w, double r) {
double t_0 = -1.5 + (2.0 / (r * r));
double tmp;
if (r <= 1.2) {
tmp = t_0;
} else if (r <= 2.45e+35) {
tmp = -0.25 * (w * (w * (r * r)));
} else if (r <= 5.6e+59) {
tmp = t_0;
} else {
tmp = -0.25 * ((r * w) * (r * w));
}
return tmp;
}
r = abs(r) def code(v, w, r): t_0 = -1.5 + (2.0 / (r * r)) tmp = 0 if r <= 1.2: tmp = t_0 elif r <= 2.45e+35: tmp = -0.25 * (w * (w * (r * r))) elif r <= 5.6e+59: tmp = t_0 else: tmp = -0.25 * ((r * w) * (r * w)) return tmp
r = abs(r) function code(v, w, r) t_0 = Float64(-1.5 + Float64(2.0 / Float64(r * r))) tmp = 0.0 if (r <= 1.2) tmp = t_0; elseif (r <= 2.45e+35) tmp = Float64(-0.25 * Float64(w * Float64(w * Float64(r * r)))); elseif (r <= 5.6e+59) tmp = t_0; else tmp = Float64(-0.25 * Float64(Float64(r * w) * Float64(r * w))); end return tmp end
r = abs(r) function tmp_2 = code(v, w, r) t_0 = -1.5 + (2.0 / (r * r)); tmp = 0.0; if (r <= 1.2) tmp = t_0; elseif (r <= 2.45e+35) tmp = -0.25 * (w * (w * (r * r))); elseif (r <= 5.6e+59) tmp = t_0; else tmp = -0.25 * ((r * w) * (r * w)); end tmp_2 = tmp; end
NOTE: r should be positive before calling this function
code[v_, w_, r_] := Block[{t$95$0 = N[(-1.5 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r, 1.2], t$95$0, If[LessEqual[r, 2.45e+35], N[(-0.25 * N[(w * N[(w * N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[r, 5.6e+59], t$95$0, N[(-0.25 * N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
r = |r|\\
\\
\begin{array}{l}
t_0 := -1.5 + \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 1.2:\\
\;\;\;\;t_0\\
\mathbf{elif}\;r \leq 2.45 \cdot 10^{+35}:\\
\;\;\;\;-0.25 \cdot \left(w \cdot \left(w \cdot \left(r \cdot r\right)\right)\right)\\
\mathbf{elif}\;r \leq 5.6 \cdot 10^{+59}:\\
\;\;\;\;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 < 1.19999999999999996 or 2.45000000000000013e35 < r < 5.5999999999999996e59Initial program 88.6%
sub-neg88.6%
+-commutative88.6%
associate--l+88.6%
associate-/l*88.8%
distribute-neg-frac88.8%
associate-/r/88.8%
fma-def88.8%
sub-neg88.8%
Simplified82.9%
Taylor expanded in r around 0 65.9%
sub-neg65.9%
associate-*r/65.9%
metadata-eval65.9%
unpow265.9%
metadata-eval65.9%
Simplified65.9%
if 1.19999999999999996 < r < 2.45000000000000013e35Initial program 81.3%
associate--l-81.3%
+-commutative81.3%
associate--l+81.3%
+-commutative81.3%
associate--r+81.3%
metadata-eval81.3%
associate-*l/100.0%
*-commutative100.0%
*-commutative100.0%
*-commutative100.0%
Simplified100.0%
expm1-log1p-u100.0%
expm1-udef100.0%
div-inv100.0%
pow2100.0%
pow-flip100.0%
metadata-eval100.0%
Applied egg-rr100.0%
expm1-def100.0%
expm1-log1p100.0%
Simplified100.0%
Taylor expanded in v around inf 99.7%
*-commutative99.7%
unpow299.7%
*-commutative99.7%
unpow299.7%
Simplified99.7%
Taylor expanded in r around inf 99.7%
*-commutative99.7%
*-commutative99.7%
unpow299.7%
unpow299.7%
swap-sqr100.0%
unpow2100.0%
*-commutative100.0%
Simplified100.0%
unpow2100.0%
unswap-sqr99.7%
associate-*l*100.0%
Applied egg-rr100.0%
if 5.5999999999999996e59 < r Initial program 90.6%
associate--l-90.6%
+-commutative90.6%
associate--l+90.6%
+-commutative90.6%
associate--r+90.6%
metadata-eval90.6%
associate-*l/93.7%
*-commutative93.7%
*-commutative93.7%
*-commutative93.7%
Simplified93.7%
expm1-log1p-u93.7%
expm1-udef93.7%
div-inv93.7%
pow293.7%
pow-flip93.7%
metadata-eval93.7%
Applied egg-rr93.7%
expm1-def93.7%
expm1-log1p93.7%
Simplified93.7%
Taylor expanded in v around inf 76.6%
*-commutative76.6%
unpow276.6%
*-commutative76.6%
unpow276.6%
Simplified76.6%
Taylor expanded in r around inf 68.5%
*-commutative68.5%
*-commutative68.5%
unpow268.5%
unpow268.5%
swap-sqr76.2%
unpow276.2%
*-commutative76.2%
Simplified76.2%
*-commutative76.2%
unpow276.2%
Applied egg-rr76.2%
Final simplification68.9%
NOTE: r should be positive before calling this function
(FPCore (v w r)
:precision binary64
(let* ((t_0 (+ -1.5 (/ 2.0 (* r r)))))
(if (<= r 1.25)
t_0
(if (<= r 3.65e+34)
(/ (* w w) (/ -2.6666666666666665 (* r r)))
(if (<= r 7.5e+63) t_0 (* -0.25 (* (* r w) (* r w))))))))r = abs(r);
double code(double v, double w, double r) {
double t_0 = -1.5 + (2.0 / (r * r));
double tmp;
if (r <= 1.25) {
tmp = t_0;
} else if (r <= 3.65e+34) {
tmp = (w * w) / (-2.6666666666666665 / (r * r));
} else if (r <= 7.5e+63) {
tmp = t_0;
} else {
tmp = -0.25 * ((r * w) * (r * w));
}
return tmp;
}
NOTE: r should be positive before calling this function
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.25d0) then
tmp = t_0
else if (r <= 3.65d+34) then
tmp = (w * w) / ((-2.6666666666666665d0) / (r * r))
else if (r <= 7.5d+63) then
tmp = t_0
else
tmp = (-0.25d0) * ((r * w) * (r * w))
end if
code = tmp
end function
r = Math.abs(r);
public static double code(double v, double w, double r) {
double t_0 = -1.5 + (2.0 / (r * r));
double tmp;
if (r <= 1.25) {
tmp = t_0;
} else if (r <= 3.65e+34) {
tmp = (w * w) / (-2.6666666666666665 / (r * r));
} else if (r <= 7.5e+63) {
tmp = t_0;
} else {
tmp = -0.25 * ((r * w) * (r * w));
}
return tmp;
}
r = abs(r) def code(v, w, r): t_0 = -1.5 + (2.0 / (r * r)) tmp = 0 if r <= 1.25: tmp = t_0 elif r <= 3.65e+34: tmp = (w * w) / (-2.6666666666666665 / (r * r)) elif r <= 7.5e+63: tmp = t_0 else: tmp = -0.25 * ((r * w) * (r * w)) return tmp
r = abs(r) function code(v, w, r) t_0 = Float64(-1.5 + Float64(2.0 / Float64(r * r))) tmp = 0.0 if (r <= 1.25) tmp = t_0; elseif (r <= 3.65e+34) tmp = Float64(Float64(w * w) / Float64(-2.6666666666666665 / Float64(r * r))); elseif (r <= 7.5e+63) tmp = t_0; else tmp = Float64(-0.25 * Float64(Float64(r * w) * Float64(r * w))); end return tmp end
r = abs(r) function tmp_2 = code(v, w, r) t_0 = -1.5 + (2.0 / (r * r)); tmp = 0.0; if (r <= 1.25) tmp = t_0; elseif (r <= 3.65e+34) tmp = (w * w) / (-2.6666666666666665 / (r * r)); elseif (r <= 7.5e+63) tmp = t_0; else tmp = -0.25 * ((r * w) * (r * w)); end tmp_2 = tmp; end
NOTE: r should be positive before calling this function
code[v_, w_, r_] := Block[{t$95$0 = N[(-1.5 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r, 1.25], t$95$0, If[LessEqual[r, 3.65e+34], N[(N[(w * w), $MachinePrecision] / N[(-2.6666666666666665 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[r, 7.5e+63], t$95$0, N[(-0.25 * N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
r = |r|\\
\\
\begin{array}{l}
t_0 := -1.5 + \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 1.25:\\
\;\;\;\;t_0\\
\mathbf{elif}\;r \leq 3.65 \cdot 10^{+34}:\\
\;\;\;\;\frac{w \cdot w}{\frac{-2.6666666666666665}{r \cdot r}}\\
\mathbf{elif}\;r \leq 7.5 \cdot 10^{+63}:\\
\;\;\;\;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 < 1.25 or 3.6499999999999998e34 < r < 7.5000000000000005e63Initial program 88.6%
sub-neg88.6%
+-commutative88.6%
associate--l+88.6%
associate-/l*88.8%
distribute-neg-frac88.8%
associate-/r/88.8%
fma-def88.8%
sub-neg88.8%
Simplified82.9%
Taylor expanded in r around 0 65.9%
sub-neg65.9%
associate-*r/65.9%
metadata-eval65.9%
unpow265.9%
metadata-eval65.9%
Simplified65.9%
if 1.25 < r < 3.6499999999999998e34Initial program 81.3%
sub-neg81.3%
+-commutative81.3%
associate--l+81.3%
associate-/l*100.0%
distribute-neg-frac100.0%
associate-/r/100.0%
fma-def100.0%
sub-neg100.0%
Simplified99.7%
fma-udef99.7%
unswap-sqr100.0%
pow2100.0%
div-inv100.0%
fma-def100.0%
pow2100.0%
pow-flip100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in w around inf 81.3%
Taylor expanded in r around 0 81.3%
associate-/l*81.3%
unpow281.3%
fma-neg81.3%
metadata-eval81.3%
*-commutative81.3%
unpow281.3%
associate-*l*81.3%
Simplified81.3%
Taylor expanded in v around 0 84.0%
unpow284.0%
Simplified84.0%
if 7.5000000000000005e63 < r Initial program 90.6%
associate--l-90.6%
+-commutative90.6%
associate--l+90.6%
+-commutative90.6%
associate--r+90.6%
metadata-eval90.6%
associate-*l/93.7%
*-commutative93.7%
*-commutative93.7%
*-commutative93.7%
Simplified93.7%
expm1-log1p-u93.7%
expm1-udef93.7%
div-inv93.7%
pow293.7%
pow-flip93.7%
metadata-eval93.7%
Applied egg-rr93.7%
expm1-def93.7%
expm1-log1p93.7%
Simplified93.7%
Taylor expanded in v around inf 76.6%
*-commutative76.6%
unpow276.6%
*-commutative76.6%
unpow276.6%
Simplified76.6%
Taylor expanded in r around inf 68.5%
*-commutative68.5%
*-commutative68.5%
unpow268.5%
unpow268.5%
swap-sqr76.2%
unpow276.2%
*-commutative76.2%
Simplified76.2%
*-commutative76.2%
unpow276.2%
Applied egg-rr76.2%
Final simplification68.6%
NOTE: r should be positive before calling this function (FPCore (v w r) :precision binary64 (if (<= w 6.6e+44) (+ -1.5 (/ 2.0 (* r r))) (* -0.25 (* w (* w (* r r))))))
r = abs(r);
double code(double v, double w, double r) {
double tmp;
if (w <= 6.6e+44) {
tmp = -1.5 + (2.0 / (r * r));
} else {
tmp = -0.25 * (w * (w * (r * r)));
}
return tmp;
}
NOTE: r should be positive before calling this function
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 (w <= 6.6d+44) then
tmp = (-1.5d0) + (2.0d0 / (r * r))
else
tmp = (-0.25d0) * (w * (w * (r * r)))
end if
code = tmp
end function
r = Math.abs(r);
public static double code(double v, double w, double r) {
double tmp;
if (w <= 6.6e+44) {
tmp = -1.5 + (2.0 / (r * r));
} else {
tmp = -0.25 * (w * (w * (r * r)));
}
return tmp;
}
r = abs(r) def code(v, w, r): tmp = 0 if w <= 6.6e+44: tmp = -1.5 + (2.0 / (r * r)) else: tmp = -0.25 * (w * (w * (r * r))) return tmp
r = abs(r) function code(v, w, r) tmp = 0.0 if (w <= 6.6e+44) tmp = Float64(-1.5 + Float64(2.0 / Float64(r * r))); else tmp = Float64(-0.25 * Float64(w * Float64(w * Float64(r * r)))); end return tmp end
r = abs(r) function tmp_2 = code(v, w, r) tmp = 0.0; if (w <= 6.6e+44) tmp = -1.5 + (2.0 / (r * r)); else tmp = -0.25 * (w * (w * (r * r))); end tmp_2 = tmp; end
NOTE: r should be positive before calling this function code[v_, w_, r_] := If[LessEqual[w, 6.6e+44], N[(-1.5 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.25 * N[(w * N[(w * N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
r = |r|\\
\\
\begin{array}{l}
\mathbf{if}\;w \leq 6.6 \cdot 10^{+44}:\\
\;\;\;\;-1.5 + \frac{2}{r \cdot r}\\
\mathbf{else}:\\
\;\;\;\;-0.25 \cdot \left(w \cdot \left(w \cdot \left(r \cdot r\right)\right)\right)\\
\end{array}
\end{array}
if w < 6.60000000000000027e44Initial program 90.2%
sub-neg90.2%
+-commutative90.2%
associate--l+90.2%
associate-/l*91.7%
distribute-neg-frac91.7%
associate-/r/91.8%
fma-def91.7%
sub-neg91.7%
Simplified82.9%
Taylor expanded in r around 0 60.7%
sub-neg60.7%
associate-*r/60.7%
metadata-eval60.7%
unpow260.7%
metadata-eval60.7%
Simplified60.7%
if 6.60000000000000027e44 < w Initial program 83.2%
associate--l-83.2%
+-commutative83.2%
associate--l+83.2%
+-commutative83.2%
associate--r+83.2%
metadata-eval83.2%
associate-*l/83.2%
*-commutative83.2%
*-commutative83.2%
*-commutative83.2%
Simplified83.2%
expm1-log1p-u83.2%
expm1-udef83.2%
div-inv83.2%
pow283.2%
pow-flip83.2%
metadata-eval83.2%
Applied egg-rr83.2%
expm1-def83.2%
expm1-log1p83.2%
Simplified83.2%
Taylor expanded in v around inf 78.2%
*-commutative78.2%
unpow278.2%
*-commutative78.2%
unpow278.2%
Simplified78.2%
Taylor expanded in r around inf 71.9%
*-commutative71.9%
*-commutative71.9%
unpow271.9%
unpow271.9%
swap-sqr75.7%
unpow275.7%
*-commutative75.7%
Simplified75.7%
unpow275.7%
unswap-sqr71.9%
associate-*l*75.8%
Applied egg-rr75.8%
Final simplification63.5%
NOTE: r should be positive before calling this function (FPCore (v w r) :precision binary64 (if (<= r 1.15) (/ 2.0 (* r r)) -1.5))
r = abs(r);
double code(double v, double w, double r) {
double tmp;
if (r <= 1.15) {
tmp = 2.0 / (r * r);
} else {
tmp = -1.5;
}
return tmp;
}
NOTE: r should be positive before calling this function
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 <= 1.15d0) then
tmp = 2.0d0 / (r * r)
else
tmp = -1.5d0
end if
code = tmp
end function
r = Math.abs(r);
public static double code(double v, double w, double r) {
double tmp;
if (r <= 1.15) {
tmp = 2.0 / (r * r);
} else {
tmp = -1.5;
}
return tmp;
}
r = abs(r) def code(v, w, r): tmp = 0 if r <= 1.15: tmp = 2.0 / (r * r) else: tmp = -1.5 return tmp
r = abs(r) function code(v, w, r) tmp = 0.0 if (r <= 1.15) tmp = Float64(2.0 / Float64(r * r)); else tmp = -1.5; end return tmp end
r = abs(r) function tmp_2 = code(v, w, r) tmp = 0.0; if (r <= 1.15) tmp = 2.0 / (r * r); else tmp = -1.5; end tmp_2 = tmp; end
NOTE: r should be positive before calling this function code[v_, w_, r_] := If[LessEqual[r, 1.15], N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision], -1.5]
\begin{array}{l}
r = |r|\\
\\
\begin{array}{l}
\mathbf{if}\;r \leq 1.15:\\
\;\;\;\;\frac{2}{r \cdot r}\\
\mathbf{else}:\\
\;\;\;\;-1.5\\
\end{array}
\end{array}
if r < 1.1499999999999999Initial program 88.4%
sub-neg88.4%
+-commutative88.4%
associate--l+88.4%
associate-/l*88.6%
distribute-neg-frac88.6%
associate-/r/88.7%
fma-def88.6%
sub-neg88.6%
Simplified82.6%
fma-udef82.7%
unswap-sqr99.8%
pow299.8%
div-inv99.8%
fma-def99.8%
pow299.8%
pow-flip99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Taylor expanded in r around 0 57.3%
unpow257.3%
Simplified57.3%
if 1.1499999999999999 < r Initial program 90.3%
sub-neg90.3%
+-commutative90.3%
associate--l+90.3%
associate-/l*94.4%
distribute-neg-frac94.4%
associate-/r/94.4%
fma-def94.4%
sub-neg94.4%
Simplified83.9%
Taylor expanded in r around 0 19.3%
sub-neg19.3%
associate-*r/19.3%
metadata-eval19.3%
unpow219.3%
metadata-eval19.3%
Simplified19.3%
Taylor expanded in r around inf 19.3%
Final simplification47.2%
NOTE: r should be positive before calling this function (FPCore (v w r) :precision binary64 (+ -1.5 (/ 2.0 (* r r))))
r = abs(r);
double code(double v, double w, double r) {
return -1.5 + (2.0 / (r * r));
}
NOTE: r should be positive before calling this function
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
r = Math.abs(r);
public static double code(double v, double w, double r) {
return -1.5 + (2.0 / (r * r));
}
r = abs(r) def code(v, w, r): return -1.5 + (2.0 / (r * r))
r = abs(r) function code(v, w, r) return Float64(-1.5 + Float64(2.0 / Float64(r * r))) end
r = abs(r) function tmp = code(v, w, r) tmp = -1.5 + (2.0 / (r * r)); end
NOTE: r should be positive before calling this function code[v_, w_, r_] := N[(-1.5 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
r = |r|\\
\\
-1.5 + \frac{2}{r \cdot r}
\end{array}
Initial program 88.9%
sub-neg88.9%
+-commutative88.9%
associate--l+88.9%
associate-/l*90.2%
distribute-neg-frac90.2%
associate-/r/90.2%
fma-def90.2%
sub-neg90.2%
Simplified83.0%
Taylor expanded in r around 0 53.5%
sub-neg53.5%
associate-*r/53.5%
metadata-eval53.5%
unpow253.5%
metadata-eval53.5%
Simplified53.5%
Final simplification53.5%
NOTE: r should be positive before calling this function (FPCore (v w r) :precision binary64 -1.5)
r = abs(r);
double code(double v, double w, double r) {
return -1.5;
}
NOTE: r should be positive before calling this function
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
end function
r = Math.abs(r);
public static double code(double v, double w, double r) {
return -1.5;
}
r = abs(r) def code(v, w, r): return -1.5
r = abs(r) function code(v, w, r) return -1.5 end
r = abs(r) function tmp = code(v, w, r) tmp = -1.5; end
NOTE: r should be positive before calling this function code[v_, w_, r_] := -1.5
\begin{array}{l}
r = |r|\\
\\
-1.5
\end{array}
Initial program 88.9%
sub-neg88.9%
+-commutative88.9%
associate--l+88.9%
associate-/l*90.2%
distribute-neg-frac90.2%
associate-/r/90.2%
fma-def90.2%
sub-neg90.2%
Simplified83.0%
Taylor expanded in r around 0 53.5%
sub-neg53.5%
associate-*r/53.5%
metadata-eval53.5%
unpow253.5%
metadata-eval53.5%
Simplified53.5%
Taylor expanded in r around inf 12.0%
Final simplification12.0%
herbie shell --seed 2023213
(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))