
(FPCore (v w r) :precision binary64 (- (- (+ 3.0 (/ 2.0 (* r r))) (/ (* (* 0.125 (- 3.0 (* 2.0 v))) (* (* (* w w) r) r)) (- 1.0 v))) 4.5))
double code(double v, double w, double r) {
return ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
code = ((3.0d0 + (2.0d0 / (r * r))) - (((0.125d0 * (3.0d0 - (2.0d0 * v))) * (((w * w) * r) * r)) / (1.0d0 - v))) - 4.5d0
end function
public static double code(double v, double w, double r) {
return ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5;
}
def code(v, w, r): return ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5
function code(v, w, r) return Float64(Float64(Float64(3.0 + Float64(2.0 / Float64(r * r))) - Float64(Float64(Float64(0.125 * Float64(3.0 - Float64(2.0 * v))) * Float64(Float64(Float64(w * w) * r) * r)) / Float64(1.0 - v))) - 4.5) end
function tmp = code(v, w, r) tmp = ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5; end
code[v_, w_, r_] := N[(N[(N[(3.0 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(0.125 * N[(3.0 - N[(2.0 * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(w * w), $MachinePrecision] * r), $MachinePrecision] * r), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (v w r) :precision binary64 (- (- (+ 3.0 (/ 2.0 (* r r))) (/ (* (* 0.125 (- 3.0 (* 2.0 v))) (* (* (* w w) r) r)) (- 1.0 v))) 4.5))
double code(double v, double w, double r) {
return ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
code = ((3.0d0 + (2.0d0 / (r * r))) - (((0.125d0 * (3.0d0 - (2.0d0 * v))) * (((w * w) * r) * r)) / (1.0d0 - v))) - 4.5d0
end function
public static double code(double v, double w, double r) {
return ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5;
}
def code(v, w, r): return ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5
function code(v, w, r) return Float64(Float64(Float64(3.0 + Float64(2.0 / Float64(r * r))) - Float64(Float64(Float64(0.125 * Float64(3.0 - Float64(2.0 * v))) * Float64(Float64(Float64(w * w) * r) * r)) / Float64(1.0 - v))) - 4.5) end
function tmp = code(v, w, r) tmp = ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5; end
code[v_, w_, r_] := N[(N[(N[(3.0 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(0.125 * N[(3.0 - N[(2.0 * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(w * w), $MachinePrecision] * r), $MachinePrecision] * r), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5
\end{array}
(FPCore (v w r)
:precision binary64
(let* ((t_0 (pow (* r w) 2.0)) (t_1 (+ (/ 2.0 (* r r)) -1.5)))
(if (<= v -5.5e-5)
(+ -1.5 (+ (/ (/ 2.0 r) r) (* -0.25 t_0)))
(if (<= v 2.6e-9)
(- t_1 (/ (* (* r w) 0.375) (/ (/ 1.0 r) w)))
(- t_1 (* t_0 0.25))))))
double code(double v, double w, double r) {
double t_0 = pow((r * w), 2.0);
double t_1 = (2.0 / (r * r)) + -1.5;
double tmp;
if (v <= -5.5e-5) {
tmp = -1.5 + (((2.0 / r) / r) + (-0.25 * t_0));
} else if (v <= 2.6e-9) {
tmp = t_1 - (((r * w) * 0.375) / ((1.0 / r) / w));
} else {
tmp = t_1 - (t_0 * 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 = (r * w) ** 2.0d0
t_1 = (2.0d0 / (r * r)) + (-1.5d0)
if (v <= (-5.5d-5)) then
tmp = (-1.5d0) + (((2.0d0 / r) / r) + ((-0.25d0) * t_0))
else if (v <= 2.6d-9) then
tmp = t_1 - (((r * w) * 0.375d0) / ((1.0d0 / r) / w))
else
tmp = t_1 - (t_0 * 0.25d0)
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = Math.pow((r * w), 2.0);
double t_1 = (2.0 / (r * r)) + -1.5;
double tmp;
if (v <= -5.5e-5) {
tmp = -1.5 + (((2.0 / r) / r) + (-0.25 * t_0));
} else if (v <= 2.6e-9) {
tmp = t_1 - (((r * w) * 0.375) / ((1.0 / r) / w));
} else {
tmp = t_1 - (t_0 * 0.25);
}
return tmp;
}
def code(v, w, r): t_0 = math.pow((r * w), 2.0) t_1 = (2.0 / (r * r)) + -1.5 tmp = 0 if v <= -5.5e-5: tmp = -1.5 + (((2.0 / r) / r) + (-0.25 * t_0)) elif v <= 2.6e-9: tmp = t_1 - (((r * w) * 0.375) / ((1.0 / r) / w)) else: tmp = t_1 - (t_0 * 0.25) return tmp
function code(v, w, r) t_0 = Float64(r * w) ^ 2.0 t_1 = Float64(Float64(2.0 / Float64(r * r)) + -1.5) tmp = 0.0 if (v <= -5.5e-5) tmp = Float64(-1.5 + Float64(Float64(Float64(2.0 / r) / r) + Float64(-0.25 * t_0))); elseif (v <= 2.6e-9) tmp = Float64(t_1 - Float64(Float64(Float64(r * w) * 0.375) / Float64(Float64(1.0 / r) / w))); else tmp = Float64(t_1 - Float64(t_0 * 0.25)); end return tmp end
function tmp_2 = code(v, w, r) t_0 = (r * w) ^ 2.0; t_1 = (2.0 / (r * r)) + -1.5; tmp = 0.0; if (v <= -5.5e-5) tmp = -1.5 + (((2.0 / r) / r) + (-0.25 * t_0)); elseif (v <= 2.6e-9) tmp = t_1 - (((r * w) * 0.375) / ((1.0 / r) / w)); else tmp = t_1 - (t_0 * 0.25); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[Power[N[(r * w), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision]}, If[LessEqual[v, -5.5e-5], N[(-1.5 + N[(N[(N[(2.0 / r), $MachinePrecision] / r), $MachinePrecision] + N[(-0.25 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[v, 2.6e-9], N[(t$95$1 - N[(N[(N[(r * w), $MachinePrecision] * 0.375), $MachinePrecision] / N[(N[(1.0 / r), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[(t$95$0 * 0.25), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(r \cdot w\right)}^{2}\\
t_1 := \frac{2}{r \cdot r} + -1.5\\
\mathbf{if}\;v \leq -5.5 \cdot 10^{-5}:\\
\;\;\;\;-1.5 + \left(\frac{\frac{2}{r}}{r} + -0.25 \cdot t_0\right)\\
\mathbf{elif}\;v \leq 2.6 \cdot 10^{-9}:\\
\;\;\;\;t_1 - \frac{\left(r \cdot w\right) \cdot 0.375}{\frac{\frac{1}{r}}{w}}\\
\mathbf{else}:\\
\;\;\;\;t_1 - t_0 \cdot 0.25\\
\end{array}
\end{array}
if v < -5.5000000000000002e-5Initial program 83.9%
Simplified86.9%
associate-/r*87.0%
div-inv86.9%
Applied egg-rr86.9%
un-div-inv87.0%
Applied egg-rr87.0%
Taylor expanded in v around inf 83.6%
*-commutative83.6%
unpow283.6%
unpow283.6%
swap-sqr99.8%
unpow299.8%
Simplified99.8%
if -5.5000000000000002e-5 < v < 2.6000000000000001e-9Initial program 90.6%
Simplified98.1%
Taylor expanded in v around 0 83.9%
*-commutative83.9%
unpow283.9%
unpow283.9%
swap-sqr99.7%
unpow299.7%
Simplified99.7%
unpow299.7%
Applied egg-rr99.7%
*-commutative99.7%
pow299.7%
metadata-eval99.7%
pow-div99.7%
pow199.7%
inv-pow99.7%
associate-*r/99.8%
associate-/r*99.8%
Applied egg-rr99.8%
if 2.6000000000000001e-9 < v Initial program 78.0%
Simplified96.2%
associate-*l/86.9%
associate-/l*96.3%
associate-*r*99.8%
pow299.8%
Applied egg-rr99.8%
unpow299.8%
/-rgt-identity99.8%
/-rgt-identity99.8%
associate-/l*99.9%
frac-times95.2%
*-un-lft-identity95.2%
Applied egg-rr95.2%
Taylor expanded in v around inf 72.6%
unpow272.6%
unpow272.6%
swap-sqr99.8%
unpow299.8%
Simplified99.8%
Final simplification99.8%
(FPCore (v w r)
:precision binary64
(if (<= (* w w) 2e+270)
(-
(+ (/ 2.0 (* r r)) -1.5)
(* (fma v -0.25 0.375) (/ (* r (* w (* r w))) (- 1.0 v))))
(+ -1.5 (+ (/ (/ 2.0 r) r) (* -0.25 (pow (* r w) 2.0))))))
double code(double v, double w, double r) {
double tmp;
if ((w * w) <= 2e+270) {
tmp = ((2.0 / (r * r)) + -1.5) - (fma(v, -0.25, 0.375) * ((r * (w * (r * w))) / (1.0 - v)));
} else {
tmp = -1.5 + (((2.0 / r) / r) + (-0.25 * pow((r * w), 2.0)));
}
return tmp;
}
function code(v, w, r) tmp = 0.0 if (Float64(w * w) <= 2e+270) tmp = Float64(Float64(Float64(2.0 / Float64(r * r)) + -1.5) - Float64(fma(v, -0.25, 0.375) * Float64(Float64(r * Float64(w * Float64(r * w))) / Float64(1.0 - v)))); else tmp = Float64(-1.5 + Float64(Float64(Float64(2.0 / r) / r) + Float64(-0.25 * (Float64(r * w) ^ 2.0)))); end return tmp end
code[v_, w_, r_] := If[LessEqual[N[(w * w), $MachinePrecision], 2e+270], N[(N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision] - N[(N[(v * -0.25 + 0.375), $MachinePrecision] * N[(N[(r * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.5 + N[(N[(N[(2.0 / r), $MachinePrecision] / r), $MachinePrecision] + N[(-0.25 * N[Power[N[(r * w), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \cdot w \leq 2 \cdot 10^{+270}:\\
\;\;\;\;\left(\frac{2}{r \cdot r} + -1.5\right) - \mathsf{fma}\left(v, -0.25, 0.375\right) \cdot \frac{r \cdot \left(w \cdot \left(r \cdot w\right)\right)}{1 - v}\\
\mathbf{else}:\\
\;\;\;\;-1.5 + \left(\frac{\frac{2}{r}}{r} + -0.25 \cdot {\left(r \cdot w\right)}^{2}\right)\\
\end{array}
\end{array}
if (*.f64 w w) < 2.0000000000000001e270Initial program 93.4%
Simplified99.7%
if 2.0000000000000001e270 < (*.f64 w w) Initial program 66.9%
Simplified69.2%
associate-/r*69.2%
div-inv69.2%
Applied egg-rr69.2%
un-div-inv69.2%
Applied egg-rr69.2%
Taylor expanded in v around inf 69.2%
*-commutative69.2%
unpow269.2%
unpow269.2%
swap-sqr99.9%
unpow299.9%
Simplified99.9%
Final simplification99.8%
(FPCore (v w r)
:precision binary64
(if (<= r 4e-56)
(+ -1.5 (+ (/ (/ 2.0 r) r) (* -0.25 (pow (* r w) 2.0))))
(-
(+ (/ 2.0 (* r r)) -1.5)
(* r (* w (* (fma v -0.25 0.375) (* r (/ w (- 1.0 v)))))))))
double code(double v, double w, double r) {
double tmp;
if (r <= 4e-56) {
tmp = -1.5 + (((2.0 / r) / r) + (-0.25 * pow((r * w), 2.0)));
} else {
tmp = ((2.0 / (r * r)) + -1.5) - (r * (w * (fma(v, -0.25, 0.375) * (r * (w / (1.0 - v))))));
}
return tmp;
}
function code(v, w, r) tmp = 0.0 if (r <= 4e-56) tmp = Float64(-1.5 + Float64(Float64(Float64(2.0 / r) / r) + Float64(-0.25 * (Float64(r * w) ^ 2.0)))); else tmp = Float64(Float64(Float64(2.0 / Float64(r * r)) + -1.5) - Float64(r * Float64(w * Float64(fma(v, -0.25, 0.375) * Float64(r * Float64(w / Float64(1.0 - v))))))); end return tmp end
code[v_, w_, r_] := If[LessEqual[r, 4e-56], N[(-1.5 + N[(N[(N[(2.0 / r), $MachinePrecision] / r), $MachinePrecision] + N[(-0.25 * N[Power[N[(r * w), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision] - N[(r * N[(w * N[(N[(v * -0.25 + 0.375), $MachinePrecision] * N[(r * N[(w / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 4 \cdot 10^{-56}:\\
\;\;\;\;-1.5 + \left(\frac{\frac{2}{r}}{r} + -0.25 \cdot {\left(r \cdot w\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{2}{r \cdot r} + -1.5\right) - r \cdot \left(w \cdot \left(\mathsf{fma}\left(v, -0.25, 0.375\right) \cdot \left(r \cdot \frac{w}{1 - v}\right)\right)\right)\\
\end{array}
\end{array}
if r < 4.0000000000000002e-56Initial program 82.5%
Simplified84.0%
associate-/r*84.1%
div-inv84.0%
Applied egg-rr84.0%
un-div-inv84.1%
Applied egg-rr84.1%
Taylor expanded in v around inf 78.1%
*-commutative78.1%
unpow278.1%
unpow278.1%
swap-sqr95.6%
unpow295.6%
Simplified95.6%
if 4.0000000000000002e-56 < r Initial program 91.9%
Simplified99.7%
associate-*l/93.3%
associate-/l*99.7%
associate-*r*99.7%
pow299.7%
Applied egg-rr99.7%
associate-/r/99.7%
unpow299.7%
associate-*r/99.7%
associate-*l*99.7%
associate-*l*99.7%
*-un-lft-identity99.7%
times-frac99.3%
/-rgt-identity99.3%
Applied egg-rr99.3%
Final simplification96.6%
(FPCore (v w r) :precision binary64 (- (+ (/ 2.0 (* r r)) -1.5) (* (* (* r w) (/ (* r w) (- 1.0 v))) (fma v -0.25 0.375))))
double code(double v, double w, double r) {
return ((2.0 / (r * r)) + -1.5) - (((r * w) * ((r * w) / (1.0 - v))) * fma(v, -0.25, 0.375));
}
function code(v, w, r) return Float64(Float64(Float64(2.0 / Float64(r * r)) + -1.5) - Float64(Float64(Float64(r * w) * Float64(Float64(r * w) / Float64(1.0 - v))) * fma(v, -0.25, 0.375))) end
code[v_, w_, r_] := N[(N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision] - N[(N[(N[(r * w), $MachinePrecision] * N[(N[(r * w), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(v * -0.25 + 0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{2}{r \cdot r} + -1.5\right) - \left(\left(r \cdot w\right) \cdot \frac{r \cdot w}{1 - v}\right) \cdot \mathsf{fma}\left(v, -0.25, 0.375\right)
\end{array}
Initial program 85.2%
Simplified96.8%
associate-*r*99.8%
*-un-lft-identity99.8%
times-frac99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (v w r) :precision binary64 (if (<= r 85000.0) (+ -1.5 (+ (/ (/ 2.0 r) r) (* -0.25 (pow (* r w) 2.0)))) (- -1.5 (* (* (* r w) (/ (* r w) (- 1.0 v))) (fma v -0.25 0.375)))))
double code(double v, double w, double r) {
double tmp;
if (r <= 85000.0) {
tmp = -1.5 + (((2.0 / r) / r) + (-0.25 * pow((r * w), 2.0)));
} else {
tmp = -1.5 - (((r * w) * ((r * w) / (1.0 - v))) * fma(v, -0.25, 0.375));
}
return tmp;
}
function code(v, w, r) tmp = 0.0 if (r <= 85000.0) tmp = Float64(-1.5 + Float64(Float64(Float64(2.0 / r) / r) + Float64(-0.25 * (Float64(r * w) ^ 2.0)))); else tmp = Float64(-1.5 - Float64(Float64(Float64(r * w) * Float64(Float64(r * w) / Float64(1.0 - v))) * fma(v, -0.25, 0.375))); end return tmp end
code[v_, w_, r_] := If[LessEqual[r, 85000.0], N[(-1.5 + N[(N[(N[(2.0 / r), $MachinePrecision] / r), $MachinePrecision] + N[(-0.25 * N[Power[N[(r * w), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.5 - N[(N[(N[(r * w), $MachinePrecision] * N[(N[(r * w), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(v * -0.25 + 0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 85000:\\
\;\;\;\;-1.5 + \left(\frac{\frac{2}{r}}{r} + -0.25 \cdot {\left(r \cdot w\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;-1.5 - \left(\left(r \cdot w\right) \cdot \frac{r \cdot w}{1 - v}\right) \cdot \mathsf{fma}\left(v, -0.25, 0.375\right)\\
\end{array}
\end{array}
if r < 85000Initial program 83.1%
Simplified85.0%
associate-/r*85.0%
div-inv84.9%
Applied egg-rr84.9%
un-div-inv85.0%
Applied egg-rr85.0%
Taylor expanded in v around inf 78.6%
*-commutative78.6%
unpow278.6%
unpow278.6%
swap-sqr95.0%
unpow295.0%
Simplified95.0%
if 85000 < r Initial program 92.0%
Simplified99.8%
associate-*r*99.7%
*-un-lft-identity99.7%
times-frac99.7%
Applied egg-rr99.7%
Taylor expanded in r around inf 99.7%
Final simplification96.1%
(FPCore (v w r) :precision binary64 (if (or (<= v -5.5e-5) (not (<= v 5e+29))) (+ -1.5 (+ (/ (/ 2.0 r) r) (* -0.25 (pow (* r w) 2.0)))) (- (+ (/ 2.0 (* r r)) -1.5) (/ (* (* r w) 0.375) (/ (/ 1.0 r) w)))))
double code(double v, double w, double r) {
double tmp;
if ((v <= -5.5e-5) || !(v <= 5e+29)) {
tmp = -1.5 + (((2.0 / r) / r) + (-0.25 * pow((r * w), 2.0)));
} else {
tmp = ((2.0 / (r * r)) + -1.5) - (((r * w) * 0.375) / ((1.0 / 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 ((v <= (-5.5d-5)) .or. (.not. (v <= 5d+29))) then
tmp = (-1.5d0) + (((2.0d0 / r) / r) + ((-0.25d0) * ((r * w) ** 2.0d0)))
else
tmp = ((2.0d0 / (r * r)) + (-1.5d0)) - (((r * w) * 0.375d0) / ((1.0d0 / r) / w))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double tmp;
if ((v <= -5.5e-5) || !(v <= 5e+29)) {
tmp = -1.5 + (((2.0 / r) / r) + (-0.25 * Math.pow((r * w), 2.0)));
} else {
tmp = ((2.0 / (r * r)) + -1.5) - (((r * w) * 0.375) / ((1.0 / r) / w));
}
return tmp;
}
def code(v, w, r): tmp = 0 if (v <= -5.5e-5) or not (v <= 5e+29): tmp = -1.5 + (((2.0 / r) / r) + (-0.25 * math.pow((r * w), 2.0))) else: tmp = ((2.0 / (r * r)) + -1.5) - (((r * w) * 0.375) / ((1.0 / r) / w)) return tmp
function code(v, w, r) tmp = 0.0 if ((v <= -5.5e-5) || !(v <= 5e+29)) tmp = Float64(-1.5 + Float64(Float64(Float64(2.0 / r) / r) + Float64(-0.25 * (Float64(r * w) ^ 2.0)))); else tmp = Float64(Float64(Float64(2.0 / Float64(r * r)) + -1.5) - Float64(Float64(Float64(r * w) * 0.375) / Float64(Float64(1.0 / r) / w))); end return tmp end
function tmp_2 = code(v, w, r) tmp = 0.0; if ((v <= -5.5e-5) || ~((v <= 5e+29))) tmp = -1.5 + (((2.0 / r) / r) + (-0.25 * ((r * w) ^ 2.0))); else tmp = ((2.0 / (r * r)) + -1.5) - (((r * w) * 0.375) / ((1.0 / r) / w)); end tmp_2 = tmp; end
code[v_, w_, r_] := If[Or[LessEqual[v, -5.5e-5], N[Not[LessEqual[v, 5e+29]], $MachinePrecision]], N[(-1.5 + N[(N[(N[(2.0 / r), $MachinePrecision] / r), $MachinePrecision] + N[(-0.25 * N[Power[N[(r * w), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision] - N[(N[(N[(r * w), $MachinePrecision] * 0.375), $MachinePrecision] / N[(N[(1.0 / r), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -5.5 \cdot 10^{-5} \lor \neg \left(v \leq 5 \cdot 10^{+29}\right):\\
\;\;\;\;-1.5 + \left(\frac{\frac{2}{r}}{r} + -0.25 \cdot {\left(r \cdot w\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{2}{r \cdot r} + -1.5\right) - \frac{\left(r \cdot w\right) \cdot 0.375}{\frac{\frac{1}{r}}{w}}\\
\end{array}
\end{array}
if v < -5.5000000000000002e-5 or 5.0000000000000001e29 < v Initial program 80.0%
Simplified85.2%
associate-/r*85.2%
div-inv85.1%
Applied egg-rr85.1%
un-div-inv85.2%
Applied egg-rr85.2%
Taylor expanded in v around inf 76.6%
*-commutative76.6%
unpow276.6%
unpow276.6%
swap-sqr99.8%
unpow299.8%
Simplified99.8%
if -5.5000000000000002e-5 < v < 5.0000000000000001e29Initial program 90.5%
Simplified98.2%
Taylor expanded in v around 0 84.3%
*-commutative84.3%
unpow284.3%
unpow284.3%
swap-sqr99.7%
unpow299.7%
Simplified99.7%
unpow299.7%
Applied egg-rr99.7%
*-commutative99.7%
pow299.7%
metadata-eval99.7%
pow-div99.7%
pow199.7%
inv-pow99.7%
associate-*r/99.8%
associate-/r*99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (v w r)
:precision binary64
(if (<= (* w w) 4e+306)
(+
-1.5
(+
(/ 2.0 (* r r))
(* (/ (+ -0.375 (* v 0.25)) (- 1.0 v)) (* r (* r (* w w))))))
(- (+ -1.5 (/ (/ 2.0 r) r)) (* 0.375 (* (* r w) (* r w))))))
double code(double v, double w, double r) {
double tmp;
if ((w * w) <= 4e+306) {
tmp = -1.5 + ((2.0 / (r * r)) + (((-0.375 + (v * 0.25)) / (1.0 - v)) * (r * (r * (w * w)))));
} else {
tmp = (-1.5 + ((2.0 / r) / r)) - (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) :: tmp
if ((w * w) <= 4d+306) then
tmp = (-1.5d0) + ((2.0d0 / (r * r)) + ((((-0.375d0) + (v * 0.25d0)) / (1.0d0 - v)) * (r * (r * (w * w)))))
else
tmp = ((-1.5d0) + ((2.0d0 / r) / r)) - (0.375d0 * ((r * w) * (r * w)))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double tmp;
if ((w * w) <= 4e+306) {
tmp = -1.5 + ((2.0 / (r * r)) + (((-0.375 + (v * 0.25)) / (1.0 - v)) * (r * (r * (w * w)))));
} else {
tmp = (-1.5 + ((2.0 / r) / r)) - (0.375 * ((r * w) * (r * w)));
}
return tmp;
}
def code(v, w, r): tmp = 0 if (w * w) <= 4e+306: tmp = -1.5 + ((2.0 / (r * r)) + (((-0.375 + (v * 0.25)) / (1.0 - v)) * (r * (r * (w * w))))) else: tmp = (-1.5 + ((2.0 / r) / r)) - (0.375 * ((r * w) * (r * w))) return tmp
function code(v, w, r) tmp = 0.0 if (Float64(w * w) <= 4e+306) tmp = Float64(-1.5 + Float64(Float64(2.0 / Float64(r * r)) + Float64(Float64(Float64(-0.375 + Float64(v * 0.25)) / Float64(1.0 - v)) * Float64(r * Float64(r * Float64(w * w)))))); else tmp = Float64(Float64(-1.5 + Float64(Float64(2.0 / r) / r)) - Float64(0.375 * Float64(Float64(r * w) * Float64(r * w)))); end return tmp end
function tmp_2 = code(v, w, r) tmp = 0.0; if ((w * w) <= 4e+306) tmp = -1.5 + ((2.0 / (r * r)) + (((-0.375 + (v * 0.25)) / (1.0 - v)) * (r * (r * (w * w))))); else tmp = (-1.5 + ((2.0 / r) / r)) - (0.375 * ((r * w) * (r * w))); end tmp_2 = tmp; end
code[v_, w_, r_] := If[LessEqual[N[(w * w), $MachinePrecision], 4e+306], N[(-1.5 + N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + 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[(N[(-1.5 + N[(N[(2.0 / r), $MachinePrecision] / r), $MachinePrecision]), $MachinePrecision] - N[(0.375 * N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \cdot w \leq 4 \cdot 10^{+306}:\\
\;\;\;\;-1.5 + \left(\frac{2}{r \cdot r} + \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}:\\
\;\;\;\;\left(-1.5 + \frac{\frac{2}{r}}{r}\right) - 0.375 \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)\\
\end{array}
\end{array}
if (*.f64 w w) < 4.00000000000000007e306Initial program 92.7%
Simplified96.4%
if 4.00000000000000007e306 < (*.f64 w w) Initial program 66.7%
Simplified89.4%
Taylor expanded in v around 0 66.7%
*-commutative66.7%
unpow266.7%
unpow266.7%
swap-sqr95.7%
unpow295.7%
Simplified95.7%
unpow295.7%
Applied egg-rr95.7%
clear-num95.7%
associate-/r/95.7%
pow295.7%
pow-flip95.7%
metadata-eval95.7%
Applied egg-rr95.7%
*-commutative95.7%
metadata-eval95.7%
pow-prod-up95.7%
inv-pow95.7%
inv-pow95.7%
associate-*r*95.7%
div-inv95.7%
un-div-inv95.7%
Applied egg-rr95.7%
Final simplification96.2%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ (/ 2.0 r) r)))
(if (<= (* w w) 4e+306)
(+
-1.5
(+ t_0 (* (/ (+ -0.375 (* v 0.25)) (- 1.0 v)) (* r (* r (* w w))))))
(- (+ -1.5 t_0) (* 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) <= 4e+306) {
tmp = -1.5 + (t_0 + (((-0.375 + (v * 0.25)) / (1.0 - v)) * (r * (r * (w * w)))));
} else {
tmp = (-1.5 + t_0) - (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) <= 4d+306) then
tmp = (-1.5d0) + (t_0 + ((((-0.375d0) + (v * 0.25d0)) / (1.0d0 - v)) * (r * (r * (w * w)))))
else
tmp = ((-1.5d0) + t_0) - (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) <= 4e+306) {
tmp = -1.5 + (t_0 + (((-0.375 + (v * 0.25)) / (1.0 - v)) * (r * (r * (w * w)))));
} else {
tmp = (-1.5 + t_0) - (0.375 * ((r * w) * (r * w)));
}
return tmp;
}
def code(v, w, r): t_0 = (2.0 / r) / r tmp = 0 if (w * w) <= 4e+306: tmp = -1.5 + (t_0 + (((-0.375 + (v * 0.25)) / (1.0 - v)) * (r * (r * (w * w))))) else: tmp = (-1.5 + t_0) - (0.375 * ((r * w) * (r * w))) return tmp
function code(v, w, r) t_0 = Float64(Float64(2.0 / r) / r) tmp = 0.0 if (Float64(w * w) <= 4e+306) tmp = Float64(-1.5 + Float64(t_0 + Float64(Float64(Float64(-0.375 + Float64(v * 0.25)) / Float64(1.0 - v)) * Float64(r * Float64(r * Float64(w * w)))))); else tmp = Float64(Float64(-1.5 + t_0) - 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) <= 4e+306) tmp = -1.5 + (t_0 + (((-0.375 + (v * 0.25)) / (1.0 - v)) * (r * (r * (w * w))))); else tmp = (-1.5 + t_0) - (0.375 * ((r * w) * (r * w))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(N[(2.0 / r), $MachinePrecision] / r), $MachinePrecision]}, If[LessEqual[N[(w * w), $MachinePrecision], 4e+306], N[(-1.5 + N[(t$95$0 + 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[(N[(-1.5 + t$95$0), $MachinePrecision] - N[(0.375 * N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{2}{r}}{r}\\
\mathbf{if}\;w \cdot w \leq 4 \cdot 10^{+306}:\\
\;\;\;\;-1.5 + \left(t_0 + \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}:\\
\;\;\;\;\left(-1.5 + t_0\right) - 0.375 \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)\\
\end{array}
\end{array}
if (*.f64 w w) < 4.00000000000000007e306Initial program 92.7%
Simplified96.4%
associate-/r*96.4%
div-inv96.3%
Applied egg-rr96.3%
un-div-inv96.4%
Applied egg-rr96.4%
if 4.00000000000000007e306 < (*.f64 w w) Initial program 66.7%
Simplified89.4%
Taylor expanded in v around 0 66.7%
*-commutative66.7%
unpow266.7%
unpow266.7%
swap-sqr95.7%
unpow295.7%
Simplified95.7%
unpow295.7%
Applied egg-rr95.7%
clear-num95.7%
associate-/r/95.7%
pow295.7%
pow-flip95.7%
metadata-eval95.7%
Applied egg-rr95.7%
*-commutative95.7%
metadata-eval95.7%
pow-prod-up95.7%
inv-pow95.7%
inv-pow95.7%
associate-*r*95.7%
div-inv95.7%
un-div-inv95.7%
Applied egg-rr95.7%
Final simplification96.2%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (+ (/ 2.0 (* r r)) -1.5)))
(if (or (<= v -14200000000.0) (not (<= v 2e-12)))
(- t_0 (* r (* w (* w (* r 0.25)))))
(- t_0 (/ (* (* r w) 0.375) (/ (/ 1.0 r) w))))))
double code(double v, double w, double r) {
double t_0 = (2.0 / (r * r)) + -1.5;
double tmp;
if ((v <= -14200000000.0) || !(v <= 2e-12)) {
tmp = t_0 - (r * (w * (w * (r * 0.25))));
} else {
tmp = t_0 - (((r * w) * 0.375) / ((1.0 / 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 ((v <= (-14200000000.0d0)) .or. (.not. (v <= 2d-12))) then
tmp = t_0 - (r * (w * (w * (r * 0.25d0))))
else
tmp = t_0 - (((r * w) * 0.375d0) / ((1.0d0 / 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 ((v <= -14200000000.0) || !(v <= 2e-12)) {
tmp = t_0 - (r * (w * (w * (r * 0.25))));
} else {
tmp = t_0 - (((r * w) * 0.375) / ((1.0 / r) / w));
}
return tmp;
}
def code(v, w, r): t_0 = (2.0 / (r * r)) + -1.5 tmp = 0 if (v <= -14200000000.0) or not (v <= 2e-12): tmp = t_0 - (r * (w * (w * (r * 0.25)))) else: tmp = t_0 - (((r * w) * 0.375) / ((1.0 / r) / w)) return tmp
function code(v, w, r) t_0 = Float64(Float64(2.0 / Float64(r * r)) + -1.5) tmp = 0.0 if ((v <= -14200000000.0) || !(v <= 2e-12)) tmp = Float64(t_0 - Float64(r * Float64(w * Float64(w * Float64(r * 0.25))))); else tmp = Float64(t_0 - Float64(Float64(Float64(r * w) * 0.375) / Float64(Float64(1.0 / 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 ((v <= -14200000000.0) || ~((v <= 2e-12))) tmp = t_0 - (r * (w * (w * (r * 0.25)))); else tmp = t_0 - (((r * w) * 0.375) / ((1.0 / 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[Or[LessEqual[v, -14200000000.0], N[Not[LessEqual[v, 2e-12]], $MachinePrecision]], N[(t$95$0 - N[(r * N[(w * N[(w * N[(r * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 - N[(N[(N[(r * w), $MachinePrecision] * 0.375), $MachinePrecision] / N[(N[(1.0 / r), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r} + -1.5\\
\mathbf{if}\;v \leq -14200000000 \lor \neg \left(v \leq 2 \cdot 10^{-12}\right):\\
\;\;\;\;t_0 - r \cdot \left(w \cdot \left(w \cdot \left(r \cdot 0.25\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 - \frac{\left(r \cdot w\right) \cdot 0.375}{\frac{\frac{1}{r}}{w}}\\
\end{array}
\end{array}
if v < -1.42e10 or 1.99999999999999996e-12 < v Initial program 80.0%
Simplified95.5%
associate-*l/88.0%
associate-/l*95.6%
associate-*r*99.8%
pow299.8%
Applied egg-rr99.8%
associate-/r/99.8%
unpow299.8%
associate-*r/99.8%
associate-*l*99.8%
associate-*l*95.6%
*-un-lft-identity95.6%
times-frac93.9%
/-rgt-identity93.9%
Applied egg-rr93.9%
Taylor expanded in v around inf 95.6%
associate-*r*95.6%
Simplified95.6%
if -1.42e10 < v < 1.99999999999999996e-12Initial program 90.9%
Simplified98.1%
Taylor expanded in v around 0 84.4%
*-commutative84.4%
unpow284.4%
unpow284.4%
swap-sqr99.7%
unpow299.7%
Simplified99.7%
unpow299.7%
Applied egg-rr99.7%
*-commutative99.7%
pow299.7%
metadata-eval99.7%
pow-div99.7%
pow199.7%
inv-pow99.7%
associate-*r/99.7%
associate-/r*99.8%
Applied egg-rr99.8%
Final simplification97.6%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (+ (/ 2.0 (* r r)) -1.5)))
(if (or (<= v -2100000000.0) (not (<= v 2.6e-9)))
(- t_0 (* r (* w (* w (* r 0.25)))))
(- t_0 (* r (* w (* (* r w) 0.375)))))))
double code(double v, double w, double r) {
double t_0 = (2.0 / (r * r)) + -1.5;
double tmp;
if ((v <= -2100000000.0) || !(v <= 2.6e-9)) {
tmp = t_0 - (r * (w * (w * (r * 0.25))));
} else {
tmp = t_0 - (r * (w * ((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)) + (-1.5d0)
if ((v <= (-2100000000.0d0)) .or. (.not. (v <= 2.6d-9))) then
tmp = t_0 - (r * (w * (w * (r * 0.25d0))))
else
tmp = t_0 - (r * (w * ((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)) + -1.5;
double tmp;
if ((v <= -2100000000.0) || !(v <= 2.6e-9)) {
tmp = t_0 - (r * (w * (w * (r * 0.25))));
} else {
tmp = t_0 - (r * (w * ((r * w) * 0.375)));
}
return tmp;
}
def code(v, w, r): t_0 = (2.0 / (r * r)) + -1.5 tmp = 0 if (v <= -2100000000.0) or not (v <= 2.6e-9): tmp = t_0 - (r * (w * (w * (r * 0.25)))) else: tmp = t_0 - (r * (w * ((r * w) * 0.375))) return tmp
function code(v, w, r) t_0 = Float64(Float64(2.0 / Float64(r * r)) + -1.5) tmp = 0.0 if ((v <= -2100000000.0) || !(v <= 2.6e-9)) tmp = Float64(t_0 - Float64(r * Float64(w * Float64(w * Float64(r * 0.25))))); else tmp = Float64(t_0 - Float64(r * Float64(w * Float64(Float64(r * w) * 0.375)))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = (2.0 / (r * r)) + -1.5; tmp = 0.0; if ((v <= -2100000000.0) || ~((v <= 2.6e-9))) tmp = t_0 - (r * (w * (w * (r * 0.25)))); else tmp = t_0 - (r * (w * ((r * w) * 0.375))); 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[Or[LessEqual[v, -2100000000.0], N[Not[LessEqual[v, 2.6e-9]], $MachinePrecision]], N[(t$95$0 - N[(r * N[(w * N[(w * N[(r * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 - N[(r * N[(w * N[(N[(r * w), $MachinePrecision] * 0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r} + -1.5\\
\mathbf{if}\;v \leq -2100000000 \lor \neg \left(v \leq 2.6 \cdot 10^{-9}\right):\\
\;\;\;\;t_0 - r \cdot \left(w \cdot \left(w \cdot \left(r \cdot 0.25\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 - r \cdot \left(w \cdot \left(\left(r \cdot w\right) \cdot 0.375\right)\right)\\
\end{array}
\end{array}
if v < -2.1e9 or 2.6000000000000001e-9 < v Initial program 80.0%
Simplified95.5%
associate-*l/88.0%
associate-/l*95.6%
associate-*r*99.8%
pow299.8%
Applied egg-rr99.8%
associate-/r/99.8%
unpow299.8%
associate-*r/99.8%
associate-*l*99.8%
associate-*l*95.6%
*-un-lft-identity95.6%
times-frac93.9%
/-rgt-identity93.9%
Applied egg-rr93.9%
Taylor expanded in v around inf 95.6%
associate-*r*95.6%
Simplified95.6%
if -2.1e9 < v < 2.6000000000000001e-9Initial program 90.9%
Simplified98.1%
associate-*l/98.1%
associate-/l*98.1%
associate-*r*99.7%
pow299.7%
Applied egg-rr99.7%
associate-/r/99.7%
unpow299.7%
associate-*r/99.7%
associate-*l*99.8%
associate-*l*98.1%
*-un-lft-identity98.1%
times-frac98.1%
/-rgt-identity98.1%
Applied egg-rr98.1%
Taylor expanded in v around 0 98.1%
Final simplification96.8%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (+ (/ 2.0 (* r r)) -1.5)))
(if (or (<= v -5e+15) (not (<= v 2.6e-9)))
(- t_0 (* r (* w (* w (* r 0.25)))))
(- t_0 (* 0.375 (* (* r w) (* r w)))))))
double code(double v, double w, double r) {
double t_0 = (2.0 / (r * r)) + -1.5;
double tmp;
if ((v <= -5e+15) || !(v <= 2.6e-9)) {
tmp = t_0 - (r * (w * (w * (r * 0.25))));
} else {
tmp = t_0 - (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)) + (-1.5d0)
if ((v <= (-5d+15)) .or. (.not. (v <= 2.6d-9))) then
tmp = t_0 - (r * (w * (w * (r * 0.25d0))))
else
tmp = t_0 - (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)) + -1.5;
double tmp;
if ((v <= -5e+15) || !(v <= 2.6e-9)) {
tmp = t_0 - (r * (w * (w * (r * 0.25))));
} else {
tmp = t_0 - (0.375 * ((r * w) * (r * w)));
}
return tmp;
}
def code(v, w, r): t_0 = (2.0 / (r * r)) + -1.5 tmp = 0 if (v <= -5e+15) or not (v <= 2.6e-9): tmp = t_0 - (r * (w * (w * (r * 0.25)))) else: tmp = t_0 - (0.375 * ((r * w) * (r * w))) return tmp
function code(v, w, r) t_0 = Float64(Float64(2.0 / Float64(r * r)) + -1.5) tmp = 0.0 if ((v <= -5e+15) || !(v <= 2.6e-9)) tmp = Float64(t_0 - Float64(r * Float64(w * Float64(w * Float64(r * 0.25))))); else tmp = Float64(t_0 - 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)) + -1.5; tmp = 0.0; if ((v <= -5e+15) || ~((v <= 2.6e-9))) tmp = t_0 - (r * (w * (w * (r * 0.25)))); else tmp = t_0 - (0.375 * ((r * w) * (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[Or[LessEqual[v, -5e+15], N[Not[LessEqual[v, 2.6e-9]], $MachinePrecision]], N[(t$95$0 - N[(r * N[(w * N[(w * N[(r * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 - N[(0.375 * N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r} + -1.5\\
\mathbf{if}\;v \leq -5 \cdot 10^{+15} \lor \neg \left(v \leq 2.6 \cdot 10^{-9}\right):\\
\;\;\;\;t_0 - r \cdot \left(w \cdot \left(w \cdot \left(r \cdot 0.25\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 - 0.375 \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)\\
\end{array}
\end{array}
if v < -5e15 or 2.6000000000000001e-9 < v Initial program 80.0%
Simplified95.5%
associate-*l/88.0%
associate-/l*95.6%
associate-*r*99.8%
pow299.8%
Applied egg-rr99.8%
associate-/r/99.8%
unpow299.8%
associate-*r/99.8%
associate-*l*99.8%
associate-*l*95.6%
*-un-lft-identity95.6%
times-frac93.9%
/-rgt-identity93.9%
Applied egg-rr93.9%
Taylor expanded in v around inf 95.6%
associate-*r*95.6%
Simplified95.6%
if -5e15 < v < 2.6000000000000001e-9Initial program 90.9%
Simplified98.1%
Taylor expanded in v around 0 84.4%
*-commutative84.4%
unpow284.4%
unpow284.4%
swap-sqr99.7%
unpow299.7%
Simplified99.7%
unpow299.7%
Applied egg-rr99.7%
Final simplification97.5%
(FPCore (v w r) :precision binary64 (if (or (<= v -2100000000.0) (not (<= v 0.00033))) (- (+ (/ 2.0 (* r r)) -1.5) (* r (* w (* w (* r 0.25))))) (- (+ -1.5 (/ (/ 2.0 r) r)) (* 0.375 (* (* r w) (* r w))))))
double code(double v, double w, double r) {
double tmp;
if ((v <= -2100000000.0) || !(v <= 0.00033)) {
tmp = ((2.0 / (r * r)) + -1.5) - (r * (w * (w * (r * 0.25))));
} else {
tmp = (-1.5 + ((2.0 / r) / r)) - (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) :: tmp
if ((v <= (-2100000000.0d0)) .or. (.not. (v <= 0.00033d0))) then
tmp = ((2.0d0 / (r * r)) + (-1.5d0)) - (r * (w * (w * (r * 0.25d0))))
else
tmp = ((-1.5d0) + ((2.0d0 / r) / r)) - (0.375d0 * ((r * w) * (r * w)))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double tmp;
if ((v <= -2100000000.0) || !(v <= 0.00033)) {
tmp = ((2.0 / (r * r)) + -1.5) - (r * (w * (w * (r * 0.25))));
} else {
tmp = (-1.5 + ((2.0 / r) / r)) - (0.375 * ((r * w) * (r * w)));
}
return tmp;
}
def code(v, w, r): tmp = 0 if (v <= -2100000000.0) or not (v <= 0.00033): tmp = ((2.0 / (r * r)) + -1.5) - (r * (w * (w * (r * 0.25)))) else: tmp = (-1.5 + ((2.0 / r) / r)) - (0.375 * ((r * w) * (r * w))) return tmp
function code(v, w, r) tmp = 0.0 if ((v <= -2100000000.0) || !(v <= 0.00033)) tmp = Float64(Float64(Float64(2.0 / Float64(r * r)) + -1.5) - Float64(r * Float64(w * Float64(w * Float64(r * 0.25))))); else tmp = Float64(Float64(-1.5 + Float64(Float64(2.0 / r) / r)) - Float64(0.375 * Float64(Float64(r * w) * Float64(r * w)))); end return tmp end
function tmp_2 = code(v, w, r) tmp = 0.0; if ((v <= -2100000000.0) || ~((v <= 0.00033))) tmp = ((2.0 / (r * r)) + -1.5) - (r * (w * (w * (r * 0.25)))); else tmp = (-1.5 + ((2.0 / r) / r)) - (0.375 * ((r * w) * (r * w))); end tmp_2 = tmp; end
code[v_, w_, r_] := If[Or[LessEqual[v, -2100000000.0], N[Not[LessEqual[v, 0.00033]], $MachinePrecision]], N[(N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision] - N[(r * N[(w * N[(w * N[(r * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.5 + N[(N[(2.0 / r), $MachinePrecision] / r), $MachinePrecision]), $MachinePrecision] - N[(0.375 * N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -2100000000 \lor \neg \left(v \leq 0.00033\right):\\
\;\;\;\;\left(\frac{2}{r \cdot r} + -1.5\right) - r \cdot \left(w \cdot \left(w \cdot \left(r \cdot 0.25\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-1.5 + \frac{\frac{2}{r}}{r}\right) - 0.375 \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)\\
\end{array}
\end{array}
if v < -2.1e9 or 3.3e-4 < v Initial program 79.7%
Simplified95.5%
associate-*l/87.9%
associate-/l*95.5%
associate-*r*99.8%
pow299.8%
Applied egg-rr99.8%
associate-/r/99.8%
unpow299.8%
associate-*r/99.8%
associate-*l*99.8%
associate-*l*95.5%
*-un-lft-identity95.5%
times-frac93.8%
/-rgt-identity93.8%
Applied egg-rr93.8%
Taylor expanded in v around inf 95.5%
associate-*r*95.5%
Simplified95.5%
if -2.1e9 < v < 3.3e-4Initial program 91.0%
Simplified98.1%
Taylor expanded in v around 0 84.7%
*-commutative84.7%
unpow284.7%
unpow284.7%
swap-sqr99.7%
unpow299.7%
Simplified99.7%
unpow299.7%
Applied egg-rr99.7%
clear-num99.7%
associate-/r/99.7%
pow299.7%
pow-flip99.8%
metadata-eval99.8%
Applied egg-rr99.8%
*-commutative99.8%
metadata-eval99.8%
pow-prod-up99.7%
inv-pow99.7%
inv-pow99.7%
associate-*r*99.7%
div-inv99.7%
un-div-inv99.7%
Applied egg-rr99.7%
Final simplification97.5%
(FPCore (v w r) :precision binary64 (if (or (<= v -2200000000.0) (not (<= v 2.4e-9))) (- -1.5 (* r (* w (* w (* r 0.25))))) (- -1.5 (* 0.375 (/ (* r w) (/ (/ 1.0 r) w))))))
double code(double v, double w, double r) {
double tmp;
if ((v <= -2200000000.0) || !(v <= 2.4e-9)) {
tmp = -1.5 - (r * (w * (w * (r * 0.25))));
} else {
tmp = -1.5 - (0.375 * ((r * w) / ((1.0 / 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 ((v <= (-2200000000.0d0)) .or. (.not. (v <= 2.4d-9))) then
tmp = (-1.5d0) - (r * (w * (w * (r * 0.25d0))))
else
tmp = (-1.5d0) - (0.375d0 * ((r * w) / ((1.0d0 / r) / w)))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double tmp;
if ((v <= -2200000000.0) || !(v <= 2.4e-9)) {
tmp = -1.5 - (r * (w * (w * (r * 0.25))));
} else {
tmp = -1.5 - (0.375 * ((r * w) / ((1.0 / r) / w)));
}
return tmp;
}
def code(v, w, r): tmp = 0 if (v <= -2200000000.0) or not (v <= 2.4e-9): tmp = -1.5 - (r * (w * (w * (r * 0.25)))) else: tmp = -1.5 - (0.375 * ((r * w) / ((1.0 / r) / w))) return tmp
function code(v, w, r) tmp = 0.0 if ((v <= -2200000000.0) || !(v <= 2.4e-9)) tmp = Float64(-1.5 - Float64(r * Float64(w * Float64(w * Float64(r * 0.25))))); else tmp = Float64(-1.5 - Float64(0.375 * Float64(Float64(r * w) / Float64(Float64(1.0 / r) / w)))); end return tmp end
function tmp_2 = code(v, w, r) tmp = 0.0; if ((v <= -2200000000.0) || ~((v <= 2.4e-9))) tmp = -1.5 - (r * (w * (w * (r * 0.25)))); else tmp = -1.5 - (0.375 * ((r * w) / ((1.0 / r) / w))); end tmp_2 = tmp; end
code[v_, w_, r_] := If[Or[LessEqual[v, -2200000000.0], N[Not[LessEqual[v, 2.4e-9]], $MachinePrecision]], N[(-1.5 - N[(r * N[(w * N[(w * N[(r * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.5 - N[(0.375 * N[(N[(r * w), $MachinePrecision] / N[(N[(1.0 / r), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -2200000000 \lor \neg \left(v \leq 2.4 \cdot 10^{-9}\right):\\
\;\;\;\;-1.5 - r \cdot \left(w \cdot \left(w \cdot \left(r \cdot 0.25\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-1.5 - 0.375 \cdot \frac{r \cdot w}{\frac{\frac{1}{r}}{w}}\\
\end{array}
\end{array}
if v < -2.2e9 or 2.4e-9 < v Initial program 80.0%
Simplified95.5%
associate-*l/88.0%
associate-/l*95.6%
associate-*r*99.8%
pow299.8%
Applied egg-rr99.8%
associate-/r/99.8%
unpow299.8%
associate-*r/99.8%
associate-*l*99.8%
associate-*l*95.6%
*-un-lft-identity95.6%
times-frac93.9%
/-rgt-identity93.9%
Applied egg-rr93.9%
Taylor expanded in v around inf 95.6%
associate-*r*95.6%
Simplified95.6%
Taylor expanded in r around inf 58.1%
if -2.2e9 < v < 2.4e-9Initial program 90.9%
Simplified98.1%
Taylor expanded in v around 0 84.4%
*-commutative84.4%
unpow284.4%
unpow284.4%
swap-sqr99.7%
unpow299.7%
Simplified99.7%
unpow299.7%
Applied egg-rr99.7%
Taylor expanded in r around inf 57.6%
*-un-lft-identity57.6%
associate-*r*57.6%
metadata-eval57.6%
div-inv57.6%
associate-/r/57.6%
associate-/r*57.7%
Applied egg-rr57.7%
Final simplification57.9%
(FPCore (v w r) :precision binary64 (if (or (<= v -2100000000.0) (not (<= v 4.1e-16))) (- -1.5 (* r (* w (* w (* r 0.25))))) (- -1.5 (/ (* (* r w) 0.375) (/ (/ 1.0 r) w)))))
double code(double v, double w, double r) {
double tmp;
if ((v <= -2100000000.0) || !(v <= 4.1e-16)) {
tmp = -1.5 - (r * (w * (w * (r * 0.25))));
} else {
tmp = -1.5 - (((r * w) * 0.375) / ((1.0 / 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 ((v <= (-2100000000.0d0)) .or. (.not. (v <= 4.1d-16))) then
tmp = (-1.5d0) - (r * (w * (w * (r * 0.25d0))))
else
tmp = (-1.5d0) - (((r * w) * 0.375d0) / ((1.0d0 / r) / w))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double tmp;
if ((v <= -2100000000.0) || !(v <= 4.1e-16)) {
tmp = -1.5 - (r * (w * (w * (r * 0.25))));
} else {
tmp = -1.5 - (((r * w) * 0.375) / ((1.0 / r) / w));
}
return tmp;
}
def code(v, w, r): tmp = 0 if (v <= -2100000000.0) or not (v <= 4.1e-16): tmp = -1.5 - (r * (w * (w * (r * 0.25)))) else: tmp = -1.5 - (((r * w) * 0.375) / ((1.0 / r) / w)) return tmp
function code(v, w, r) tmp = 0.0 if ((v <= -2100000000.0) || !(v <= 4.1e-16)) tmp = Float64(-1.5 - Float64(r * Float64(w * Float64(w * Float64(r * 0.25))))); else tmp = Float64(-1.5 - Float64(Float64(Float64(r * w) * 0.375) / Float64(Float64(1.0 / r) / w))); end return tmp end
function tmp_2 = code(v, w, r) tmp = 0.0; if ((v <= -2100000000.0) || ~((v <= 4.1e-16))) tmp = -1.5 - (r * (w * (w * (r * 0.25)))); else tmp = -1.5 - (((r * w) * 0.375) / ((1.0 / r) / w)); end tmp_2 = tmp; end
code[v_, w_, r_] := If[Or[LessEqual[v, -2100000000.0], N[Not[LessEqual[v, 4.1e-16]], $MachinePrecision]], N[(-1.5 - N[(r * N[(w * N[(w * N[(r * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.5 - N[(N[(N[(r * w), $MachinePrecision] * 0.375), $MachinePrecision] / N[(N[(1.0 / r), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -2100000000 \lor \neg \left(v \leq 4.1 \cdot 10^{-16}\right):\\
\;\;\;\;-1.5 - r \cdot \left(w \cdot \left(w \cdot \left(r \cdot 0.25\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-1.5 - \frac{\left(r \cdot w\right) \cdot 0.375}{\frac{\frac{1}{r}}{w}}\\
\end{array}
\end{array}
if v < -2.1e9 or 4.10000000000000006e-16 < v Initial program 80.0%
Simplified95.5%
associate-*l/88.0%
associate-/l*95.6%
associate-*r*99.8%
pow299.8%
Applied egg-rr99.8%
associate-/r/99.8%
unpow299.8%
associate-*r/99.8%
associate-*l*99.8%
associate-*l*95.6%
*-un-lft-identity95.6%
times-frac93.9%
/-rgt-identity93.9%
Applied egg-rr93.9%
Taylor expanded in v around inf 95.6%
associate-*r*95.6%
Simplified95.6%
Taylor expanded in r around inf 58.1%
if -2.1e9 < v < 4.10000000000000006e-16Initial program 90.9%
Simplified98.1%
Taylor expanded in v around 0 84.4%
*-commutative84.4%
unpow284.4%
unpow284.4%
swap-sqr99.7%
unpow299.7%
Simplified99.7%
unpow299.7%
Applied egg-rr99.7%
Taylor expanded in r around inf 57.6%
*-commutative99.7%
pow299.7%
metadata-eval99.7%
pow-div99.7%
pow199.7%
inv-pow99.7%
associate-*r/99.7%
associate-/r*99.8%
Applied egg-rr57.7%
Final simplification57.9%
(FPCore (v w r) :precision binary64 (- (+ (/ 2.0 (* r r)) -1.5) (* r (* w (* (* r w) 0.375)))))
double code(double v, double w, double r) {
return ((2.0 / (r * r)) + -1.5) - (r * (w * ((r * w) * 0.375)));
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
code = ((2.0d0 / (r * r)) + (-1.5d0)) - (r * (w * ((r * w) * 0.375d0)))
end function
public static double code(double v, double w, double r) {
return ((2.0 / (r * r)) + -1.5) - (r * (w * ((r * w) * 0.375)));
}
def code(v, w, r): return ((2.0 / (r * r)) + -1.5) - (r * (w * ((r * w) * 0.375)))
function code(v, w, r) return Float64(Float64(Float64(2.0 / Float64(r * r)) + -1.5) - Float64(r * Float64(w * Float64(Float64(r * w) * 0.375)))) end
function tmp = code(v, w, r) tmp = ((2.0 / (r * r)) + -1.5) - (r * (w * ((r * w) * 0.375))); end
code[v_, w_, r_] := N[(N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision] - N[(r * N[(w * N[(N[(r * w), $MachinePrecision] * 0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{2}{r \cdot r} + -1.5\right) - r \cdot \left(w \cdot \left(\left(r \cdot w\right) \cdot 0.375\right)\right)
\end{array}
Initial program 85.2%
Simplified96.8%
associate-*l/92.8%
associate-/l*96.8%
associate-*r*99.8%
pow299.8%
Applied egg-rr99.8%
associate-/r/99.8%
unpow299.8%
associate-*r/99.8%
associate-*l*99.8%
associate-*l*96.8%
*-un-lft-identity96.8%
times-frac95.9%
/-rgt-identity95.9%
Applied egg-rr95.9%
Taylor expanded in v around 0 90.9%
Final simplification90.9%
(FPCore (v w r) :precision binary64 (if (or (<= v -3600000000.0) (not (<= v 2.6e-9))) (- -1.5 (* r (* w (* w (* r 0.25))))) (- -1.5 (* 0.375 (* (* r w) (* r w))))))
double code(double v, double w, double r) {
double tmp;
if ((v <= -3600000000.0) || !(v <= 2.6e-9)) {
tmp = -1.5 - (r * (w * (w * (r * 0.25))));
} else {
tmp = -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) :: tmp
if ((v <= (-3600000000.0d0)) .or. (.not. (v <= 2.6d-9))) then
tmp = (-1.5d0) - (r * (w * (w * (r * 0.25d0))))
else
tmp = (-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 tmp;
if ((v <= -3600000000.0) || !(v <= 2.6e-9)) {
tmp = -1.5 - (r * (w * (w * (r * 0.25))));
} else {
tmp = -1.5 - (0.375 * ((r * w) * (r * w)));
}
return tmp;
}
def code(v, w, r): tmp = 0 if (v <= -3600000000.0) or not (v <= 2.6e-9): tmp = -1.5 - (r * (w * (w * (r * 0.25)))) else: tmp = -1.5 - (0.375 * ((r * w) * (r * w))) return tmp
function code(v, w, r) tmp = 0.0 if ((v <= -3600000000.0) || !(v <= 2.6e-9)) tmp = Float64(-1.5 - Float64(r * Float64(w * Float64(w * Float64(r * 0.25))))); else tmp = Float64(-1.5 - Float64(0.375 * Float64(Float64(r * w) * Float64(r * w)))); end return tmp end
function tmp_2 = code(v, w, r) tmp = 0.0; if ((v <= -3600000000.0) || ~((v <= 2.6e-9))) tmp = -1.5 - (r * (w * (w * (r * 0.25)))); else tmp = -1.5 - (0.375 * ((r * w) * (r * w))); end tmp_2 = tmp; end
code[v_, w_, r_] := If[Or[LessEqual[v, -3600000000.0], N[Not[LessEqual[v, 2.6e-9]], $MachinePrecision]], N[(-1.5 - N[(r * N[(w * N[(w * N[(r * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.5 - N[(0.375 * N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -3600000000 \lor \neg \left(v \leq 2.6 \cdot 10^{-9}\right):\\
\;\;\;\;-1.5 - r \cdot \left(w \cdot \left(w \cdot \left(r \cdot 0.25\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-1.5 - 0.375 \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)\\
\end{array}
\end{array}
if v < -3.6e9 or 2.6000000000000001e-9 < v Initial program 80.0%
Simplified95.5%
associate-*l/88.0%
associate-/l*95.6%
associate-*r*99.8%
pow299.8%
Applied egg-rr99.8%
associate-/r/99.8%
unpow299.8%
associate-*r/99.8%
associate-*l*99.8%
associate-*l*95.6%
*-un-lft-identity95.6%
times-frac93.9%
/-rgt-identity93.9%
Applied egg-rr93.9%
Taylor expanded in v around inf 95.6%
associate-*r*95.6%
Simplified95.6%
Taylor expanded in r around inf 58.1%
if -3.6e9 < v < 2.6000000000000001e-9Initial program 90.9%
Simplified98.1%
Taylor expanded in v around 0 84.4%
*-commutative84.4%
unpow284.4%
unpow284.4%
swap-sqr99.7%
unpow299.7%
Simplified99.7%
unpow299.7%
Applied egg-rr99.7%
Taylor expanded in r around inf 57.6%
Final simplification57.9%
(FPCore (v w r) :precision binary64 (- -1.5 (* r (* w (* w (* r 0.25))))))
double code(double v, double w, double r) {
return -1.5 - (r * (w * (w * (r * 0.25))));
}
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) - (r * (w * (w * (r * 0.25d0))))
end function
public static double code(double v, double w, double r) {
return -1.5 - (r * (w * (w * (r * 0.25))));
}
def code(v, w, r): return -1.5 - (r * (w * (w * (r * 0.25))))
function code(v, w, r) return Float64(-1.5 - Float64(r * Float64(w * Float64(w * Float64(r * 0.25))))) end
function tmp = code(v, w, r) tmp = -1.5 - (r * (w * (w * (r * 0.25)))); end
code[v_, w_, r_] := N[(-1.5 - N[(r * N[(w * N[(w * N[(r * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-1.5 - r \cdot \left(w \cdot \left(w \cdot \left(r \cdot 0.25\right)\right)\right)
\end{array}
Initial program 85.2%
Simplified96.8%
associate-*l/92.8%
associate-/l*96.8%
associate-*r*99.8%
pow299.8%
Applied egg-rr99.8%
associate-/r/99.8%
unpow299.8%
associate-*r/99.8%
associate-*l*99.8%
associate-*l*96.8%
*-un-lft-identity96.8%
times-frac95.9%
/-rgt-identity95.9%
Applied egg-rr95.9%
Taylor expanded in v around inf 90.3%
associate-*r*90.3%
Simplified90.3%
Taylor expanded in r around inf 51.8%
Final simplification51.8%
herbie shell --seed 2023305
(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))