
(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}
(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 84.7%
Simplified82.5%
*-un-lft-identity82.5%
add-sqr-sqrt82.5%
times-frac82.5%
unswap-sqr82.5%
sqrt-prod46.1%
add-sqr-sqrt64.5%
unswap-sqr79.5%
sqrt-prod54.2%
add-sqr-sqrt99.4%
Applied egg-rr99.4%
Final simplification99.4%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (or (<= v -3e+25) (not (<= v 3e-24)))
(+ t_0 (- -1.5 (/ r (/ 4.0 (* w (* r w))))))
(+
-4.5
(- (+ 3.0 t_0) (/ 0.375 (* (/ 1.0 (* r w)) (/ (- 1.0 v) (* r w)))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((v <= -3e+25) || !(v <= 3e-24)) {
tmp = t_0 + (-1.5 - (r / (4.0 / (w * (r * w)))));
} else {
tmp = -4.5 + ((3.0 + t_0) - (0.375 / ((1.0 / (r * w)) * ((1.0 - v) / (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 ((v <= (-3d+25)) .or. (.not. (v <= 3d-24))) then
tmp = t_0 + ((-1.5d0) - (r / (4.0d0 / (w * (r * w)))))
else
tmp = (-4.5d0) + ((3.0d0 + t_0) - (0.375d0 / ((1.0d0 / (r * w)) * ((1.0d0 - v) / (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 ((v <= -3e+25) || !(v <= 3e-24)) {
tmp = t_0 + (-1.5 - (r / (4.0 / (w * (r * w)))));
} else {
tmp = -4.5 + ((3.0 + t_0) - (0.375 / ((1.0 / (r * w)) * ((1.0 - v) / (r * w)))));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if (v <= -3e+25) or not (v <= 3e-24): tmp = t_0 + (-1.5 - (r / (4.0 / (w * (r * w))))) else: tmp = -4.5 + ((3.0 + t_0) - (0.375 / ((1.0 / (r * w)) * ((1.0 - v) / (r * w))))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if ((v <= -3e+25) || !(v <= 3e-24)) tmp = Float64(t_0 + Float64(-1.5 - Float64(r / Float64(4.0 / Float64(w * Float64(r * w)))))); else tmp = Float64(-4.5 + Float64(Float64(3.0 + t_0) - Float64(0.375 / Float64(Float64(1.0 / Float64(r * w)) * Float64(Float64(1.0 - v) / Float64(r * w)))))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if ((v <= -3e+25) || ~((v <= 3e-24))) tmp = t_0 + (-1.5 - (r / (4.0 / (w * (r * w))))); else tmp = -4.5 + ((3.0 + t_0) - (0.375 / ((1.0 / (r * w)) * ((1.0 - v) / (r * w))))); 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, -3e+25], N[Not[LessEqual[v, 3e-24]], $MachinePrecision]], N[(t$95$0 + N[(-1.5 - N[(r / N[(4.0 / N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 + N[(N[(3.0 + t$95$0), $MachinePrecision] - N[(0.375 / N[(N[(1.0 / N[(r * w), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - v), $MachinePrecision] / N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;v \leq -3 \cdot 10^{+25} \lor \neg \left(v \leq 3 \cdot 10^{-24}\right):\\
\;\;\;\;t_0 + \left(-1.5 - \frac{r}{\frac{4}{w \cdot \left(r \cdot w\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;-4.5 + \left(\left(3 + t_0\right) - \frac{0.375}{\frac{1}{r \cdot w} \cdot \frac{1 - v}{r \cdot w}}\right)\\
\end{array}
\end{array}
if v < -3.00000000000000006e25 or 2.99999999999999995e-24 < v Initial program 82.7%
associate--l-82.7%
+-commutative82.7%
associate--l+82.7%
+-commutative82.7%
associate--r+82.7%
metadata-eval82.7%
associate-*r*82.7%
*-commutative82.7%
associate-/l*85.9%
*-commutative85.9%
Simplified86.7%
Taylor expanded in v around inf 89.0%
unpow289.0%
associate-*r*97.3%
Simplified97.3%
if -3.00000000000000006e25 < v < 2.99999999999999995e-24Initial program 86.5%
Simplified82.5%
*-un-lft-identity82.5%
add-sqr-sqrt82.5%
times-frac82.5%
unswap-sqr82.5%
sqrt-prod45.7%
add-sqr-sqrt64.8%
unswap-sqr80.7%
sqrt-prod54.3%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
Taylor expanded in v around 0 99.3%
Final simplification98.4%
(FPCore (v w r)
:precision binary64
(if (<= r 2e-79)
(+ -4.5 (- (+ 3.0 (/ 2.0 (* r r))) (* w (* (* r (* r w)) 0.375))))
(+
(/ 1.0 (/ r (/ 2.0 r)))
(- -1.5 (* (/ (+ 0.375 (* v -0.25)) (- 1.0 v)) (* r (* r (* w w))))))))
double code(double v, double w, double r) {
double tmp;
if (r <= 2e-79) {
tmp = -4.5 + ((3.0 + (2.0 / (r * r))) - (w * ((r * (r * w)) * 0.375)));
} else {
tmp = (1.0 / (r / (2.0 / r))) + (-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) :: tmp
if (r <= 2d-79) then
tmp = (-4.5d0) + ((3.0d0 + (2.0d0 / (r * r))) - (w * ((r * (r * w)) * 0.375d0)))
else
tmp = (1.0d0 / (r / (2.0d0 / r))) + ((-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 tmp;
if (r <= 2e-79) {
tmp = -4.5 + ((3.0 + (2.0 / (r * r))) - (w * ((r * (r * w)) * 0.375)));
} else {
tmp = (1.0 / (r / (2.0 / r))) + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (r * (w * w)))));
}
return tmp;
}
def code(v, w, r): tmp = 0 if r <= 2e-79: tmp = -4.5 + ((3.0 + (2.0 / (r * r))) - (w * ((r * (r * w)) * 0.375))) else: tmp = (1.0 / (r / (2.0 / r))) + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (r * (w * w))))) return tmp
function code(v, w, r) tmp = 0.0 if (r <= 2e-79) tmp = Float64(-4.5 + Float64(Float64(3.0 + Float64(2.0 / Float64(r * r))) - Float64(w * Float64(Float64(r * Float64(r * w)) * 0.375)))); else tmp = Float64(Float64(1.0 / Float64(r / Float64(2.0 / r))) + 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) tmp = 0.0; if (r <= 2e-79) tmp = -4.5 + ((3.0 + (2.0 / (r * r))) - (w * ((r * (r * w)) * 0.375))); else tmp = (1.0 / (r / (2.0 / r))) + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (r * (w * w))))); end tmp_2 = tmp; end
code[v_, w_, r_] := If[LessEqual[r, 2e-79], N[(-4.5 + N[(N[(3.0 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(w * N[(N[(r * N[(r * w), $MachinePrecision]), $MachinePrecision] * 0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(r / N[(2.0 / r), $MachinePrecision]), $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[(r * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 2 \cdot 10^{-79}:\\
\;\;\;\;-4.5 + \left(\left(3 + \frac{2}{r \cdot r}\right) - w \cdot \left(\left(r \cdot \left(r \cdot w\right)\right) \cdot 0.375\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{r}{\frac{2}{r}}} + \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 < 2e-79Initial program 80.9%
Simplified79.4%
*-un-lft-identity79.4%
add-sqr-sqrt79.4%
times-frac79.4%
unswap-sqr79.4%
sqrt-prod46.7%
add-sqr-sqrt66.3%
unswap-sqr84.0%
sqrt-prod55.8%
add-sqr-sqrt99.2%
Applied egg-rr99.2%
Taylor expanded in v around 0 77.8%
*-commutative77.8%
associate-*r*77.8%
unpow277.8%
unpow277.8%
associate-*l*92.5%
unpow292.5%
*-commutative92.5%
associate-*r*92.5%
unpow292.5%
Simplified92.5%
Taylor expanded in w around 0 92.5%
*-commutative92.5%
unpow292.5%
associate-*l*95.7%
*-commutative95.7%
Simplified95.7%
if 2e-79 < r Initial program 94.6%
associate--l-94.6%
+-commutative94.6%
associate--l+94.6%
+-commutative94.6%
associate--r+94.6%
metadata-eval94.6%
associate-*l/99.8%
*-commutative99.8%
*-commutative99.8%
*-commutative99.8%
Simplified99.8%
clear-num99.8%
inv-pow99.8%
Applied egg-rr99.8%
unpow-199.8%
associate-/l*99.8%
Simplified99.8%
Final simplification96.9%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= r 1e-96)
(+ -4.5 (- (+ 3.0 t_0) (* w (* (* r (* r w)) 0.375))))
(+
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 <= 1e-96) {
tmp = -4.5 + ((3.0 + t_0) - (w * ((r * (r * w)) * 0.375)));
} 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 <= 1d-96) then
tmp = (-4.5d0) + ((3.0d0 + t_0) - (w * ((r * (r * w)) * 0.375d0)))
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 <= 1e-96) {
tmp = -4.5 + ((3.0 + t_0) - (w * ((r * (r * w)) * 0.375)));
} 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 <= 1e-96: tmp = -4.5 + ((3.0 + t_0) - (w * ((r * (r * w)) * 0.375))) 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 <= 1e-96) tmp = Float64(-4.5 + Float64(Float64(3.0 + t_0) - Float64(w * Float64(Float64(r * Float64(r * w)) * 0.375)))); 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 <= 1e-96) tmp = -4.5 + ((3.0 + t_0) - (w * ((r * (r * w)) * 0.375))); 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, 1e-96], N[(-4.5 + N[(N[(3.0 + t$95$0), $MachinePrecision] - N[(w * N[(N[(r * N[(r * w), $MachinePrecision]), $MachinePrecision] * 0.375), $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[(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 10^{-96}:\\
\;\;\;\;-4.5 + \left(\left(3 + t_0\right) - w \cdot \left(\left(r \cdot \left(r \cdot w\right)\right) \cdot 0.375\right)\right)\\
\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 < 9.9999999999999991e-97Initial program 80.4%
Simplified79.0%
*-un-lft-identity79.0%
add-sqr-sqrt79.0%
times-frac78.9%
unswap-sqr79.0%
sqrt-prod46.1%
add-sqr-sqrt65.6%
unswap-sqr83.7%
sqrt-prod55.4%
add-sqr-sqrt99.2%
Applied egg-rr99.2%
Taylor expanded in v around 0 77.3%
*-commutative77.3%
associate-*r*77.3%
unpow277.3%
unpow277.3%
associate-*l*92.4%
unpow292.4%
*-commutative92.4%
associate-*r*92.4%
unpow292.4%
Simplified92.4%
Taylor expanded in w around 0 92.4%
*-commutative92.4%
unpow292.4%
associate-*l*95.6%
*-commutative95.6%
Simplified95.6%
if 9.9999999999999991e-97 < r Initial program 94.9%
associate--l-94.9%
+-commutative94.9%
associate--l+94.9%
+-commutative94.9%
associate--r+94.9%
metadata-eval94.9%
associate-*l/99.8%
*-commutative99.8%
*-commutative99.8%
*-commutative99.8%
Simplified99.8%
Final simplification96.8%
(FPCore (v w r) :precision binary64 (+ (/ 1.0 (/ r (/ 2.0 r))) (- -1.5 (* (* w (* r (* r w))) (/ (+ 0.375 (* v -0.25)) (- 1.0 v))))))
double code(double v, double w, double r) {
return (1.0 / (r / (2.0 / r))) + (-1.5 - ((w * (r * (r * w))) * ((0.375 + (v * -0.25)) / (1.0 - v))));
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
code = (1.0d0 / (r / (2.0d0 / r))) + ((-1.5d0) - ((w * (r * (r * w))) * ((0.375d0 + (v * (-0.25d0))) / (1.0d0 - v))))
end function
public static double code(double v, double w, double r) {
return (1.0 / (r / (2.0 / r))) + (-1.5 - ((w * (r * (r * w))) * ((0.375 + (v * -0.25)) / (1.0 - v))));
}
def code(v, w, r): return (1.0 / (r / (2.0 / r))) + (-1.5 - ((w * (r * (r * w))) * ((0.375 + (v * -0.25)) / (1.0 - v))))
function code(v, w, r) return Float64(Float64(1.0 / Float64(r / Float64(2.0 / r))) + Float64(-1.5 - Float64(Float64(w * Float64(r * Float64(r * w))) * Float64(Float64(0.375 + Float64(v * -0.25)) / Float64(1.0 - v))))) end
function tmp = code(v, w, r) tmp = (1.0 / (r / (2.0 / r))) + (-1.5 - ((w * (r * (r * w))) * ((0.375 + (v * -0.25)) / (1.0 - v)))); end
code[v_, w_, r_] := N[(N[(1.0 / N[(r / N[(2.0 / r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.5 - N[(N[(w * N[(r * 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}
\\
\frac{1}{\frac{r}{\frac{2}{r}}} + \left(-1.5 - \left(w \cdot \left(r \cdot \left(r \cdot w\right)\right)\right) \cdot \frac{0.375 + v \cdot -0.25}{1 - v}\right)
\end{array}
Initial program 84.7%
associate--l-84.7%
+-commutative84.7%
associate--l+84.7%
+-commutative84.7%
associate--r+84.7%
metadata-eval84.7%
associate-*l/87.3%
*-commutative87.3%
*-commutative87.3%
*-commutative87.3%
Simplified87.7%
clear-num87.7%
inv-pow87.7%
Applied egg-rr87.7%
unpow-187.7%
associate-/l*87.7%
Simplified87.7%
Taylor expanded in r around 0 82.9%
unpow282.9%
unpow282.9%
swap-sqr99.8%
associate-*l*98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= v -1.8e+26)
(+ t_0 (- -1.5 (/ r (/ 4.0 (* w (* r w))))))
(+ -4.5 (- (+ 3.0 t_0) (* w (* (* r (* r w)) 0.375)))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (v <= -1.8e+26) {
tmp = t_0 + (-1.5 - (r / (4.0 / (w * (r * w)))));
} else {
tmp = -4.5 + ((3.0 + t_0) - (w * ((r * (r * 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) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
if (v <= (-1.8d+26)) then
tmp = t_0 + ((-1.5d0) - (r / (4.0d0 / (w * (r * w)))))
else
tmp = (-4.5d0) + ((3.0d0 + t_0) - (w * ((r * (r * w)) * 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 (v <= -1.8e+26) {
tmp = t_0 + (-1.5 - (r / (4.0 / (w * (r * w)))));
} else {
tmp = -4.5 + ((3.0 + t_0) - (w * ((r * (r * w)) * 0.375)));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if v <= -1.8e+26: tmp = t_0 + (-1.5 - (r / (4.0 / (w * (r * w))))) else: tmp = -4.5 + ((3.0 + t_0) - (w * ((r * (r * w)) * 0.375))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (v <= -1.8e+26) tmp = Float64(t_0 + Float64(-1.5 - Float64(r / Float64(4.0 / Float64(w * Float64(r * w)))))); else tmp = Float64(-4.5 + Float64(Float64(3.0 + t_0) - Float64(w * Float64(Float64(r * Float64(r * w)) * 0.375)))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (v <= -1.8e+26) tmp = t_0 + (-1.5 - (r / (4.0 / (w * (r * w))))); else tmp = -4.5 + ((3.0 + t_0) - (w * ((r * (r * w)) * 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[v, -1.8e+26], N[(t$95$0 + N[(-1.5 - N[(r / N[(4.0 / N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 + N[(N[(3.0 + t$95$0), $MachinePrecision] - N[(w * N[(N[(r * N[(r * w), $MachinePrecision]), $MachinePrecision] * 0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;v \leq -1.8 \cdot 10^{+26}:\\
\;\;\;\;t_0 + \left(-1.5 - \frac{r}{\frac{4}{w \cdot \left(r \cdot w\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;-4.5 + \left(\left(3 + t_0\right) - w \cdot \left(\left(r \cdot \left(r \cdot w\right)\right) \cdot 0.375\right)\right)\\
\end{array}
\end{array}
if v < -1.80000000000000012e26Initial program 80.2%
associate--l-80.2%
+-commutative80.2%
associate--l+80.2%
+-commutative80.2%
associate--r+80.2%
metadata-eval80.2%
associate-*r*80.2%
*-commutative80.2%
associate-/l*87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in v around inf 92.4%
unpow292.4%
associate-*r*96.1%
Simplified96.1%
if -1.80000000000000012e26 < v Initial program 85.9%
Simplified82.3%
*-un-lft-identity82.3%
add-sqr-sqrt82.3%
times-frac82.3%
unswap-sqr82.3%
sqrt-prod46.6%
add-sqr-sqrt65.4%
unswap-sqr80.5%
sqrt-prod54.3%
add-sqr-sqrt99.3%
Applied egg-rr99.3%
Taylor expanded in v around 0 82.2%
*-commutative82.2%
associate-*r*82.2%
unpow282.2%
unpow282.2%
associate-*l*93.7%
unpow293.7%
*-commutative93.7%
associate-*r*93.7%
unpow293.7%
Simplified93.7%
Taylor expanded in w around 0 93.7%
*-commutative93.7%
unpow293.7%
associate-*l*97.0%
*-commutative97.0%
Simplified97.0%
Final simplification96.8%
(FPCore (v w r) :precision binary64 (let* ((t_0 (/ 2.0 (* r r)))) (if (<= r 7.5e-131) t_0 (+ t_0 (- -1.5 (* (* r r) (* 0.375 (* w w))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 7.5e-131) {
tmp = t_0;
} else {
tmp = t_0 + (-1.5 - ((r * r) * (0.375 * (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 <= 7.5d-131) then
tmp = t_0
else
tmp = t_0 + ((-1.5d0) - ((r * r) * (0.375d0 * (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 <= 7.5e-131) {
tmp = t_0;
} else {
tmp = t_0 + (-1.5 - ((r * r) * (0.375 * (w * w))));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if r <= 7.5e-131: tmp = t_0 else: tmp = t_0 + (-1.5 - ((r * r) * (0.375 * (w * w)))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (r <= 7.5e-131) tmp = t_0; else tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(r * r) * Float64(0.375 * 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 <= 7.5e-131) tmp = t_0; else tmp = t_0 + (-1.5 - ((r * r) * (0.375 * (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, 7.5e-131], t$95$0, N[(t$95$0 + N[(-1.5 - N[(N[(r * r), $MachinePrecision] * N[(0.375 * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 7.5 \cdot 10^{-131}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - \left(r \cdot r\right) \cdot \left(0.375 \cdot \left(w \cdot w\right)\right)\right)\\
\end{array}
\end{array}
if r < 7.49999999999999964e-131Initial program 80.2%
Simplified78.6%
Taylor expanded in v around 0 76.9%
*-commutative76.9%
unpow276.9%
unpow276.9%
Simplified76.9%
Taylor expanded in r around 0 59.8%
unpow259.8%
Simplified59.8%
if 7.49999999999999964e-131 < 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-*r*93.4%
*-commutative93.4%
associate-/l*95.5%
*-commutative95.5%
Simplified95.5%
Taylor expanded in v around 0 92.4%
unpow292.4%
*-commutative92.4%
Simplified92.4%
associate-/r/92.4%
associate-*r*93.6%
*-commutative93.6%
*-commutative93.6%
Applied egg-rr93.6%
Taylor expanded in r around 0 86.8%
associate-*r*86.8%
unpow286.8%
unpow286.8%
Simplified86.8%
Final simplification69.1%
(FPCore (v w r) :precision binary64 (if (<= r 2e-151) (/ (/ 2.0 r) r) (+ (/ 2.0 (* r r)) (- -1.5 (* (* w (* r w)) (* r 0.375))))))
double code(double v, double w, double r) {
double tmp;
if (r <= 2e-151) {
tmp = (2.0 / r) / r;
} else {
tmp = (2.0 / (r * r)) + (-1.5 - ((w * (r * 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 <= 2d-151) then
tmp = (2.0d0 / r) / r
else
tmp = (2.0d0 / (r * r)) + ((-1.5d0) - ((w * (r * w)) * (r * 0.375d0)))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double tmp;
if (r <= 2e-151) {
tmp = (2.0 / r) / r;
} else {
tmp = (2.0 / (r * r)) + (-1.5 - ((w * (r * w)) * (r * 0.375)));
}
return tmp;
}
def code(v, w, r): tmp = 0 if r <= 2e-151: tmp = (2.0 / r) / r else: tmp = (2.0 / (r * r)) + (-1.5 - ((w * (r * w)) * (r * 0.375))) return tmp
function code(v, w, r) tmp = 0.0 if (r <= 2e-151) tmp = Float64(Float64(2.0 / r) / r); else tmp = Float64(Float64(2.0 / Float64(r * r)) + Float64(-1.5 - Float64(Float64(w * Float64(r * w)) * Float64(r * 0.375)))); end return tmp end
function tmp_2 = code(v, w, r) tmp = 0.0; if (r <= 2e-151) tmp = (2.0 / r) / r; else tmp = (2.0 / (r * r)) + (-1.5 - ((w * (r * w)) * (r * 0.375))); end tmp_2 = tmp; end
code[v_, w_, r_] := If[LessEqual[r, 2e-151], N[(N[(2.0 / r), $MachinePrecision] / r), $MachinePrecision], N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + N[(-1.5 - N[(N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision] * N[(r * 0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 2 \cdot 10^{-151}:\\
\;\;\;\;\frac{\frac{2}{r}}{r}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{r \cdot r} + \left(-1.5 - \left(w \cdot \left(r \cdot w\right)\right) \cdot \left(r \cdot 0.375\right)\right)\\
\end{array}
\end{array}
if r < 1.9999999999999999e-151Initial program 81.0%
associate--l-81.0%
+-commutative81.0%
associate--l+81.0%
+-commutative81.0%
associate--r+81.0%
metadata-eval81.0%
associate-*r*81.0%
*-commutative81.0%
associate-/l*82.1%
*-commutative82.1%
Simplified82.7%
Taylor expanded in v around 0 80.4%
unpow280.4%
*-commutative80.4%
Simplified80.4%
associate-/r/80.4%
associate-*r*92.3%
*-commutative92.3%
*-commutative92.3%
Applied egg-rr92.3%
Taylor expanded in r around 0 92.2%
*-commutative92.2%
Simplified92.2%
Taylor expanded in r around 0 58.8%
unpow258.8%
associate-/r*58.8%
Simplified58.8%
if 1.9999999999999999e-151 < r Initial program 91.4%
associate--l-91.4%
+-commutative91.4%
associate--l+91.4%
+-commutative91.4%
associate--r+91.4%
metadata-eval91.4%
associate-*r*91.5%
*-commutative91.5%
associate-/l*93.5%
*-commutative93.5%
Simplified93.5%
Taylor expanded in v around 0 90.5%
unpow290.5%
*-commutative90.5%
Simplified90.5%
associate-/r/90.5%
associate-*r*93.8%
*-commutative93.8%
*-commutative93.8%
Applied egg-rr93.8%
Taylor expanded in r around 0 93.8%
*-commutative93.8%
Simplified93.8%
Final simplification71.4%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (* w (* r w))) (t_1 (/ 2.0 (* r r))))
(if (<= v -2e+26)
(+ t_1 (- -1.5 (/ r (/ 4.0 t_0))))
(+ t_1 (- -1.5 (* t_0 (* r 0.375)))))))
double code(double v, double w, double r) {
double t_0 = w * (r * w);
double t_1 = 2.0 / (r * r);
double tmp;
if (v <= -2e+26) {
tmp = t_1 + (-1.5 - (r / (4.0 / t_0)));
} else {
tmp = t_1 + (-1.5 - (t_0 * (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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = w * (r * w)
t_1 = 2.0d0 / (r * r)
if (v <= (-2d+26)) then
tmp = t_1 + ((-1.5d0) - (r / (4.0d0 / t_0)))
else
tmp = t_1 + ((-1.5d0) - (t_0 * (r * 0.375d0)))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = w * (r * w);
double t_1 = 2.0 / (r * r);
double tmp;
if (v <= -2e+26) {
tmp = t_1 + (-1.5 - (r / (4.0 / t_0)));
} else {
tmp = t_1 + (-1.5 - (t_0 * (r * 0.375)));
}
return tmp;
}
def code(v, w, r): t_0 = w * (r * w) t_1 = 2.0 / (r * r) tmp = 0 if v <= -2e+26: tmp = t_1 + (-1.5 - (r / (4.0 / t_0))) else: tmp = t_1 + (-1.5 - (t_0 * (r * 0.375))) return tmp
function code(v, w, r) t_0 = Float64(w * Float64(r * w)) t_1 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (v <= -2e+26) tmp = Float64(t_1 + Float64(-1.5 - Float64(r / Float64(4.0 / t_0)))); else tmp = Float64(t_1 + Float64(-1.5 - Float64(t_0 * Float64(r * 0.375)))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = w * (r * w); t_1 = 2.0 / (r * r); tmp = 0.0; if (v <= -2e+26) tmp = t_1 + (-1.5 - (r / (4.0 / t_0))); else tmp = t_1 + (-1.5 - (t_0 * (r * 0.375))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[v, -2e+26], N[(t$95$1 + N[(-1.5 - N[(r / N[(4.0 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(-1.5 - N[(t$95$0 * N[(r * 0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := w \cdot \left(r \cdot w\right)\\
t_1 := \frac{2}{r \cdot r}\\
\mathbf{if}\;v \leq -2 \cdot 10^{+26}:\\
\;\;\;\;t_1 + \left(-1.5 - \frac{r}{\frac{4}{t_0}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(-1.5 - t_0 \cdot \left(r \cdot 0.375\right)\right)\\
\end{array}
\end{array}
if v < -2.0000000000000001e26Initial program 80.2%
associate--l-80.2%
+-commutative80.2%
associate--l+80.2%
+-commutative80.2%
associate--r+80.2%
metadata-eval80.2%
associate-*r*80.2%
*-commutative80.2%
associate-/l*87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in v around inf 92.4%
unpow292.4%
associate-*r*96.1%
Simplified96.1%
if -2.0000000000000001e26 < v Initial program 85.9%
associate--l-85.9%
+-commutative85.9%
associate--l+85.9%
+-commutative85.9%
associate--r+85.9%
metadata-eval85.9%
associate-*r*86.0%
*-commutative86.0%
associate-/l*86.0%
*-commutative86.0%
Simplified86.4%
Taylor expanded in v around 0 85.4%
unpow285.4%
*-commutative85.4%
Simplified85.4%
associate-/r/85.3%
associate-*r*95.5%
*-commutative95.5%
*-commutative95.5%
Applied egg-rr95.5%
Taylor expanded in r around 0 95.5%
*-commutative95.5%
Simplified95.5%
Final simplification95.6%
(FPCore (v w r)
:precision binary64
(if (<= r 5e+24)
(+ -1.5 (/ (/ 2.0 r) r))
(if (<= r 1.16e+45)
(* (* r r) (* -0.25 (* w w)))
(if (<= r 1.48e+57)
(+ (/ 2.0 (* r r)) -1.5)
(* (* r r) (* w (* w -0.375)))))))
double code(double v, double w, double r) {
double tmp;
if (r <= 5e+24) {
tmp = -1.5 + ((2.0 / r) / r);
} else if (r <= 1.16e+45) {
tmp = (r * r) * (-0.25 * (w * w));
} else if (r <= 1.48e+57) {
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 <= 5d+24) then
tmp = (-1.5d0) + ((2.0d0 / r) / r)
else if (r <= 1.16d+45) then
tmp = (r * r) * ((-0.25d0) * (w * w))
else if (r <= 1.48d+57) 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 <= 5e+24) {
tmp = -1.5 + ((2.0 / r) / r);
} else if (r <= 1.16e+45) {
tmp = (r * r) * (-0.25 * (w * w));
} else if (r <= 1.48e+57) {
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 <= 5e+24: tmp = -1.5 + ((2.0 / r) / r) elif r <= 1.16e+45: tmp = (r * r) * (-0.25 * (w * w)) elif r <= 1.48e+57: 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 <= 5e+24) tmp = Float64(-1.5 + Float64(Float64(2.0 / r) / r)); elseif (r <= 1.16e+45) tmp = Float64(Float64(r * r) * Float64(-0.25 * Float64(w * w))); elseif (r <= 1.48e+57) tmp = Float64(Float64(2.0 / Float64(r * r)) + -1.5); else tmp = Float64(Float64(r * r) * Float64(w * Float64(w * -0.375))); end return tmp end
function tmp_2 = code(v, w, r) tmp = 0.0; if (r <= 5e+24) tmp = -1.5 + ((2.0 / r) / r); elseif (r <= 1.16e+45) tmp = (r * r) * (-0.25 * (w * w)); elseif (r <= 1.48e+57) 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, 5e+24], N[(-1.5 + N[(N[(2.0 / r), $MachinePrecision] / r), $MachinePrecision]), $MachinePrecision], If[LessEqual[r, 1.16e+45], N[(N[(r * r), $MachinePrecision] * N[(-0.25 * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[r, 1.48e+57], N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision], N[(N[(r * r), $MachinePrecision] * N[(w * N[(w * -0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 5 \cdot 10^{+24}:\\
\;\;\;\;-1.5 + \frac{\frac{2}{r}}{r}\\
\mathbf{elif}\;r \leq 1.16 \cdot 10^{+45}:\\
\;\;\;\;\left(r \cdot r\right) \cdot \left(-0.25 \cdot \left(w \cdot w\right)\right)\\
\mathbf{elif}\;r \leq 1.48 \cdot 10^{+57}:\\
\;\;\;\;\frac{2}{r \cdot r} + -1.5\\
\mathbf{else}:\\
\;\;\;\;\left(r \cdot r\right) \cdot \left(w \cdot \left(w \cdot -0.375\right)\right)\\
\end{array}
\end{array}
if r < 5.00000000000000045e24Initial program 82.3%
associate--l-82.3%
+-commutative82.3%
associate--l+82.4%
+-commutative82.4%
associate--r+82.4%
metadata-eval82.4%
associate-*r*82.4%
*-commutative82.4%
associate-/l*83.3%
*-commutative83.3%
Simplified83.8%
Taylor expanded in v around 0 81.9%
unpow281.9%
*-commutative81.9%
Simplified81.9%
associate-/r/81.9%
associate-*r*93.1%
*-commutative93.1%
*-commutative93.1%
Applied egg-rr93.1%
Taylor expanded in r around 0 93.1%
*-commutative93.1%
Simplified93.1%
Taylor expanded in r around 0 72.5%
sub-neg72.5%
associate-*r/72.5%
metadata-eval72.5%
unpow272.5%
associate-/r*72.6%
metadata-eval72.6%
Simplified72.6%
if 5.00000000000000045e24 < r < 1.1600000000000001e45Initial program 69.8%
Simplified99.5%
Taylor expanded in v around inf 73.2%
*-commutative73.2%
unpow273.2%
unpow273.2%
Simplified73.2%
Taylor expanded in r around inf 73.2%
associate-*r*73.2%
unpow273.2%
unpow273.2%
Simplified73.2%
if 1.1600000000000001e45 < r < 1.47999999999999999e57Initial program 100.0%
Simplified100.0%
Taylor expanded in v around 0 100.0%
*-commutative100.0%
unpow2100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in r around 0 100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
unpow2100.0%
metadata-eval100.0%
Simplified100.0%
if 1.47999999999999999e57 < r Initial program 94.2%
Simplified86.4%
Taylor expanded in v around 0 82.5%
*-commutative82.5%
unpow282.5%
unpow282.5%
Simplified82.5%
Taylor expanded in r around inf 73.0%
*-commutative73.0%
*-commutative73.0%
associate-*l*73.0%
unpow273.0%
unpow273.0%
Simplified73.0%
Taylor expanded in w around 0 73.0%
*-commutative73.0%
unpow273.0%
associate-*r*73.0%
Simplified73.0%
Final simplification73.0%
(FPCore (v w r)
:precision binary64
(if (<= r 5.8e+25)
(+ -1.5 (/ (/ 2.0 r) r))
(if (<= r 2.8e+45)
(* (* r r) (* -0.25 (* w w)))
(if (<= r 1.8e+57)
(+ (/ 2.0 (* r r)) -1.5)
(* (* r r) (* (* w w) -0.375))))))
double code(double v, double w, double r) {
double tmp;
if (r <= 5.8e+25) {
tmp = -1.5 + ((2.0 / r) / r);
} else if (r <= 2.8e+45) {
tmp = (r * r) * (-0.25 * (w * w));
} else if (r <= 1.8e+57) {
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 <= 5.8d+25) then
tmp = (-1.5d0) + ((2.0d0 / r) / r)
else if (r <= 2.8d+45) then
tmp = (r * r) * ((-0.25d0) * (w * w))
else if (r <= 1.8d+57) 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 <= 5.8e+25) {
tmp = -1.5 + ((2.0 / r) / r);
} else if (r <= 2.8e+45) {
tmp = (r * r) * (-0.25 * (w * w));
} else if (r <= 1.8e+57) {
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 <= 5.8e+25: tmp = -1.5 + ((2.0 / r) / r) elif r <= 2.8e+45: tmp = (r * r) * (-0.25 * (w * w)) elif r <= 1.8e+57: 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 <= 5.8e+25) tmp = Float64(-1.5 + Float64(Float64(2.0 / r) / r)); elseif (r <= 2.8e+45) tmp = Float64(Float64(r * r) * Float64(-0.25 * Float64(w * w))); elseif (r <= 1.8e+57) 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 <= 5.8e+25) tmp = -1.5 + ((2.0 / r) / r); elseif (r <= 2.8e+45) tmp = (r * r) * (-0.25 * (w * w)); elseif (r <= 1.8e+57) 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, 5.8e+25], N[(-1.5 + N[(N[(2.0 / r), $MachinePrecision] / r), $MachinePrecision]), $MachinePrecision], If[LessEqual[r, 2.8e+45], N[(N[(r * r), $MachinePrecision] * N[(-0.25 * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[r, 1.8e+57], 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 5.8 \cdot 10^{+25}:\\
\;\;\;\;-1.5 + \frac{\frac{2}{r}}{r}\\
\mathbf{elif}\;r \leq 2.8 \cdot 10^{+45}:\\
\;\;\;\;\left(r \cdot r\right) \cdot \left(-0.25 \cdot \left(w \cdot w\right)\right)\\
\mathbf{elif}\;r \leq 1.8 \cdot 10^{+57}:\\
\;\;\;\;\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 < 5.7999999999999998e25Initial program 82.3%
associate--l-82.3%
+-commutative82.3%
associate--l+82.4%
+-commutative82.4%
associate--r+82.4%
metadata-eval82.4%
associate-*r*82.4%
*-commutative82.4%
associate-/l*83.3%
*-commutative83.3%
Simplified83.8%
Taylor expanded in v around 0 81.9%
unpow281.9%
*-commutative81.9%
Simplified81.9%
associate-/r/81.9%
associate-*r*93.1%
*-commutative93.1%
*-commutative93.1%
Applied egg-rr93.1%
Taylor expanded in r around 0 93.1%
*-commutative93.1%
Simplified93.1%
Taylor expanded in r around 0 72.5%
sub-neg72.5%
associate-*r/72.5%
metadata-eval72.5%
unpow272.5%
associate-/r*72.6%
metadata-eval72.6%
Simplified72.6%
if 5.7999999999999998e25 < r < 2.7999999999999999e45Initial program 69.8%
Simplified99.5%
Taylor expanded in v around inf 73.2%
*-commutative73.2%
unpow273.2%
unpow273.2%
Simplified73.2%
Taylor expanded in r around inf 73.2%
associate-*r*73.2%
unpow273.2%
unpow273.2%
Simplified73.2%
if 2.7999999999999999e45 < r < 1.8000000000000001e57Initial program 100.0%
Simplified100.0%
Taylor expanded in v around 0 100.0%
*-commutative100.0%
unpow2100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in r around 0 100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
unpow2100.0%
metadata-eval100.0%
Simplified100.0%
if 1.8000000000000001e57 < r Initial program 94.2%
Simplified86.4%
Taylor expanded in v around 0 82.5%
*-commutative82.5%
unpow282.5%
unpow282.5%
Simplified82.5%
Taylor expanded in r around inf 73.0%
*-commutative73.0%
*-commutative73.0%
associate-*l*73.0%
unpow273.0%
unpow273.0%
Simplified73.0%
Final simplification73.0%
(FPCore (v w r) :precision binary64 (if (<= r 3.8e+24) (+ -1.5 (/ (/ 2.0 r) r)) (* (* r r) (* -0.25 (* w w)))))
double code(double v, double w, double r) {
double tmp;
if (r <= 3.8e+24) {
tmp = -1.5 + ((2.0 / r) / r);
} else {
tmp = (r * r) * (-0.25 * (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 <= 3.8d+24) then
tmp = (-1.5d0) + ((2.0d0 / r) / r)
else
tmp = (r * r) * ((-0.25d0) * (w * w))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double tmp;
if (r <= 3.8e+24) {
tmp = -1.5 + ((2.0 / r) / r);
} else {
tmp = (r * r) * (-0.25 * (w * w));
}
return tmp;
}
def code(v, w, r): tmp = 0 if r <= 3.8e+24: tmp = -1.5 + ((2.0 / r) / r) else: tmp = (r * r) * (-0.25 * (w * w)) return tmp
function code(v, w, r) tmp = 0.0 if (r <= 3.8e+24) tmp = Float64(-1.5 + Float64(Float64(2.0 / r) / r)); else tmp = Float64(Float64(r * r) * Float64(-0.25 * Float64(w * w))); end return tmp end
function tmp_2 = code(v, w, r) tmp = 0.0; if (r <= 3.8e+24) tmp = -1.5 + ((2.0 / r) / r); else tmp = (r * r) * (-0.25 * (w * w)); end tmp_2 = tmp; end
code[v_, w_, r_] := If[LessEqual[r, 3.8e+24], N[(-1.5 + N[(N[(2.0 / r), $MachinePrecision] / r), $MachinePrecision]), $MachinePrecision], N[(N[(r * r), $MachinePrecision] * N[(-0.25 * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 3.8 \cdot 10^{+24}:\\
\;\;\;\;-1.5 + \frac{\frac{2}{r}}{r}\\
\mathbf{else}:\\
\;\;\;\;\left(r \cdot r\right) \cdot \left(-0.25 \cdot \left(w \cdot w\right)\right)\\
\end{array}
\end{array}
if r < 3.80000000000000015e24Initial program 82.3%
associate--l-82.3%
+-commutative82.3%
associate--l+82.4%
+-commutative82.4%
associate--r+82.4%
metadata-eval82.4%
associate-*r*82.4%
*-commutative82.4%
associate-/l*83.3%
*-commutative83.3%
Simplified83.8%
Taylor expanded in v around 0 81.9%
unpow281.9%
*-commutative81.9%
Simplified81.9%
associate-/r/81.9%
associate-*r*93.1%
*-commutative93.1%
*-commutative93.1%
Applied egg-rr93.1%
Taylor expanded in r around 0 93.1%
*-commutative93.1%
Simplified93.1%
Taylor expanded in r around 0 72.5%
sub-neg72.5%
associate-*r/72.5%
metadata-eval72.5%
unpow272.5%
associate-/r*72.6%
metadata-eval72.6%
Simplified72.6%
if 3.80000000000000015e24 < r Initial program 93.2%
Simplified87.8%
Taylor expanded in v around inf 82.2%
*-commutative82.2%
unpow282.2%
unpow282.2%
Simplified82.2%
Taylor expanded in r around inf 68.5%
associate-*r*68.5%
unpow268.5%
unpow268.5%
Simplified68.5%
Final simplification71.7%
(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 84.7%
Simplified82.5%
Taylor expanded in v around 0 80.3%
*-commutative80.3%
unpow280.3%
unpow280.3%
Simplified80.3%
Taylor expanded in r around 0 62.0%
sub-neg62.0%
associate-*r/62.0%
metadata-eval62.0%
unpow262.0%
metadata-eval62.0%
Simplified62.0%
Final simplification62.0%
(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(Float64(2.0 / 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[(N[(2.0 / r), $MachinePrecision] / r), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-1.5 + \frac{\frac{2}{r}}{r}
\end{array}
Initial program 84.7%
associate--l-84.7%
+-commutative84.7%
associate--l+84.7%
+-commutative84.7%
associate--r+84.7%
metadata-eval84.7%
associate-*r*84.7%
*-commutative84.7%
associate-/l*86.2%
*-commutative86.2%
Simplified86.6%
Taylor expanded in v around 0 84.1%
unpow284.1%
*-commutative84.1%
Simplified84.1%
associate-/r/84.0%
associate-*r*92.8%
*-commutative92.8%
*-commutative92.8%
Applied egg-rr92.8%
Taylor expanded in r around 0 92.8%
*-commutative92.8%
Simplified92.8%
Taylor expanded in r around 0 62.0%
sub-neg62.0%
associate-*r/62.0%
metadata-eval62.0%
unpow262.0%
associate-/r*62.0%
metadata-eval62.0%
Simplified62.0%
Final simplification62.0%
(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 84.7%
Simplified82.5%
Taylor expanded in v around 0 80.3%
*-commutative80.3%
unpow280.3%
unpow280.3%
Simplified80.3%
Taylor expanded in r around 0 48.7%
unpow248.7%
Simplified48.7%
Final simplification48.7%
(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(Float64(2.0 / r) / r) end
function tmp = code(v, w, r) tmp = (2.0 / r) / r; end
code[v_, w_, r_] := N[(N[(2.0 / r), $MachinePrecision] / r), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{2}{r}}{r}
\end{array}
Initial program 84.7%
associate--l-84.7%
+-commutative84.7%
associate--l+84.7%
+-commutative84.7%
associate--r+84.7%
metadata-eval84.7%
associate-*r*84.7%
*-commutative84.7%
associate-/l*86.2%
*-commutative86.2%
Simplified86.6%
Taylor expanded in v around 0 84.1%
unpow284.1%
*-commutative84.1%
Simplified84.1%
associate-/r/84.0%
associate-*r*92.8%
*-commutative92.8%
*-commutative92.8%
Applied egg-rr92.8%
Taylor expanded in r around 0 92.8%
*-commutative92.8%
Simplified92.8%
Taylor expanded in r around 0 48.7%
unpow248.7%
associate-/r*48.7%
Simplified48.7%
Final simplification48.7%
herbie shell --seed 2023274
(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))