
(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 11 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
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= (* w w) 5e+230)
(+
t_0
(- -1.5 (* (* r (* w (* r w))) (/ (+ 0.375 (* v -0.25)) (- 1.0 v)))))
(+
-4.5
(-
(+ 3.0 t_0)
(* (* 0.125 (* r w)) (/ (+ 3.0 (* -2.0 v)) (/ (/ (- 1.0 v) w) r))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((w * w) <= 5e+230) {
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) - ((0.125 * (r * w)) * ((3.0 + (-2.0 * v)) / (((1.0 - v) / w) / r))));
}
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) <= 5d+230) 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) - ((0.125d0 * (r * w)) * ((3.0d0 + ((-2.0d0) * v)) / (((1.0d0 - v) / w) / r))))
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) <= 5e+230) {
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) - ((0.125 * (r * w)) * ((3.0 + (-2.0 * v)) / (((1.0 - v) / w) / r))));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if (w * w) <= 5e+230: 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) - ((0.125 * (r * w)) * ((3.0 + (-2.0 * v)) / (((1.0 - v) / w) / r)))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (Float64(w * w) <= 5e+230) 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(0.125 * Float64(r * w)) * Float64(Float64(3.0 + Float64(-2.0 * v)) / Float64(Float64(Float64(1.0 - v) / w) / r))))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if ((w * w) <= 5e+230) 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) - ((0.125 * (r * w)) * ((3.0 + (-2.0 * v)) / (((1.0 - v) / w) / r)))); 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], 5e+230], 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[(0.125 * N[(r * w), $MachinePrecision]), $MachinePrecision] * N[(N[(3.0 + N[(-2.0 * v), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(1.0 - v), $MachinePrecision] / w), $MachinePrecision] / r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;w \cdot w \leq 5 \cdot 10^{+230}:\\
\;\;\;\;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(0.125 \cdot \left(r \cdot w\right)\right) \cdot \frac{3 + -2 \cdot v}{\frac{\frac{1 - v}{w}}{r}}\right)\\
\end{array}
\end{array}
if (*.f64 w w) < 5.0000000000000003e230Initial program 89.6%
associate--l-89.6%
+-commutative89.6%
associate--l+89.6%
+-commutative89.6%
associate--r+89.6%
metadata-eval89.6%
associate-*l/91.7%
*-commutative91.7%
*-commutative91.7%
*-commutative91.7%
Simplified92.9%
Taylor expanded in r around 0 92.9%
unpow292.9%
associate-*l*99.3%
Simplified99.3%
if 5.0000000000000003e230 < (*.f64 w w) Initial program 72.2%
Simplified73.3%
*-un-lft-identity73.3%
add-sqr-sqrt73.3%
times-frac73.3%
unswap-sqr73.3%
sqrt-prod37.9%
add-sqr-sqrt41.6%
unswap-sqr67.0%
sqrt-prod50.5%
add-sqr-sqrt99.9%
Applied egg-rr99.9%
times-frac99.9%
Applied egg-rr99.9%
associate-/r/99.9%
metadata-eval99.9%
*-commutative99.9%
associate-/r*99.9%
Simplified99.9%
Final simplification99.5%
(FPCore (v w r) :precision binary64 (+ (- (+ 3.0 (/ 2.0 (* r r))) (/ (* 0.125 (+ 3.0 (* -2.0 v))) (* (/ 1.0 (* r w)) (/ (- 1.0 v) (* r w))))) -4.5))
double code(double v, double w, double r) {
return ((3.0 + (2.0 / (r * r))) - ((0.125 * (3.0 + (-2.0 * v))) / ((1.0 / (r * w)) * ((1.0 - v) / (r * w))))) + -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))) / ((1.0d0 / (r * w)) * ((1.0d0 - v) / (r * w))))) + (-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))) / ((1.0 / (r * w)) * ((1.0 - v) / (r * w))))) + -4.5;
}
def code(v, w, r): return ((3.0 + (2.0 / (r * r))) - ((0.125 * (3.0 + (-2.0 * v))) / ((1.0 / (r * w)) * ((1.0 - v) / (r * w))))) + -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(-2.0 * v))) / Float64(Float64(1.0 / Float64(r * w)) * Float64(Float64(1.0 - v) / Float64(r * w))))) + -4.5) end
function tmp = code(v, w, r) tmp = ((3.0 + (2.0 / (r * r))) - ((0.125 * (3.0 + (-2.0 * v))) / ((1.0 / (r * w)) * ((1.0 - v) / (r * w))))) + -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[(-2.0 * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 / N[(r * w), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - v), $MachinePrecision] / N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -4.5), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{0.125 \cdot \left(3 + -2 \cdot v\right)}{\frac{1}{r \cdot w} \cdot \frac{1 - v}{r \cdot w}}\right) + -4.5
\end{array}
Initial program 83.8%
Simplified76.9%
*-un-lft-identity76.9%
add-sqr-sqrt76.9%
times-frac76.9%
unswap-sqr76.9%
sqrt-prod41.6%
add-sqr-sqrt58.7%
unswap-sqr77.1%
sqrt-prod53.4%
add-sqr-sqrt99.0%
Applied egg-rr99.0%
Final simplification99.0%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= w 1e+183)
(+
t_0
(- -1.5 (* (* r (* w (* r w))) (/ (+ 0.375 (* v -0.25)) (- 1.0 v)))))
(+ -4.5 (- (+ 3.0 t_0) (* w (* (* r w) (/ r 4.0))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (w <= 1e+183) {
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) - (w * ((r * w) * (r / 4.0))));
}
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 <= 1d+183) 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) - (w * ((r * w) * (r / 4.0d0))))
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 <= 1e+183) {
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) - (w * ((r * w) * (r / 4.0))));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if w <= 1e+183: 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) - (w * ((r * w) * (r / 4.0)))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (w <= 1e+183) 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(w * Float64(Float64(r * w) * Float64(r / 4.0))))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (w <= 1e+183) 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) - (w * ((r * w) * (r / 4.0)))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[w, 1e+183], 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[(w * N[(N[(r * w), $MachinePrecision] * N[(r / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;w \leq 10^{+183}:\\
\;\;\;\;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) - w \cdot \left(\left(r \cdot w\right) \cdot \frac{r}{4}\right)\right)\\
\end{array}
\end{array}
if w < 9.99999999999999947e182Initial program 85.1%
associate--l-85.1%
+-commutative85.1%
associate--l+85.1%
+-commutative85.1%
associate--r+85.1%
metadata-eval85.1%
associate-*l/87.1%
*-commutative87.1%
*-commutative87.1%
*-commutative87.1%
Simplified88.0%
Taylor expanded in r around 0 88.0%
unpow288.0%
associate-*l*98.1%
Simplified98.1%
if 9.99999999999999947e182 < w Initial program 74.8%
Simplified74.8%
*-un-lft-identity74.8%
add-sqr-sqrt74.8%
times-frac74.8%
unswap-sqr74.8%
sqrt-prod42.2%
add-sqr-sqrt42.5%
unswap-sqr64.4%
sqrt-prod51.6%
add-sqr-sqrt99.9%
Applied egg-rr99.9%
times-frac99.9%
Applied egg-rr99.9%
associate-/r/99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in v around inf 74.8%
unpow274.8%
associate-*r*74.8%
unpow274.8%
associate-*r*74.8%
associate-*r*74.8%
metadata-eval74.8%
associate-/r/74.8%
associate-*r*87.6%
associate-/r/87.6%
associate-*l/87.6%
*-lft-identity87.6%
associate-/r/99.9%
associate-/r/99.9%
associate-*r*87.6%
*-commutative87.6%
associate-*l*99.9%
Simplified99.9%
Final simplification98.4%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (or (<= v -1e+26) (not (<= v 2.9e-107)))
(+ -4.5 (- (+ 3.0 t_0) (* w (* (* r w) (/ r 4.0)))))
(+ t_0 (- -1.5 (* (* w (* r w)) (/ r 2.6666666666666665)))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((v <= -1e+26) || !(v <= 2.9e-107)) {
tmp = -4.5 + ((3.0 + t_0) - (w * ((r * w) * (r / 4.0))));
} else {
tmp = t_0 + (-1.5 - ((w * (r * w)) * (r / 2.6666666666666665)));
}
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 ((v <= (-1d+26)) .or. (.not. (v <= 2.9d-107))) then
tmp = (-4.5d0) + ((3.0d0 + t_0) - (w * ((r * w) * (r / 4.0d0))))
else
tmp = t_0 + ((-1.5d0) - ((w * (r * w)) * (r / 2.6666666666666665d0)))
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 ((v <= -1e+26) || !(v <= 2.9e-107)) {
tmp = -4.5 + ((3.0 + t_0) - (w * ((r * w) * (r / 4.0))));
} else {
tmp = t_0 + (-1.5 - ((w * (r * w)) * (r / 2.6666666666666665)));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if (v <= -1e+26) or not (v <= 2.9e-107): tmp = -4.5 + ((3.0 + t_0) - (w * ((r * w) * (r / 4.0)))) else: tmp = t_0 + (-1.5 - ((w * (r * w)) * (r / 2.6666666666666665))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if ((v <= -1e+26) || !(v <= 2.9e-107)) tmp = Float64(-4.5 + Float64(Float64(3.0 + t_0) - Float64(w * Float64(Float64(r * w) * Float64(r / 4.0))))); else tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(w * Float64(r * w)) * Float64(r / 2.6666666666666665)))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if ((v <= -1e+26) || ~((v <= 2.9e-107))) tmp = -4.5 + ((3.0 + t_0) - (w * ((r * w) * (r / 4.0)))); else tmp = t_0 + (-1.5 - ((w * (r * w)) * (r / 2.6666666666666665))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[v, -1e+26], N[Not[LessEqual[v, 2.9e-107]], $MachinePrecision]], N[(-4.5 + N[(N[(3.0 + t$95$0), $MachinePrecision] - N[(w * N[(N[(r * w), $MachinePrecision] * N[(r / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(-1.5 - N[(N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision] * N[(r / 2.6666666666666665), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;v \leq -1 \cdot 10^{+26} \lor \neg \left(v \leq 2.9 \cdot 10^{-107}\right):\\
\;\;\;\;-4.5 + \left(\left(3 + t_0\right) - w \cdot \left(\left(r \cdot w\right) \cdot \frac{r}{4}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - \left(w \cdot \left(r \cdot w\right)\right) \cdot \frac{r}{2.6666666666666665}\right)\\
\end{array}
\end{array}
if v < -1.00000000000000005e26 or 2.8999999999999998e-107 < v Initial program 82.5%
Simplified77.5%
*-un-lft-identity77.5%
add-sqr-sqrt77.5%
times-frac77.5%
unswap-sqr77.5%
sqrt-prod44.6%
add-sqr-sqrt60.9%
unswap-sqr79.3%
sqrt-prod57.4%
add-sqr-sqrt98.4%
Applied egg-rr98.4%
times-frac98.5%
Applied egg-rr98.5%
associate-/r/98.5%
metadata-eval98.5%
*-commutative98.5%
associate-/r*94.3%
Simplified94.3%
Taylor expanded in v around inf 78.2%
unpow278.2%
associate-*r*78.2%
unpow278.2%
associate-*r*86.9%
associate-*r*86.9%
metadata-eval86.9%
associate-/r/86.9%
associate-*r*95.4%
associate-/r/95.3%
associate-*l/95.3%
*-lft-identity95.3%
associate-/r/99.3%
associate-/r/99.3%
associate-*r*95.3%
*-commutative95.3%
associate-*l*98.6%
Simplified98.6%
if -1.00000000000000005e26 < v < 2.8999999999999998e-107Initial program 85.6%
associate--l-85.6%
+-commutative85.6%
associate--l+85.6%
+-commutative85.6%
associate--r+85.6%
metadata-eval85.6%
associate-*r*86.4%
*-commutative86.4%
associate-/l*86.4%
*-commutative86.4%
Simplified86.4%
Taylor expanded in v around 0 86.4%
unpow286.4%
associate-*l*98.1%
Simplified98.1%
associate-/r/98.2%
Applied egg-rr98.2%
Final simplification98.4%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= r 5e-48)
(+ t_0 (- -1.5 (* w (* r (* r (* w 0.375))))))
(if (<= r 8.5e+80)
(+ t_0 (- -1.5 (* (* (* r r) (* w w)) 0.25)))
(+ t_0 (- -1.5 (* (* w (* r w)) (/ r 2.6666666666666665))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 5e-48) {
tmp = t_0 + (-1.5 - (w * (r * (r * (w * 0.375)))));
} else if (r <= 8.5e+80) {
tmp = t_0 + (-1.5 - (((r * r) * (w * w)) * 0.25));
} else {
tmp = t_0 + (-1.5 - ((w * (r * w)) * (r / 2.6666666666666665)));
}
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 <= 5d-48) then
tmp = t_0 + ((-1.5d0) - (w * (r * (r * (w * 0.375d0)))))
else if (r <= 8.5d+80) then
tmp = t_0 + ((-1.5d0) - (((r * r) * (w * w)) * 0.25d0))
else
tmp = t_0 + ((-1.5d0) - ((w * (r * w)) * (r / 2.6666666666666665d0)))
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 <= 5e-48) {
tmp = t_0 + (-1.5 - (w * (r * (r * (w * 0.375)))));
} else if (r <= 8.5e+80) {
tmp = t_0 + (-1.5 - (((r * r) * (w * w)) * 0.25));
} else {
tmp = t_0 + (-1.5 - ((w * (r * w)) * (r / 2.6666666666666665)));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if r <= 5e-48: tmp = t_0 + (-1.5 - (w * (r * (r * (w * 0.375))))) elif r <= 8.5e+80: tmp = t_0 + (-1.5 - (((r * r) * (w * w)) * 0.25)) else: tmp = t_0 + (-1.5 - ((w * (r * w)) * (r / 2.6666666666666665))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (r <= 5e-48) tmp = Float64(t_0 + Float64(-1.5 - Float64(w * Float64(r * Float64(r * Float64(w * 0.375)))))); elseif (r <= 8.5e+80) tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(Float64(r * r) * Float64(w * w)) * 0.25))); else tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(w * Float64(r * w)) * Float64(r / 2.6666666666666665)))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (r <= 5e-48) tmp = t_0 + (-1.5 - (w * (r * (r * (w * 0.375))))); elseif (r <= 8.5e+80) tmp = t_0 + (-1.5 - (((r * r) * (w * w)) * 0.25)); else tmp = t_0 + (-1.5 - ((w * (r * w)) * (r / 2.6666666666666665))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r, 5e-48], N[(t$95$0 + N[(-1.5 - N[(w * N[(r * N[(r * N[(w * 0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[r, 8.5e+80], N[(t$95$0 + N[(-1.5 - N[(N[(N[(r * r), $MachinePrecision] * N[(w * w), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(-1.5 - N[(N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision] * N[(r / 2.6666666666666665), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 5 \cdot 10^{-48}:\\
\;\;\;\;t_0 + \left(-1.5 - w \cdot \left(r \cdot \left(r \cdot \left(w \cdot 0.375\right)\right)\right)\right)\\
\mathbf{elif}\;r \leq 8.5 \cdot 10^{+80}:\\
\;\;\;\;t_0 + \left(-1.5 - \left(\left(r \cdot r\right) \cdot \left(w \cdot w\right)\right) \cdot 0.25\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - \left(w \cdot \left(r \cdot w\right)\right) \cdot \frac{r}{2.6666666666666665}\right)\\
\end{array}
\end{array}
if r < 4.9999999999999999e-48Initial program 81.9%
associate--l-81.9%
+-commutative81.9%
associate--l+81.9%
+-commutative81.9%
associate--r+81.9%
metadata-eval81.9%
associate-*r*81.3%
*-commutative81.3%
associate-/l*82.4%
*-commutative82.4%
Simplified83.0%
Taylor expanded in v around 0 81.8%
unpow281.8%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in w around 0 81.8%
unpow281.8%
associate-*r*91.7%
associate-/r*91.7%
*-commutative91.7%
associate-/r*91.7%
Simplified91.7%
associate-/r/94.1%
div-inv94.1%
clear-num94.1%
div-inv94.1%
clear-num94.1%
div-inv94.1%
metadata-eval94.1%
Applied egg-rr94.1%
if 4.9999999999999999e-48 < r < 8.50000000000000007e80Initial program 97.1%
associate--l-97.1%
+-commutative97.1%
associate--l+97.1%
+-commutative97.1%
associate--r+97.1%
metadata-eval97.1%
associate-*l/99.9%
*-commutative99.9%
*-commutative99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in r around 0 99.9%
unpow299.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in v around inf 99.9%
*-commutative99.9%
unpow299.9%
unpow299.9%
Simplified99.9%
if 8.50000000000000007e80 < r Initial program 82.1%
associate--l-82.1%
+-commutative82.1%
associate--l+82.1%
+-commutative82.1%
associate--r+82.1%
metadata-eval82.1%
associate-*r*83.7%
*-commutative83.7%
associate-/l*85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in v around 0 82.4%
unpow282.4%
associate-*l*90.6%
Simplified90.6%
associate-/r/90.7%
Applied egg-rr90.7%
Final simplification94.2%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))) (t_1 (* w (* r w))))
(if (<= v 2e-90)
(+ t_0 (- -1.5 (* t_1 (/ r 2.6666666666666665))))
(+ t_0 (- -1.5 (* t_1 (/ r 4.0)))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double t_1 = w * (r * w);
double tmp;
if (v <= 2e-90) {
tmp = t_0 + (-1.5 - (t_1 * (r / 2.6666666666666665)));
} else {
tmp = t_0 + (-1.5 - (t_1 * (r / 4.0)));
}
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 = 2.0d0 / (r * r)
t_1 = w * (r * w)
if (v <= 2d-90) then
tmp = t_0 + ((-1.5d0) - (t_1 * (r / 2.6666666666666665d0)))
else
tmp = t_0 + ((-1.5d0) - (t_1 * (r / 4.0d0)))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double t_1 = w * (r * w);
double tmp;
if (v <= 2e-90) {
tmp = t_0 + (-1.5 - (t_1 * (r / 2.6666666666666665)));
} else {
tmp = t_0 + (-1.5 - (t_1 * (r / 4.0)));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) t_1 = w * (r * w) tmp = 0 if v <= 2e-90: tmp = t_0 + (-1.5 - (t_1 * (r / 2.6666666666666665))) else: tmp = t_0 + (-1.5 - (t_1 * (r / 4.0))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) t_1 = Float64(w * Float64(r * w)) tmp = 0.0 if (v <= 2e-90) tmp = Float64(t_0 + Float64(-1.5 - Float64(t_1 * Float64(r / 2.6666666666666665)))); else tmp = Float64(t_0 + Float64(-1.5 - Float64(t_1 * Float64(r / 4.0)))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); t_1 = w * (r * w); tmp = 0.0; if (v <= 2e-90) tmp = t_0 + (-1.5 - (t_1 * (r / 2.6666666666666665))); else tmp = t_0 + (-1.5 - (t_1 * (r / 4.0))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[v, 2e-90], N[(t$95$0 + N[(-1.5 - N[(t$95$1 * N[(r / 2.6666666666666665), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(-1.5 - N[(t$95$1 * N[(r / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
t_1 := w \cdot \left(r \cdot w\right)\\
\mathbf{if}\;v \leq 2 \cdot 10^{-90}:\\
\;\;\;\;t_0 + \left(-1.5 - t_1 \cdot \frac{r}{2.6666666666666665}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - t_1 \cdot \frac{r}{4}\right)\\
\end{array}
\end{array}
if v < 1.99999999999999999e-90Initial program 83.1%
associate--l-83.1%
+-commutative83.1%
associate--l+83.1%
+-commutative83.1%
associate--r+83.1%
metadata-eval83.1%
associate-*r*83.6%
*-commutative83.6%
associate-/l*84.1%
*-commutative84.1%
Simplified84.7%
Taylor expanded in v around 0 84.6%
unpow284.6%
associate-*l*94.1%
Simplified94.1%
associate-/r/94.2%
Applied egg-rr94.2%
if 1.99999999999999999e-90 < v Initial program 85.1%
associate--l-85.1%
+-commutative85.1%
associate--l+85.1%
+-commutative85.1%
associate--r+85.1%
metadata-eval85.1%
associate-*r*84.0%
*-commutative84.0%
associate-/l*86.1%
*-commutative86.1%
Simplified86.1%
Taylor expanded in v around inf 87.2%
unpow287.2%
associate-*l*97.6%
Simplified97.6%
associate-/r/97.7%
Applied egg-rr97.7%
Final simplification95.4%
(FPCore (v w r) :precision binary64 (+ (/ 2.0 (* r r)) (- -1.5 (* w (* r (* r (* w 0.375)))))))
double code(double v, double w, double r) {
return (2.0 / (r * r)) + (-1.5 - (w * (r * (r * (w * 0.375)))));
}
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)) + ((-1.5d0) - (w * (r * (r * (w * 0.375d0)))))
end function
public static double code(double v, double w, double r) {
return (2.0 / (r * r)) + (-1.5 - (w * (r * (r * (w * 0.375)))));
}
def code(v, w, r): return (2.0 / (r * r)) + (-1.5 - (w * (r * (r * (w * 0.375)))))
function code(v, w, r) return Float64(Float64(2.0 / Float64(r * r)) + Float64(-1.5 - Float64(w * Float64(r * Float64(r * Float64(w * 0.375)))))) end
function tmp = code(v, w, r) tmp = (2.0 / (r * r)) + (-1.5 - (w * (r * (r * (w * 0.375))))); end
code[v_, w_, r_] := N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + N[(-1.5 - N[(w * N[(r * N[(r * N[(w * 0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{r \cdot r} + \left(-1.5 - w \cdot \left(r \cdot \left(r \cdot \left(w \cdot 0.375\right)\right)\right)\right)
\end{array}
Initial program 83.8%
associate--l-83.8%
+-commutative83.8%
associate--l+83.8%
+-commutative83.8%
associate--r+83.8%
metadata-eval83.8%
associate-*r*83.8%
*-commutative83.8%
associate-/l*84.8%
*-commutative84.8%
Simplified85.2%
Taylor expanded in v around 0 83.5%
unpow283.5%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in w around 0 83.5%
unpow283.5%
associate-*r*91.9%
associate-/r*91.9%
*-commutative91.9%
associate-/r*91.9%
Simplified91.9%
associate-/r/92.0%
div-inv92.0%
clear-num92.0%
div-inv92.0%
clear-num92.0%
div-inv92.0%
metadata-eval92.0%
Applied egg-rr92.0%
Final simplification92.0%
(FPCore (v w r) :precision binary64 (if (<= r 0.0067) (+ (/ 2.0 (* r r)) -1.5) (* (* r r) (* (* w w) -0.375))))
double code(double v, double w, double r) {
double tmp;
if (r <= 0.0067) {
tmp = (2.0 / (r * r)) + -1.5;
} else {
tmp = (r * r) * ((w * w) * -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) :: tmp
if (r <= 0.0067d0) then
tmp = (2.0d0 / (r * r)) + (-1.5d0)
else
tmp = (r * r) * ((w * w) * (-0.375d0))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double tmp;
if (r <= 0.0067) {
tmp = (2.0 / (r * r)) + -1.5;
} else {
tmp = (r * r) * ((w * w) * -0.375);
}
return tmp;
}
def code(v, w, r): tmp = 0 if r <= 0.0067: tmp = (2.0 / (r * r)) + -1.5 else: tmp = (r * r) * ((w * w) * -0.375) return tmp
function code(v, w, r) tmp = 0.0 if (r <= 0.0067) tmp = Float64(Float64(2.0 / Float64(r * r)) + -1.5); else tmp = Float64(Float64(r * r) * Float64(Float64(w * w) * -0.375)); end return tmp end
function tmp_2 = code(v, w, r) tmp = 0.0; if (r <= 0.0067) tmp = (2.0 / (r * r)) + -1.5; else tmp = (r * r) * ((w * w) * -0.375); end tmp_2 = tmp; end
code[v_, w_, r_] := If[LessEqual[r, 0.0067], N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision], N[(N[(r * r), $MachinePrecision] * N[(N[(w * w), $MachinePrecision] * -0.375), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 0.0067:\\
\;\;\;\;\frac{2}{r \cdot r} + -1.5\\
\mathbf{else}:\\
\;\;\;\;\left(r \cdot r\right) \cdot \left(\left(w \cdot w\right) \cdot -0.375\right)\\
\end{array}
\end{array}
if r < 0.00670000000000000023Initial program 83.2%
Simplified76.8%
Taylor expanded in v around 0 74.6%
*-commutative74.6%
unpow274.6%
unpow274.6%
Simplified74.6%
Taylor expanded in r around 0 68.3%
sub-neg68.3%
associate-*r/68.3%
metadata-eval68.3%
unpow268.3%
metadata-eval68.3%
Simplified68.3%
if 0.00670000000000000023 < r Initial program 85.5%
Simplified77.2%
Taylor expanded in v around 0 76.1%
*-commutative76.1%
unpow276.1%
unpow276.1%
Simplified76.1%
Taylor expanded in r around inf 63.3%
associate-*r*64.4%
unpow264.4%
unpow264.4%
Simplified64.4%
Final simplification67.3%
(FPCore (v w r) :precision binary64 (if (<= r 0.00105) (+ (/ 2.0 (* r r)) -1.5) (* (* r w) (* w (* r -0.375)))))
double code(double v, double w, double r) {
double tmp;
if (r <= 0.00105) {
tmp = (2.0 / (r * r)) + -1.5;
} else {
tmp = (r * w) * (w * (r * -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) :: tmp
if (r <= 0.00105d0) then
tmp = (2.0d0 / (r * r)) + (-1.5d0)
else
tmp = (r * w) * (w * (r * (-0.375d0)))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double tmp;
if (r <= 0.00105) {
tmp = (2.0 / (r * r)) + -1.5;
} else {
tmp = (r * w) * (w * (r * -0.375));
}
return tmp;
}
def code(v, w, r): tmp = 0 if r <= 0.00105: tmp = (2.0 / (r * r)) + -1.5 else: tmp = (r * w) * (w * (r * -0.375)) return tmp
function code(v, w, r) tmp = 0.0 if (r <= 0.00105) tmp = Float64(Float64(2.0 / Float64(r * r)) + -1.5); else tmp = Float64(Float64(r * w) * Float64(w * Float64(r * -0.375))); end return tmp end
function tmp_2 = code(v, w, r) tmp = 0.0; if (r <= 0.00105) tmp = (2.0 / (r * r)) + -1.5; else tmp = (r * w) * (w * (r * -0.375)); end tmp_2 = tmp; end
code[v_, w_, r_] := If[LessEqual[r, 0.00105], N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision], N[(N[(r * w), $MachinePrecision] * N[(w * N[(r * -0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 0.00105:\\
\;\;\;\;\frac{2}{r \cdot r} + -1.5\\
\mathbf{else}:\\
\;\;\;\;\left(r \cdot w\right) \cdot \left(w \cdot \left(r \cdot -0.375\right)\right)\\
\end{array}
\end{array}
if r < 0.00104999999999999994Initial program 83.2%
Simplified76.8%
Taylor expanded in v around 0 74.6%
*-commutative74.6%
unpow274.6%
unpow274.6%
Simplified74.6%
Taylor expanded in r around 0 68.3%
sub-neg68.3%
associate-*r/68.3%
metadata-eval68.3%
unpow268.3%
metadata-eval68.3%
Simplified68.3%
if 0.00104999999999999994 < r Initial program 85.5%
Simplified77.2%
Taylor expanded in v around 0 76.1%
*-commutative76.1%
unpow276.1%
unpow276.1%
Simplified76.1%
Taylor expanded in r around inf 63.3%
*-commutative63.3%
associate-*l*64.5%
unpow264.5%
unpow264.5%
Simplified64.5%
Taylor expanded in w around 0 63.3%
*-commutative63.3%
unpow263.3%
associate-*r*64.5%
unpow264.5%
associate-*r*64.7%
associate-*r*69.3%
associate-*r*76.1%
*-commutative76.1%
associate-*l*76.1%
Simplified76.1%
Final simplification70.4%
(FPCore (v w r) :precision binary64 (+ (/ 2.0 (* r r)) -1.5))
double code(double v, double w, double r) {
return (2.0 / (r * r)) + -1.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)) + (-1.5d0)
end function
public static double code(double v, double w, double r) {
return (2.0 / (r * r)) + -1.5;
}
def code(v, w, r): return (2.0 / (r * r)) + -1.5
function code(v, w, r) return Float64(Float64(2.0 / Float64(r * r)) + -1.5) end
function tmp = code(v, w, r) tmp = (2.0 / (r * r)) + -1.5; end
code[v_, w_, r_] := N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{r \cdot r} + -1.5
\end{array}
Initial program 83.8%
Simplified76.9%
Taylor expanded in v around 0 75.0%
*-commutative75.0%
unpow275.0%
unpow275.0%
Simplified75.0%
Taylor expanded in r around 0 55.4%
sub-neg55.4%
associate-*r/55.4%
metadata-eval55.4%
unpow255.4%
metadata-eval55.4%
Simplified55.4%
Final simplification55.4%
(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.8%
Simplified76.9%
Taylor expanded in v around 0 75.0%
*-commutative75.0%
unpow275.0%
unpow275.0%
Simplified75.0%
Taylor expanded in r around 0 39.4%
unpow239.4%
Simplified39.4%
Final simplification39.4%
herbie shell --seed 2023275
(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))