
(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
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= (* w w) 2e+298)
(+
t_0
(- -1.5 (* (/ (+ 0.375 (* v -0.25)) (- 1.0 v)) (* r (* w (* r w))))))
(+ t_0 (- -1.5 (* 0.375 (* (* r w) (* r w))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((w * w) <= 2e+298) {
tmp = t_0 + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (w * (r * w)))));
} else {
tmp = t_0 + (-1.5 - (0.375 * ((r * w) * (r * w))));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
if ((w * w) <= 2d+298) then
tmp = t_0 + ((-1.5d0) - (((0.375d0 + (v * (-0.25d0))) / (1.0d0 - v)) * (r * (w * (r * w)))))
else
tmp = t_0 + ((-1.5d0) - (0.375d0 * ((r * w) * (r * w))))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((w * w) <= 2e+298) {
tmp = t_0 + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (w * (r * w)))));
} else {
tmp = t_0 + (-1.5 - (0.375 * ((r * w) * (r * w))));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if (w * w) <= 2e+298: tmp = t_0 + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (w * (r * w))))) else: tmp = t_0 + (-1.5 - (0.375 * ((r * w) * (r * w)))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (Float64(w * w) <= 2e+298) 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)))))); else tmp = Float64(t_0 + Float64(-1.5 - Float64(0.375 * Float64(Float64(r * w) * Float64(r * w))))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if ((w * w) <= 2e+298) tmp = t_0 + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (w * (r * w))))); else tmp = t_0 + (-1.5 - (0.375 * ((r * w) * (r * w)))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(w * w), $MachinePrecision], 2e+298], 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], N[(t$95$0 + N[(-1.5 - N[(0.375 * N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;w \cdot w \leq 2 \cdot 10^{+298}:\\
\;\;\;\;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)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - 0.375 \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 w w) < 1.9999999999999999e298Initial program 92.5%
associate--l-92.5%
+-commutative92.5%
associate--l+92.5%
+-commutative92.5%
associate--r+92.5%
metadata-eval92.5%
associate-*l/95.7%
*-commutative95.7%
*-commutative95.7%
*-commutative95.7%
Simplified95.7%
Taylor expanded in r around 0 95.7%
unpow295.7%
*-commutative95.7%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
if 1.9999999999999999e298 < (*.f64 w w) Initial program 61.6%
associate--l-61.6%
+-commutative61.6%
associate--l+61.6%
+-commutative61.6%
associate--r+61.6%
metadata-eval61.6%
associate-*l/61.6%
*-commutative61.6%
*-commutative61.6%
*-commutative61.6%
Simplified61.6%
Taylor expanded in r around 0 61.6%
unpow261.6%
*-commutative61.6%
unpow261.6%
swap-sqr99.9%
unpow299.9%
*-commutative99.9%
Simplified99.9%
unpow299.9%
Applied egg-rr99.9%
Taylor expanded in v around 0 99.9%
Final simplification99.8%
(FPCore (v w r) :precision binary64 (+ (/ 2.0 (* r r)) (- -1.5 (* (pow (* r w) 2.0) (/ (+ 0.375 (* v -0.25)) (- 1.0 v))))))
double code(double v, double w, double r) {
return (2.0 / (r * r)) + (-1.5 - (pow((r * w), 2.0) * ((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 = (2.0d0 / (r * r)) + ((-1.5d0) - (((r * w) ** 2.0d0) * ((0.375d0 + (v * (-0.25d0))) / (1.0d0 - v))))
end function
public static double code(double v, double w, double r) {
return (2.0 / (r * r)) + (-1.5 - (Math.pow((r * w), 2.0) * ((0.375 + (v * -0.25)) / (1.0 - v))));
}
def code(v, w, r): return (2.0 / (r * r)) + (-1.5 - (math.pow((r * w), 2.0) * ((0.375 + (v * -0.25)) / (1.0 - v))))
function code(v, w, r) return Float64(Float64(2.0 / Float64(r * r)) + Float64(-1.5 - Float64((Float64(r * w) ^ 2.0) * Float64(Float64(0.375 + Float64(v * -0.25)) / Float64(1.0 - v))))) end
function tmp = code(v, w, r) tmp = (2.0 / (r * r)) + (-1.5 - (((r * w) ^ 2.0) * ((0.375 + (v * -0.25)) / (1.0 - v)))); end
code[v_, w_, r_] := N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + N[(-1.5 - N[(N[Power[N[(r * w), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(0.375 + N[(v * -0.25), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{r \cdot r} + \left(-1.5 - {\left(r \cdot w\right)}^{2} \cdot \frac{0.375 + v \cdot -0.25}{1 - v}\right)
\end{array}
Initial program 86.0%
associate--l-86.0%
+-commutative86.0%
associate--l+86.0%
+-commutative86.0%
associate--r+86.0%
metadata-eval86.0%
associate-*l/88.5%
*-commutative88.5%
*-commutative88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in r around 0 80.1%
unpow280.1%
*-commutative80.1%
unpow280.1%
swap-sqr99.8%
unpow299.8%
*-commutative99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= (* w w) 0.0)
(+ t_0 (- -1.5 (* 0.375 (* r (* w (* r w))))))
(if (<= (* w w) 2e+298)
(+
t_0
(- -1.5 (* (/ (+ 0.375 (* v -0.25)) (- 1.0 v)) (* r (* r (* w w))))))
(+ t_0 (- -1.5 (* 0.375 (* (* r w) (* r w)))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((w * w) <= 0.0) {
tmp = t_0 + (-1.5 - (0.375 * (r * (w * (r * w)))));
} else if ((w * w) <= 2e+298) {
tmp = t_0 + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (r * (w * w)))));
} else {
tmp = t_0 + (-1.5 - (0.375 * ((r * w) * (r * w))));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
if ((w * w) <= 0.0d0) then
tmp = t_0 + ((-1.5d0) - (0.375d0 * (r * (w * (r * w)))))
else if ((w * w) <= 2d+298) then
tmp = t_0 + ((-1.5d0) - (((0.375d0 + (v * (-0.25d0))) / (1.0d0 - v)) * (r * (r * (w * w)))))
else
tmp = t_0 + ((-1.5d0) - (0.375d0 * ((r * w) * (r * w))))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((w * w) <= 0.0) {
tmp = t_0 + (-1.5 - (0.375 * (r * (w * (r * w)))));
} else if ((w * w) <= 2e+298) {
tmp = t_0 + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (r * (w * w)))));
} else {
tmp = t_0 + (-1.5 - (0.375 * ((r * w) * (r * w))));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if (w * w) <= 0.0: tmp = t_0 + (-1.5 - (0.375 * (r * (w * (r * w))))) elif (w * w) <= 2e+298: tmp = t_0 + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (r * (w * w))))) else: tmp = t_0 + (-1.5 - (0.375 * ((r * w) * (r * w)))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (Float64(w * w) <= 0.0) tmp = Float64(t_0 + Float64(-1.5 - Float64(0.375 * Float64(r * Float64(w * Float64(r * w)))))); elseif (Float64(w * w) <= 2e+298) 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)))))); else tmp = Float64(t_0 + Float64(-1.5 - Float64(0.375 * Float64(Float64(r * w) * Float64(r * w))))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if ((w * w) <= 0.0) tmp = t_0 + (-1.5 - (0.375 * (r * (w * (r * w))))); elseif ((w * w) <= 2e+298) tmp = t_0 + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * (r * (r * (w * w))))); else tmp = t_0 + (-1.5 - (0.375 * ((r * w) * (r * w)))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(w * w), $MachinePrecision], 0.0], N[(t$95$0 + N[(-1.5 - N[(0.375 * N[(r * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(w * w), $MachinePrecision], 2e+298], 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], N[(t$95$0 + N[(-1.5 - N[(0.375 * N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;w \cdot w \leq 0:\\
\;\;\;\;t_0 + \left(-1.5 - 0.375 \cdot \left(r \cdot \left(w \cdot \left(r \cdot w\right)\right)\right)\right)\\
\mathbf{elif}\;w \cdot w \leq 2 \cdot 10^{+298}:\\
\;\;\;\;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)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - 0.375 \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 w w) < 0.0Initial program 89.6%
associate--l-89.6%
+-commutative89.6%
associate--l+89.6%
+-commutative89.6%
associate--r+89.6%
metadata-eval89.6%
associate-*l/89.6%
*-commutative89.6%
*-commutative89.6%
*-commutative89.6%
Simplified89.6%
Taylor expanded in r around 0 89.6%
unpow289.6%
*-commutative89.6%
associate-*r*99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in v around 0 96.6%
if 0.0 < (*.f64 w w) < 1.9999999999999999e298Initial program 94.2%
associate--l-94.2%
+-commutative94.2%
associate--l+94.2%
+-commutative94.2%
associate--r+94.2%
metadata-eval94.2%
associate-*l/99.2%
*-commutative99.2%
*-commutative99.2%
*-commutative99.2%
Simplified99.2%
if 1.9999999999999999e298 < (*.f64 w w) Initial program 61.6%
associate--l-61.6%
+-commutative61.6%
associate--l+61.6%
+-commutative61.6%
associate--r+61.6%
metadata-eval61.6%
associate-*l/61.6%
*-commutative61.6%
*-commutative61.6%
*-commutative61.6%
Simplified61.6%
Taylor expanded in r around 0 61.6%
unpow261.6%
*-commutative61.6%
unpow261.6%
swap-sqr99.9%
unpow299.9%
*-commutative99.9%
Simplified99.9%
unpow299.9%
Applied egg-rr99.9%
Taylor expanded in v around 0 99.9%
Final simplification98.6%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))) (t_1 (* r (* w (* r w)))))
(if (<= v -1.5e+29)
(+ t_0 (- -1.5 (* t_1 0.25)))
(if (<= v 4.2e-13)
(+ t_0 (- -1.5 (* 0.375 (* (* r w) (* r w)))))
(+ t_0 (+ -1.5 (* t_1 (- (/ 0.125 v) 0.25))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double t_1 = r * (w * (r * w));
double tmp;
if (v <= -1.5e+29) {
tmp = t_0 + (-1.5 - (t_1 * 0.25));
} else if (v <= 4.2e-13) {
tmp = t_0 + (-1.5 - (0.375 * ((r * w) * (r * w))));
} else {
tmp = t_0 + (-1.5 + (t_1 * ((0.125 / v) - 0.25)));
}
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 = r * (w * (r * w))
if (v <= (-1.5d+29)) then
tmp = t_0 + ((-1.5d0) - (t_1 * 0.25d0))
else if (v <= 4.2d-13) then
tmp = t_0 + ((-1.5d0) - (0.375d0 * ((r * w) * (r * w))))
else
tmp = t_0 + ((-1.5d0) + (t_1 * ((0.125d0 / v) - 0.25d0)))
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 = r * (w * (r * w));
double tmp;
if (v <= -1.5e+29) {
tmp = t_0 + (-1.5 - (t_1 * 0.25));
} else if (v <= 4.2e-13) {
tmp = t_0 + (-1.5 - (0.375 * ((r * w) * (r * w))));
} else {
tmp = t_0 + (-1.5 + (t_1 * ((0.125 / v) - 0.25)));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) t_1 = r * (w * (r * w)) tmp = 0 if v <= -1.5e+29: tmp = t_0 + (-1.5 - (t_1 * 0.25)) elif v <= 4.2e-13: tmp = t_0 + (-1.5 - (0.375 * ((r * w) * (r * w)))) else: tmp = t_0 + (-1.5 + (t_1 * ((0.125 / v) - 0.25))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) t_1 = Float64(r * Float64(w * Float64(r * w))) tmp = 0.0 if (v <= -1.5e+29) tmp = Float64(t_0 + Float64(-1.5 - Float64(t_1 * 0.25))); elseif (v <= 4.2e-13) tmp = Float64(t_0 + Float64(-1.5 - Float64(0.375 * Float64(Float64(r * w) * Float64(r * w))))); else tmp = Float64(t_0 + Float64(-1.5 + Float64(t_1 * Float64(Float64(0.125 / v) - 0.25)))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); t_1 = r * (w * (r * w)); tmp = 0.0; if (v <= -1.5e+29) tmp = t_0 + (-1.5 - (t_1 * 0.25)); elseif (v <= 4.2e-13) tmp = t_0 + (-1.5 - (0.375 * ((r * w) * (r * w)))); else tmp = t_0 + (-1.5 + (t_1 * ((0.125 / v) - 0.25))); 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[(r * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[v, -1.5e+29], N[(t$95$0 + N[(-1.5 - N[(t$95$1 * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[v, 4.2e-13], N[(t$95$0 + N[(-1.5 - N[(0.375 * N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(-1.5 + N[(t$95$1 * N[(N[(0.125 / v), $MachinePrecision] - 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
t_1 := r \cdot \left(w \cdot \left(r \cdot w\right)\right)\\
\mathbf{if}\;v \leq -1.5 \cdot 10^{+29}:\\
\;\;\;\;t_0 + \left(-1.5 - t_1 \cdot 0.25\right)\\
\mathbf{elif}\;v \leq 4.2 \cdot 10^{-13}:\\
\;\;\;\;t_0 + \left(-1.5 - 0.375 \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 + t_1 \cdot \left(\frac{0.125}{v} - 0.25\right)\right)\\
\end{array}
\end{array}
if v < -1.5e29Initial program 84.0%
associate--l-84.0%
+-commutative84.0%
associate--l+84.0%
+-commutative84.0%
associate--r+84.0%
metadata-eval84.0%
associate-*l/87.3%
*-commutative87.3%
*-commutative87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in r around 0 87.3%
unpow287.3%
*-commutative87.3%
associate-*r*98.0%
*-commutative98.0%
Simplified98.0%
Taylor expanded in v around inf 98.0%
if -1.5e29 < v < 4.19999999999999977e-13Initial program 86.6%
associate--l-86.6%
+-commutative86.6%
associate--l+86.6%
+-commutative86.6%
associate--r+86.6%
metadata-eval86.6%
associate-*l/86.6%
*-commutative86.6%
*-commutative86.6%
*-commutative86.6%
Simplified86.6%
Taylor expanded in r around 0 77.4%
unpow277.4%
*-commutative77.4%
unpow277.4%
swap-sqr99.9%
unpow299.9%
*-commutative99.9%
Simplified99.9%
unpow299.9%
Applied egg-rr99.9%
Taylor expanded in v around 0 99.3%
if 4.19999999999999977e-13 < v Initial program 86.5%
associate--l-86.5%
+-commutative86.5%
associate--l+86.5%
+-commutative86.5%
associate--r+86.5%
metadata-eval86.5%
associate-*l/93.9%
*-commutative93.9%
*-commutative93.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in r around 0 93.9%
unpow293.9%
*-commutative93.9%
associate-*r*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in v around inf 96.6%
associate-*r/96.6%
metadata-eval96.6%
Simplified96.6%
Final simplification98.4%
(FPCore (v w r) :precision binary64 (+ (/ 2.0 (* r r)) (- -1.5 (* (/ (+ 0.375 (* v -0.25)) (- 1.0 v)) (* (* r w) (* r w))))))
double code(double v, double w, double r) {
return (2.0 / (r * r)) + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * ((r * w) * (r * w))));
}
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) - (((0.375d0 + (v * (-0.25d0))) / (1.0d0 - v)) * ((r * w) * (r * w))))
end function
public static double code(double v, double w, double r) {
return (2.0 / (r * r)) + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * ((r * w) * (r * w))));
}
def code(v, w, r): return (2.0 / (r * r)) + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * ((r * w) * (r * w))))
function code(v, w, r) return Float64(Float64(2.0 / Float64(r * r)) + Float64(-1.5 - Float64(Float64(Float64(0.375 + Float64(v * -0.25)) / Float64(1.0 - v)) * Float64(Float64(r * w) * Float64(r * w))))) end
function tmp = code(v, w, r) tmp = (2.0 / (r * r)) + (-1.5 - (((0.375 + (v * -0.25)) / (1.0 - v)) * ((r * w) * (r * w)))); end
code[v_, w_, r_] := 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[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{r \cdot r} + \left(-1.5 - \frac{0.375 + v \cdot -0.25}{1 - v} \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)\right)
\end{array}
Initial program 86.0%
associate--l-86.0%
+-commutative86.0%
associate--l+86.0%
+-commutative86.0%
associate--r+86.0%
metadata-eval86.0%
associate-*l/88.5%
*-commutative88.5%
*-commutative88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in r around 0 80.1%
unpow280.1%
*-commutative80.1%
unpow280.1%
swap-sqr99.8%
unpow299.8%
*-commutative99.8%
Simplified99.8%
unpow299.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (* r (* w (* r w)))) (t_1 (/ 2.0 (* r r))))
(if (or (<= v -1.35e+29) (not (<= v 8.5e-24)))
(+ t_1 (- -1.5 (* t_0 0.25)))
(+ t_1 (- -1.5 (* 0.375 t_0))))))
double code(double v, double w, double r) {
double t_0 = r * (w * (r * w));
double t_1 = 2.0 / (r * r);
double tmp;
if ((v <= -1.35e+29) || !(v <= 8.5e-24)) {
tmp = t_1 + (-1.5 - (t_0 * 0.25));
} else {
tmp = t_1 + (-1.5 - (0.375 * t_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 = r * (w * (r * w))
t_1 = 2.0d0 / (r * r)
if ((v <= (-1.35d+29)) .or. (.not. (v <= 8.5d-24))) then
tmp = t_1 + ((-1.5d0) - (t_0 * 0.25d0))
else
tmp = t_1 + ((-1.5d0) - (0.375d0 * t_0))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = r * (w * (r * w));
double t_1 = 2.0 / (r * r);
double tmp;
if ((v <= -1.35e+29) || !(v <= 8.5e-24)) {
tmp = t_1 + (-1.5 - (t_0 * 0.25));
} else {
tmp = t_1 + (-1.5 - (0.375 * t_0));
}
return tmp;
}
def code(v, w, r): t_0 = r * (w * (r * w)) t_1 = 2.0 / (r * r) tmp = 0 if (v <= -1.35e+29) or not (v <= 8.5e-24): tmp = t_1 + (-1.5 - (t_0 * 0.25)) else: tmp = t_1 + (-1.5 - (0.375 * t_0)) return tmp
function code(v, w, r) t_0 = Float64(r * Float64(w * Float64(r * w))) t_1 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if ((v <= -1.35e+29) || !(v <= 8.5e-24)) tmp = Float64(t_1 + Float64(-1.5 - Float64(t_0 * 0.25))); else tmp = Float64(t_1 + Float64(-1.5 - Float64(0.375 * t_0))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = r * (w * (r * w)); t_1 = 2.0 / (r * r); tmp = 0.0; if ((v <= -1.35e+29) || ~((v <= 8.5e-24))) tmp = t_1 + (-1.5 - (t_0 * 0.25)); else tmp = t_1 + (-1.5 - (0.375 * t_0)); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(r * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[v, -1.35e+29], N[Not[LessEqual[v, 8.5e-24]], $MachinePrecision]], N[(t$95$1 + N[(-1.5 - N[(t$95$0 * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(-1.5 - N[(0.375 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := r \cdot \left(w \cdot \left(r \cdot w\right)\right)\\
t_1 := \frac{2}{r \cdot r}\\
\mathbf{if}\;v \leq -1.35 \cdot 10^{+29} \lor \neg \left(v \leq 8.5 \cdot 10^{-24}\right):\\
\;\;\;\;t_1 + \left(-1.5 - t_0 \cdot 0.25\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(-1.5 - 0.375 \cdot t_0\right)\\
\end{array}
\end{array}
if v < -1.35e29 or 8.5000000000000002e-24 < 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-*l/90.4%
*-commutative90.4%
*-commutative90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in r around 0 90.4%
unpow290.4%
*-commutative90.4%
associate-*r*98.2%
*-commutative98.2%
Simplified98.2%
Taylor expanded in v around inf 96.4%
if -1.35e29 < v < 8.5000000000000002e-24Initial program 86.9%
associate--l-86.9%
+-commutative86.9%
associate--l+86.9%
+-commutative86.9%
associate--r+86.9%
metadata-eval86.9%
associate-*l/86.9%
*-commutative86.9%
*-commutative86.9%
*-commutative86.9%
Simplified86.9%
Taylor expanded in r around 0 86.9%
unpow286.9%
*-commutative86.9%
associate-*r*95.6%
*-commutative95.6%
Simplified95.6%
Taylor expanded in v around 0 95.0%
Final simplification95.7%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (or (<= v -4.5e+29) (not (<= v 4.2e-16)))
(+ t_0 (- -1.5 (* (* r (* w (* r w))) 0.25)))
(+ t_0 (- -1.5 (* 0.375 (* (* r w) (* r w))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((v <= -4.5e+29) || !(v <= 4.2e-16)) {
tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * 0.25));
} else {
tmp = t_0 + (-1.5 - (0.375 * ((r * w) * (r * w))));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
if ((v <= (-4.5d+29)) .or. (.not. (v <= 4.2d-16))) then
tmp = t_0 + ((-1.5d0) - ((r * (w * (r * w))) * 0.25d0))
else
tmp = t_0 + ((-1.5d0) - (0.375d0 * ((r * w) * (r * w))))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((v <= -4.5e+29) || !(v <= 4.2e-16)) {
tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * 0.25));
} else {
tmp = t_0 + (-1.5 - (0.375 * ((r * w) * (r * w))));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if (v <= -4.5e+29) or not (v <= 4.2e-16): tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * 0.25)) else: tmp = t_0 + (-1.5 - (0.375 * ((r * w) * (r * w)))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if ((v <= -4.5e+29) || !(v <= 4.2e-16)) tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(r * Float64(w * Float64(r * w))) * 0.25))); else tmp = Float64(t_0 + Float64(-1.5 - Float64(0.375 * Float64(Float64(r * w) * Float64(r * w))))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if ((v <= -4.5e+29) || ~((v <= 4.2e-16))) tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * 0.25)); else tmp = t_0 + (-1.5 - (0.375 * ((r * w) * (r * w)))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[v, -4.5e+29], N[Not[LessEqual[v, 4.2e-16]], $MachinePrecision]], N[(t$95$0 + N[(-1.5 - N[(N[(r * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(-1.5 - N[(0.375 * N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;v \leq -4.5 \cdot 10^{+29} \lor \neg \left(v \leq 4.2 \cdot 10^{-16}\right):\\
\;\;\;\;t_0 + \left(-1.5 - \left(r \cdot \left(w \cdot \left(r \cdot w\right)\right)\right) \cdot 0.25\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - 0.375 \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)\right)\\
\end{array}
\end{array}
if v < -4.5000000000000002e29 or 4.2000000000000002e-16 < v Initial program 85.7%
associate--l-85.7%
+-commutative85.7%
associate--l+85.7%
+-commutative85.7%
associate--r+85.7%
metadata-eval85.7%
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.0%
*-commutative99.0%
Simplified99.0%
Taylor expanded in v around inf 97.1%
if -4.5000000000000002e29 < v < 4.2000000000000002e-16Initial program 86.3%
associate--l-86.3%
+-commutative86.3%
associate--l+86.3%
+-commutative86.3%
associate--r+86.3%
metadata-eval86.3%
associate-*l/86.3%
*-commutative86.3%
*-commutative86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in r around 0 76.9%
unpow276.9%
*-commutative76.9%
unpow276.9%
swap-sqr99.9%
unpow299.9%
*-commutative99.9%
Simplified99.9%
unpow299.9%
Applied egg-rr99.9%
Taylor expanded in v around 0 99.3%
Final simplification98.3%
(FPCore (v w r)
:precision binary64
(if (or (<= r 8.4e+35)
(and (not (<= r 1.85e+65))
(or (<= r 1.75e+96)
(and (not (<= r 6.5e+106)) (<= r 3.9e+136)))))
(+ (/ 2.0 (* r r)) -1.5)
(/ w (/ -4.0 (* (* r r) w)))))
double code(double v, double w, double r) {
double tmp;
if ((r <= 8.4e+35) || (!(r <= 1.85e+65) && ((r <= 1.75e+96) || (!(r <= 6.5e+106) && (r <= 3.9e+136))))) {
tmp = (2.0 / (r * r)) + -1.5;
} else {
tmp = w / (-4.0 / ((r * r) * w));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: tmp
if ((r <= 8.4d+35) .or. (.not. (r <= 1.85d+65)) .and. (r <= 1.75d+96) .or. (.not. (r <= 6.5d+106)) .and. (r <= 3.9d+136)) then
tmp = (2.0d0 / (r * r)) + (-1.5d0)
else
tmp = w / ((-4.0d0) / ((r * r) * w))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double tmp;
if ((r <= 8.4e+35) || (!(r <= 1.85e+65) && ((r <= 1.75e+96) || (!(r <= 6.5e+106) && (r <= 3.9e+136))))) {
tmp = (2.0 / (r * r)) + -1.5;
} else {
tmp = w / (-4.0 / ((r * r) * w));
}
return tmp;
}
def code(v, w, r): tmp = 0 if (r <= 8.4e+35) or (not (r <= 1.85e+65) and ((r <= 1.75e+96) or (not (r <= 6.5e+106) and (r <= 3.9e+136)))): tmp = (2.0 / (r * r)) + -1.5 else: tmp = w / (-4.0 / ((r * r) * w)) return tmp
function code(v, w, r) tmp = 0.0 if ((r <= 8.4e+35) || (!(r <= 1.85e+65) && ((r <= 1.75e+96) || (!(r <= 6.5e+106) && (r <= 3.9e+136))))) tmp = Float64(Float64(2.0 / Float64(r * r)) + -1.5); else tmp = Float64(w / Float64(-4.0 / Float64(Float64(r * r) * w))); end return tmp end
function tmp_2 = code(v, w, r) tmp = 0.0; if ((r <= 8.4e+35) || (~((r <= 1.85e+65)) && ((r <= 1.75e+96) || (~((r <= 6.5e+106)) && (r <= 3.9e+136))))) tmp = (2.0 / (r * r)) + -1.5; else tmp = w / (-4.0 / ((r * r) * w)); end tmp_2 = tmp; end
code[v_, w_, r_] := If[Or[LessEqual[r, 8.4e+35], And[N[Not[LessEqual[r, 1.85e+65]], $MachinePrecision], Or[LessEqual[r, 1.75e+96], And[N[Not[LessEqual[r, 6.5e+106]], $MachinePrecision], LessEqual[r, 3.9e+136]]]]], N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision], N[(w / N[(-4.0 / N[(N[(r * r), $MachinePrecision] * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 8.4 \cdot 10^{+35} \lor \neg \left(r \leq 1.85 \cdot 10^{+65}\right) \land \left(r \leq 1.75 \cdot 10^{+96} \lor \neg \left(r \leq 6.5 \cdot 10^{+106}\right) \land r \leq 3.9 \cdot 10^{+136}\right):\\
\;\;\;\;\frac{2}{r \cdot r} + -1.5\\
\mathbf{else}:\\
\;\;\;\;\frac{w}{\frac{-4}{\left(r \cdot r\right) \cdot w}}\\
\end{array}
\end{array}
if r < 8.3999999999999996e35 or 1.84999999999999997e65 < r < 1.7499999999999999e96 or 6.5000000000000003e106 < r < 3.90000000000000019e136Initial program 85.1%
sub-neg85.1%
+-commutative85.1%
associate--l+85.1%
associate-/l*86.5%
distribute-neg-frac86.5%
associate-/r/86.5%
fma-def86.5%
sub-neg86.5%
Simplified82.0%
Taylor expanded in r around 0 67.0%
sub-neg67.0%
associate-*r/67.0%
metadata-eval67.0%
unpow267.0%
metadata-eval67.0%
Simplified67.0%
if 8.3999999999999996e35 < r < 1.84999999999999997e65 or 1.7499999999999999e96 < r < 6.5000000000000003e106 or 3.90000000000000019e136 < r Initial program 89.3%
sub-neg89.3%
+-commutative89.3%
associate--l+89.3%
associate-/l*96.3%
distribute-neg-frac96.3%
associate-/r/96.3%
fma-def96.3%
sub-neg96.3%
Simplified72.7%
Taylor expanded in r around inf 65.6%
unpow265.6%
associate-/l*67.3%
*-commutative67.3%
unpow267.3%
*-commutative67.3%
fma-neg67.3%
metadata-eval67.3%
Simplified67.3%
associate-/l*67.7%
div-inv67.8%
associate-*l*67.8%
Applied egg-rr67.8%
associate-*r/67.7%
*-rgt-identity67.7%
associate-/l/67.7%
associate-*r*67.8%
Simplified67.8%
Taylor expanded in v around inf 68.0%
unpow268.0%
Simplified68.0%
Final simplification67.2%
(FPCore (v w r) :precision binary64 (let* ((t_0 (/ 2.0 (* r r)))) (if (<= r 8e-140) 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 <= 8e-140) {
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 <= 8d-140) 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 <= 8e-140) {
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 <= 8e-140: 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 <= 8e-140) 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 <= 8e-140) 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, 8e-140], 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 8 \cdot 10^{-140}:\\
\;\;\;\;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.9999999999999999e-140Initial program 82.1%
associate--l-82.1%
+-commutative82.1%
associate--l+82.1%
+-commutative82.1%
associate--r+82.1%
metadata-eval82.1%
associate-*l/83.9%
*-commutative83.9%
*-commutative83.9%
*-commutative83.9%
Simplified83.9%
Taylor expanded in r around 0 78.0%
unpow278.0%
*-commutative78.0%
unpow278.0%
swap-sqr99.8%
unpow299.9%
*-commutative99.9%
Simplified99.9%
unpow299.8%
Applied egg-rr99.8%
Taylor expanded in v around 0 94.3%
Taylor expanded in r around 0 52.7%
unpow252.7%
Simplified52.7%
if 7.9999999999999999e-140 < r Initial program 92.3%
associate--l-92.3%
+-commutative92.3%
associate--l+92.3%
+-commutative92.3%
associate--r+92.3%
metadata-eval92.3%
associate-*l/96.0%
*-commutative96.0%
*-commutative96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in r around 0 83.3%
unpow283.3%
*-commutative83.3%
unpow283.3%
swap-sqr99.8%
unpow299.8%
*-commutative99.8%
Simplified99.8%
unpow299.8%
Applied egg-rr99.8%
add-cbrt-cube99.7%
pow399.7%
+-commutative99.7%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in v around 0 79.2%
associate-*r*79.2%
unpow279.2%
unpow279.2%
Simplified79.2%
Final simplification62.8%
(FPCore (v w r) :precision binary64 (let* ((t_0 (/ 2.0 (* r r)))) (if (<= r 8.2e-140) t_0 (+ t_0 (- -1.5 (* (* r (* r (* w w))) 0.25))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 8.2e-140) {
tmp = t_0;
} else {
tmp = t_0 + (-1.5 - ((r * (r * (w * w))) * 0.25));
}
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 <= 8.2d-140) then
tmp = t_0
else
tmp = t_0 + ((-1.5d0) - ((r * (r * (w * w))) * 0.25d0))
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 <= 8.2e-140) {
tmp = t_0;
} else {
tmp = t_0 + (-1.5 - ((r * (r * (w * w))) * 0.25));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if r <= 8.2e-140: tmp = t_0 else: tmp = t_0 + (-1.5 - ((r * (r * (w * w))) * 0.25)) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (r <= 8.2e-140) tmp = t_0; else tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(r * Float64(r * Float64(w * w))) * 0.25))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (r <= 8.2e-140) tmp = t_0; else tmp = t_0 + (-1.5 - ((r * (r * (w * w))) * 0.25)); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r, 8.2e-140], t$95$0, N[(t$95$0 + N[(-1.5 - N[(N[(r * N[(r * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 8.2 \cdot 10^{-140}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - \left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right) \cdot 0.25\right)\\
\end{array}
\end{array}
if r < 8.2000000000000003e-140Initial program 82.1%
associate--l-82.1%
+-commutative82.1%
associate--l+82.1%
+-commutative82.1%
associate--r+82.1%
metadata-eval82.1%
associate-*l/83.9%
*-commutative83.9%
*-commutative83.9%
*-commutative83.9%
Simplified83.9%
Taylor expanded in r around 0 78.0%
unpow278.0%
*-commutative78.0%
unpow278.0%
swap-sqr99.8%
unpow299.9%
*-commutative99.9%
Simplified99.9%
unpow299.8%
Applied egg-rr99.8%
Taylor expanded in v around 0 94.3%
Taylor expanded in r around 0 52.7%
unpow252.7%
Simplified52.7%
if 8.2000000000000003e-140 < r Initial program 92.3%
associate--l-92.3%
+-commutative92.3%
associate--l+92.3%
+-commutative92.3%
associate--r+92.3%
metadata-eval92.3%
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*98.0%
*-commutative98.0%
Simplified98.0%
Taylor expanded in v around inf 89.9%
Taylor expanded in w around 0 89.6%
unpow289.6%
*-commutative89.6%
Simplified89.6%
Final simplification66.8%
(FPCore (v w r) :precision binary64 (let* ((t_0 (/ 2.0 (* r r)))) (if (<= r 3.3e-155) t_0 (+ t_0 (- -1.5 (* (* r (* w (* r w))) 0.25))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 3.3e-155) {
tmp = t_0;
} else {
tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * 0.25));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
if (r <= 3.3d-155) then
tmp = t_0
else
tmp = t_0 + ((-1.5d0) - ((r * (w * (r * w))) * 0.25d0))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 3.3e-155) {
tmp = t_0;
} else {
tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * 0.25));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if r <= 3.3e-155: tmp = t_0 else: tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * 0.25)) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (r <= 3.3e-155) tmp = t_0; else tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(r * Float64(w * Float64(r * w))) * 0.25))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (r <= 3.3e-155) tmp = t_0; else tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * 0.25)); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r, 3.3e-155], t$95$0, N[(t$95$0 + N[(-1.5 - N[(N[(r * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 3.3 \cdot 10^{-155}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - \left(r \cdot \left(w \cdot \left(r \cdot w\right)\right)\right) \cdot 0.25\right)\\
\end{array}
\end{array}
if r < 3.29999999999999986e-155Initial program 82.5%
associate--l-82.5%
+-commutative82.5%
associate--l+82.5%
+-commutative82.5%
associate--r+82.5%
metadata-eval82.5%
associate-*l/84.3%
*-commutative84.3%
*-commutative84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in r around 0 78.4%
unpow278.4%
*-commutative78.4%
unpow278.4%
swap-sqr99.8%
unpow299.8%
*-commutative99.8%
Simplified99.8%
unpow299.8%
Applied egg-rr99.8%
Taylor expanded in v around 0 94.3%
Taylor expanded in r around 0 52.1%
unpow252.1%
Simplified52.1%
if 3.29999999999999986e-155 < 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-*l/95.1%
*-commutative95.1%
*-commutative95.1%
*-commutative95.1%
Simplified95.1%
Taylor expanded in r around 0 95.1%
unpow295.1%
*-commutative95.1%
associate-*r*98.0%
*-commutative98.0%
Simplified98.0%
Taylor expanded in v around inf 90.1%
Final simplification66.9%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (* (* r r) w)) (t_1 (+ (/ 2.0 (* r r)) -1.5)))
(if (<= r 1.42e+35)
t_1
(if (<= r 6e+106)
(/ w (/ -2.6666666666666665 t_0))
(if (<= r 7e+136) t_1 (/ w (/ -4.0 t_0)))))))
double code(double v, double w, double r) {
double t_0 = (r * r) * w;
double t_1 = (2.0 / (r * r)) + -1.5;
double tmp;
if (r <= 1.42e+35) {
tmp = t_1;
} else if (r <= 6e+106) {
tmp = w / (-2.6666666666666665 / t_0);
} else if (r <= 7e+136) {
tmp = t_1;
} else {
tmp = w / (-4.0 / t_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 = (r * r) * w
t_1 = (2.0d0 / (r * r)) + (-1.5d0)
if (r <= 1.42d+35) then
tmp = t_1
else if (r <= 6d+106) then
tmp = w / ((-2.6666666666666665d0) / t_0)
else if (r <= 7d+136) then
tmp = t_1
else
tmp = w / ((-4.0d0) / t_0)
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = (r * r) * w;
double t_1 = (2.0 / (r * r)) + -1.5;
double tmp;
if (r <= 1.42e+35) {
tmp = t_1;
} else if (r <= 6e+106) {
tmp = w / (-2.6666666666666665 / t_0);
} else if (r <= 7e+136) {
tmp = t_1;
} else {
tmp = w / (-4.0 / t_0);
}
return tmp;
}
def code(v, w, r): t_0 = (r * r) * w t_1 = (2.0 / (r * r)) + -1.5 tmp = 0 if r <= 1.42e+35: tmp = t_1 elif r <= 6e+106: tmp = w / (-2.6666666666666665 / t_0) elif r <= 7e+136: tmp = t_1 else: tmp = w / (-4.0 / t_0) return tmp
function code(v, w, r) t_0 = Float64(Float64(r * r) * w) t_1 = Float64(Float64(2.0 / Float64(r * r)) + -1.5) tmp = 0.0 if (r <= 1.42e+35) tmp = t_1; elseif (r <= 6e+106) tmp = Float64(w / Float64(-2.6666666666666665 / t_0)); elseif (r <= 7e+136) tmp = t_1; else tmp = Float64(w / Float64(-4.0 / t_0)); end return tmp end
function tmp_2 = code(v, w, r) t_0 = (r * r) * w; t_1 = (2.0 / (r * r)) + -1.5; tmp = 0.0; if (r <= 1.42e+35) tmp = t_1; elseif (r <= 6e+106) tmp = w / (-2.6666666666666665 / t_0); elseif (r <= 7e+136) tmp = t_1; else tmp = w / (-4.0 / t_0); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(N[(r * r), $MachinePrecision] * w), $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision]}, If[LessEqual[r, 1.42e+35], t$95$1, If[LessEqual[r, 6e+106], N[(w / N[(-2.6666666666666665 / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[r, 7e+136], t$95$1, N[(w / N[(-4.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(r \cdot r\right) \cdot w\\
t_1 := \frac{2}{r \cdot r} + -1.5\\
\mathbf{if}\;r \leq 1.42 \cdot 10^{+35}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;r \leq 6 \cdot 10^{+106}:\\
\;\;\;\;\frac{w}{\frac{-2.6666666666666665}{t_0}}\\
\mathbf{elif}\;r \leq 7 \cdot 10^{+136}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{w}{\frac{-4}{t_0}}\\
\end{array}
\end{array}
if r < 1.41999999999999991e35 or 6.0000000000000001e106 < r < 7.00000000000000002e136Initial program 84.6%
sub-neg84.6%
+-commutative84.6%
associate--l+84.6%
associate-/l*86.0%
distribute-neg-frac86.0%
associate-/r/86.0%
fma-def86.0%
sub-neg86.0%
Simplified81.3%
Taylor expanded in r around 0 66.8%
sub-neg66.8%
associate-*r/66.8%
metadata-eval66.8%
unpow266.8%
metadata-eval66.8%
Simplified66.8%
if 1.41999999999999991e35 < r < 6.0000000000000001e106Initial program 89.2%
sub-neg89.2%
+-commutative89.2%
associate--l+89.2%
associate-/l*99.9%
distribute-neg-frac99.9%
associate-/r/100.0%
fma-def100.0%
sub-neg100.0%
Simplified99.9%
Taylor expanded in r around inf 55.0%
unpow255.0%
associate-/l*60.3%
*-commutative60.3%
unpow260.3%
*-commutative60.3%
fma-neg60.3%
metadata-eval60.3%
Simplified60.3%
associate-/l*60.1%
div-inv60.3%
associate-*l*60.3%
Applied egg-rr60.3%
associate-*r/60.0%
*-rgt-identity60.0%
associate-/l/60.1%
associate-*r*60.2%
Simplified60.2%
Taylor expanded in v around 0 56.7%
unpow256.7%
Simplified56.7%
if 7.00000000000000002e136 < r Initial program 91.1%
sub-neg91.1%
+-commutative91.1%
associate--l+91.1%
associate-/l*95.5%
distribute-neg-frac95.5%
associate-/r/95.4%
fma-def95.4%
sub-neg95.4%
Simplified66.4%
Taylor expanded in r around inf 64.2%
unpow264.2%
associate-/l*64.2%
*-commutative64.2%
unpow264.2%
*-commutative64.2%
fma-neg64.2%
metadata-eval64.2%
Simplified64.2%
associate-/l*64.7%
div-inv64.7%
associate-*l*64.7%
Applied egg-rr64.7%
associate-*r/64.7%
*-rgt-identity64.7%
associate-/l/64.7%
associate-*r*64.7%
Simplified64.7%
Taylor expanded in v around inf 64.7%
unpow264.7%
Simplified64.7%
Final simplification65.8%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (+ (/ 2.0 (* r r)) -1.5)))
(if (<= r 3.15e+35)
t_0
(if (<= r 6.3e+106)
(/ w (/ -2.6666666666666665 (* (* r r) w)))
(if (<= r 3.35e+136) t_0 (/ w (/ (/ (/ -4.0 r) r) w)))))))
double code(double v, double w, double r) {
double t_0 = (2.0 / (r * r)) + -1.5;
double tmp;
if (r <= 3.15e+35) {
tmp = t_0;
} else if (r <= 6.3e+106) {
tmp = w / (-2.6666666666666665 / ((r * r) * w));
} else if (r <= 3.35e+136) {
tmp = t_0;
} else {
tmp = w / (((-4.0 / r) / 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)) + (-1.5d0)
if (r <= 3.15d+35) then
tmp = t_0
else if (r <= 6.3d+106) then
tmp = w / ((-2.6666666666666665d0) / ((r * r) * w))
else if (r <= 3.35d+136) then
tmp = t_0
else
tmp = w / ((((-4.0d0) / r) / 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)) + -1.5;
double tmp;
if (r <= 3.15e+35) {
tmp = t_0;
} else if (r <= 6.3e+106) {
tmp = w / (-2.6666666666666665 / ((r * r) * w));
} else if (r <= 3.35e+136) {
tmp = t_0;
} else {
tmp = w / (((-4.0 / r) / r) / w);
}
return tmp;
}
def code(v, w, r): t_0 = (2.0 / (r * r)) + -1.5 tmp = 0 if r <= 3.15e+35: tmp = t_0 elif r <= 6.3e+106: tmp = w / (-2.6666666666666665 / ((r * r) * w)) elif r <= 3.35e+136: tmp = t_0 else: tmp = w / (((-4.0 / r) / r) / w) return tmp
function code(v, w, r) t_0 = Float64(Float64(2.0 / Float64(r * r)) + -1.5) tmp = 0.0 if (r <= 3.15e+35) tmp = t_0; elseif (r <= 6.3e+106) tmp = Float64(w / Float64(-2.6666666666666665 / Float64(Float64(r * r) * w))); elseif (r <= 3.35e+136) tmp = t_0; else tmp = Float64(w / Float64(Float64(Float64(-4.0 / r) / r) / w)); end return tmp end
function tmp_2 = code(v, w, r) t_0 = (2.0 / (r * r)) + -1.5; tmp = 0.0; if (r <= 3.15e+35) tmp = t_0; elseif (r <= 6.3e+106) tmp = w / (-2.6666666666666665 / ((r * r) * w)); elseif (r <= 3.35e+136) tmp = t_0; else tmp = w / (((-4.0 / r) / r) / w); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision]}, If[LessEqual[r, 3.15e+35], t$95$0, If[LessEqual[r, 6.3e+106], N[(w / N[(-2.6666666666666665 / N[(N[(r * r), $MachinePrecision] * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[r, 3.35e+136], t$95$0, N[(w / N[(N[(N[(-4.0 / r), $MachinePrecision] / r), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r} + -1.5\\
\mathbf{if}\;r \leq 3.15 \cdot 10^{+35}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;r \leq 6.3 \cdot 10^{+106}:\\
\;\;\;\;\frac{w}{\frac{-2.6666666666666665}{\left(r \cdot r\right) \cdot w}}\\
\mathbf{elif}\;r \leq 3.35 \cdot 10^{+136}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{w}{\frac{\frac{\frac{-4}{r}}{r}}{w}}\\
\end{array}
\end{array}
if r < 3.14999999999999985e35 or 6.29999999999999974e106 < r < 3.35e136Initial program 84.6%
sub-neg84.6%
+-commutative84.6%
associate--l+84.6%
associate-/l*86.0%
distribute-neg-frac86.0%
associate-/r/86.0%
fma-def86.0%
sub-neg86.0%
Simplified81.3%
Taylor expanded in r around 0 66.8%
sub-neg66.8%
associate-*r/66.8%
metadata-eval66.8%
unpow266.8%
metadata-eval66.8%
Simplified66.8%
if 3.14999999999999985e35 < r < 6.29999999999999974e106Initial program 89.2%
sub-neg89.2%
+-commutative89.2%
associate--l+89.2%
associate-/l*99.9%
distribute-neg-frac99.9%
associate-/r/100.0%
fma-def100.0%
sub-neg100.0%
Simplified99.9%
Taylor expanded in r around inf 55.0%
unpow255.0%
associate-/l*60.3%
*-commutative60.3%
unpow260.3%
*-commutative60.3%
fma-neg60.3%
metadata-eval60.3%
Simplified60.3%
associate-/l*60.1%
div-inv60.3%
associate-*l*60.3%
Applied egg-rr60.3%
associate-*r/60.0%
*-rgt-identity60.0%
associate-/l/60.1%
associate-*r*60.2%
Simplified60.2%
Taylor expanded in v around 0 56.7%
unpow256.7%
Simplified56.7%
if 3.35e136 < r Initial program 91.1%
sub-neg91.1%
+-commutative91.1%
associate--l+91.1%
associate-/l*95.5%
distribute-neg-frac95.5%
associate-/r/95.4%
fma-def95.4%
sub-neg95.4%
Simplified66.4%
Taylor expanded in r around inf 64.2%
unpow264.2%
associate-/l*64.2%
*-commutative64.2%
unpow264.2%
*-commutative64.2%
fma-neg64.2%
metadata-eval64.2%
Simplified64.2%
associate-/l*64.7%
div-inv64.7%
associate-*l*64.7%
Applied egg-rr64.7%
associate-*r/64.7%
*-rgt-identity64.7%
associate-/l/64.7%
associate-*r*64.7%
Simplified64.7%
Taylor expanded in v around inf 64.7%
unpow264.7%
Simplified64.7%
Taylor expanded in w around 0 64.7%
*-commutative64.7%
associate-/r*64.7%
unpow264.7%
associate-/r*69.4%
Simplified69.4%
Final simplification66.6%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (+ (/ 2.0 (* r r)) -1.5)))
(if (<= r 3.85e+34)
t_0
(if (<= r 6e+106)
(/ (* w w) (/ -2.6666666666666665 (* r r)))
(if (<= r 3.35e+136) t_0 (/ w (/ (/ (/ -4.0 r) r) w)))))))
double code(double v, double w, double r) {
double t_0 = (2.0 / (r * r)) + -1.5;
double tmp;
if (r <= 3.85e+34) {
tmp = t_0;
} else if (r <= 6e+106) {
tmp = (w * w) / (-2.6666666666666665 / (r * r));
} else if (r <= 3.35e+136) {
tmp = t_0;
} else {
tmp = w / (((-4.0 / r) / 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)) + (-1.5d0)
if (r <= 3.85d+34) then
tmp = t_0
else if (r <= 6d+106) then
tmp = (w * w) / ((-2.6666666666666665d0) / (r * r))
else if (r <= 3.35d+136) then
tmp = t_0
else
tmp = w / ((((-4.0d0) / r) / 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)) + -1.5;
double tmp;
if (r <= 3.85e+34) {
tmp = t_0;
} else if (r <= 6e+106) {
tmp = (w * w) / (-2.6666666666666665 / (r * r));
} else if (r <= 3.35e+136) {
tmp = t_0;
} else {
tmp = w / (((-4.0 / r) / r) / w);
}
return tmp;
}
def code(v, w, r): t_0 = (2.0 / (r * r)) + -1.5 tmp = 0 if r <= 3.85e+34: tmp = t_0 elif r <= 6e+106: tmp = (w * w) / (-2.6666666666666665 / (r * r)) elif r <= 3.35e+136: tmp = t_0 else: tmp = w / (((-4.0 / r) / r) / w) return tmp
function code(v, w, r) t_0 = Float64(Float64(2.0 / Float64(r * r)) + -1.5) tmp = 0.0 if (r <= 3.85e+34) tmp = t_0; elseif (r <= 6e+106) tmp = Float64(Float64(w * w) / Float64(-2.6666666666666665 / Float64(r * r))); elseif (r <= 3.35e+136) tmp = t_0; else tmp = Float64(w / Float64(Float64(Float64(-4.0 / r) / r) / w)); end return tmp end
function tmp_2 = code(v, w, r) t_0 = (2.0 / (r * r)) + -1.5; tmp = 0.0; if (r <= 3.85e+34) tmp = t_0; elseif (r <= 6e+106) tmp = (w * w) / (-2.6666666666666665 / (r * r)); elseif (r <= 3.35e+136) tmp = t_0; else tmp = w / (((-4.0 / r) / r) / w); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision]}, If[LessEqual[r, 3.85e+34], t$95$0, If[LessEqual[r, 6e+106], N[(N[(w * w), $MachinePrecision] / N[(-2.6666666666666665 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[r, 3.35e+136], t$95$0, N[(w / N[(N[(N[(-4.0 / r), $MachinePrecision] / r), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r} + -1.5\\
\mathbf{if}\;r \leq 3.85 \cdot 10^{+34}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;r \leq 6 \cdot 10^{+106}:\\
\;\;\;\;\frac{w \cdot w}{\frac{-2.6666666666666665}{r \cdot r}}\\
\mathbf{elif}\;r \leq 3.35 \cdot 10^{+136}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{w}{\frac{\frac{\frac{-4}{r}}{r}}{w}}\\
\end{array}
\end{array}
if r < 3.8499999999999999e34 or 6.0000000000000001e106 < r < 3.35e136Initial program 84.6%
sub-neg84.6%
+-commutative84.6%
associate--l+84.6%
associate-/l*86.0%
distribute-neg-frac86.0%
associate-/r/86.0%
fma-def86.0%
sub-neg86.0%
Simplified81.3%
Taylor expanded in r around 0 66.8%
sub-neg66.8%
associate-*r/66.8%
metadata-eval66.8%
unpow266.8%
metadata-eval66.8%
Simplified66.8%
if 3.8499999999999999e34 < r < 6.0000000000000001e106Initial program 89.2%
sub-neg89.2%
+-commutative89.2%
associate--l+89.2%
associate-/l*99.9%
distribute-neg-frac99.9%
associate-/r/100.0%
fma-def100.0%
sub-neg100.0%
Simplified99.9%
Taylor expanded in r around inf 55.0%
unpow255.0%
associate-/l*60.3%
*-commutative60.3%
unpow260.3%
*-commutative60.3%
fma-neg60.3%
metadata-eval60.3%
Simplified60.3%
Taylor expanded in v around 0 56.8%
unpow256.8%
Simplified56.8%
if 3.35e136 < r Initial program 91.1%
sub-neg91.1%
+-commutative91.1%
associate--l+91.1%
associate-/l*95.5%
distribute-neg-frac95.5%
associate-/r/95.4%
fma-def95.4%
sub-neg95.4%
Simplified66.4%
Taylor expanded in r around inf 64.2%
unpow264.2%
associate-/l*64.2%
*-commutative64.2%
unpow264.2%
*-commutative64.2%
fma-neg64.2%
metadata-eval64.2%
Simplified64.2%
associate-/l*64.7%
div-inv64.7%
associate-*l*64.7%
Applied egg-rr64.7%
associate-*r/64.7%
*-rgt-identity64.7%
associate-/l/64.7%
associate-*r*64.7%
Simplified64.7%
Taylor expanded in v around inf 64.7%
unpow264.7%
Simplified64.7%
Taylor expanded in w around 0 64.7%
*-commutative64.7%
associate-/r*64.7%
unpow264.7%
associate-/r*69.4%
Simplified69.4%
Final simplification66.6%
(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 86.0%
sub-neg86.0%
+-commutative86.0%
associate--l+86.0%
associate-/l*88.5%
distribute-neg-frac88.5%
associate-/r/88.5%
fma-def88.5%
sub-neg88.5%
Simplified80.1%
Taylor expanded in r around 0 56.2%
sub-neg56.2%
associate-*r/56.2%
metadata-eval56.2%
unpow256.2%
metadata-eval56.2%
Simplified56.2%
Final simplification56.2%
(FPCore (v w r) :precision binary64 (/ 2.0 (* r r)))
double code(double v, double w, double r) {
return 2.0 / (r * r);
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
code = 2.0d0 / (r * r)
end function
public static double code(double v, double w, double r) {
return 2.0 / (r * r);
}
def code(v, w, r): return 2.0 / (r * r)
function code(v, w, r) return Float64(2.0 / Float64(r * r)) end
function tmp = code(v, w, r) tmp = 2.0 / (r * r); end
code[v_, w_, r_] := N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{r \cdot r}
\end{array}
Initial program 86.0%
associate--l-86.0%
+-commutative86.0%
associate--l+86.0%
+-commutative86.0%
associate--r+86.0%
metadata-eval86.0%
associate-*l/88.5%
*-commutative88.5%
*-commutative88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in r around 0 80.1%
unpow280.1%
*-commutative80.1%
unpow280.1%
swap-sqr99.8%
unpow299.8%
*-commutative99.8%
Simplified99.8%
unpow299.8%
Applied egg-rr99.8%
Taylor expanded in v around 0 92.7%
Taylor expanded in r around 0 41.2%
unpow241.2%
Simplified41.2%
Final simplification41.2%
herbie shell --seed 2023230
(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))