
(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 15 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 (fma (fma v -0.25 0.375) (* w (* r (* w (/ r (+ v -1.0))))) (+ (/ 2.0 (* r r)) -1.5)))
double code(double v, double w, double r) {
return fma(fma(v, -0.25, 0.375), (w * (r * (w * (r / (v + -1.0))))), ((2.0 / (r * r)) + -1.5));
}
function code(v, w, r) return fma(fma(v, -0.25, 0.375), Float64(w * Float64(r * Float64(w * Float64(r / Float64(v + -1.0))))), Float64(Float64(2.0 / Float64(r * r)) + -1.5)) end
code[v_, w_, r_] := N[(N[(v * -0.25 + 0.375), $MachinePrecision] * N[(w * N[(r * N[(w * N[(r / N[(v + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\mathsf{fma}\left(v, -0.25, 0.375\right), w \cdot \left(r \cdot \left(w \cdot \frac{r}{v + -1}\right)\right), \frac{2}{r \cdot r} + -1.5\right)
\end{array}
Initial program 83.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6495.2
Applied rewrites95.2%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
Applied rewrites98.8%
Final simplification98.8%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r)))
(t_1
(+
(+ t_0 3.0)
(/ (* (* 0.125 (- 3.0 (* v 2.0))) (* r (* r (* w w)))) (+ v -1.0)))))
(if (<= t_1 (- INFINITY))
(- (fma (* w (* (* r r) 0.25)) (- w) 3.0) 4.5)
(if (<= t_1 -2e+24) (- t_0 (* r (* w (* r (* 0.375 w))))) (+ t_0 -1.5)))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double t_1 = (t_0 + 3.0) + (((0.125 * (3.0 - (v * 2.0))) * (r * (r * (w * w)))) / (v + -1.0));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = fma((w * ((r * r) * 0.25)), -w, 3.0) - 4.5;
} else if (t_1 <= -2e+24) {
tmp = t_0 - (r * (w * (r * (0.375 * w))));
} else {
tmp = t_0 + -1.5;
}
return tmp;
}
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) t_1 = Float64(Float64(t_0 + 3.0) + Float64(Float64(Float64(0.125 * Float64(3.0 - Float64(v * 2.0))) * Float64(r * Float64(r * Float64(w * w)))) / Float64(v + -1.0))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(fma(Float64(w * Float64(Float64(r * r) * 0.25)), Float64(-w), 3.0) - 4.5); elseif (t_1 <= -2e+24) tmp = Float64(t_0 - Float64(r * Float64(w * Float64(r * Float64(0.375 * w))))); else tmp = Float64(t_0 + -1.5); end return tmp end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 + 3.0), $MachinePrecision] + N[(N[(N[(0.125 * N[(3.0 - N[(v * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(r * N[(r * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(v + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(w * N[(N[(r * r), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision] * (-w) + 3.0), $MachinePrecision] - 4.5), $MachinePrecision], If[LessEqual[t$95$1, -2e+24], N[(t$95$0 - N[(r * N[(w * N[(r * N[(0.375 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + -1.5), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
t_1 := \left(t\_0 + 3\right) + \frac{\left(0.125 \cdot \left(3 - v \cdot 2\right)\right) \cdot \left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right)}{v + -1}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(w \cdot \left(\left(r \cdot r\right) \cdot 0.25\right), -w, 3\right) - 4.5\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+24}:\\
\;\;\;\;t\_0 - r \cdot \left(w \cdot \left(r \cdot \left(0.375 \cdot w\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 + -1.5\\
\end{array}
\end{array}
if (-.f64 (+.f64 #s(literal 3 binary64) (/.f64 #s(literal 2 binary64) (*.f64 r r))) (/.f64 (*.f64 (*.f64 #s(literal 1/8 binary64) (-.f64 #s(literal 3 binary64) (*.f64 #s(literal 2 binary64) v))) (*.f64 (*.f64 (*.f64 w w) r) r)) (-.f64 #s(literal 1 binary64) v))) < -inf.0Initial program 76.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6488.0
Applied rewrites88.0%
Taylor expanded in r around inf
Applied rewrites84.8%
lift--.f64N/A
sub-negN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
Applied rewrites93.8%
Taylor expanded in v around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6488.3
Applied rewrites88.3%
if -inf.0 < (-.f64 (+.f64 #s(literal 3 binary64) (/.f64 #s(literal 2 binary64) (*.f64 r r))) (/.f64 (*.f64 (*.f64 #s(literal 1/8 binary64) (-.f64 #s(literal 3 binary64) (*.f64 #s(literal 2 binary64) v))) (*.f64 (*.f64 (*.f64 w w) r) r)) (-.f64 #s(literal 1 binary64) v))) < -2e24Initial program 97.4%
Taylor expanded in v around 0
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6445.7
Applied rewrites45.7%
Taylor expanded in w around inf
Applied rewrites65.0%
Applied rewrites67.3%
if -2e24 < (-.f64 (+.f64 #s(literal 3 binary64) (/.f64 #s(literal 2 binary64) (*.f64 r r))) (/.f64 (*.f64 (*.f64 #s(literal 1/8 binary64) (-.f64 #s(literal 3 binary64) (*.f64 #s(literal 2 binary64) v))) (*.f64 (*.f64 (*.f64 w w) r) r)) (-.f64 #s(literal 1 binary64) v))) Initial program 86.2%
Taylor expanded in w around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
unpow2N/A
lower-*.f6495.4
Applied rewrites95.4%
Final simplification90.2%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r)))
(t_1
(+
(+ t_0 3.0)
(/ (* (* 0.125 (- 3.0 (* v 2.0))) (* r (* r (* w w)))) (+ v -1.0)))))
(if (<= t_1 (- INFINITY))
(- (fma (* w (* (* r r) 0.25)) (- w) 3.0) 4.5)
(if (<= t_1 -2e+24)
(- (- 3.0 (* r (* r (* 0.375 (* w w))))) 4.5)
(+ t_0 -1.5)))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double t_1 = (t_0 + 3.0) + (((0.125 * (3.0 - (v * 2.0))) * (r * (r * (w * w)))) / (v + -1.0));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = fma((w * ((r * r) * 0.25)), -w, 3.0) - 4.5;
} else if (t_1 <= -2e+24) {
tmp = (3.0 - (r * (r * (0.375 * (w * w))))) - 4.5;
} else {
tmp = t_0 + -1.5;
}
return tmp;
}
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) t_1 = Float64(Float64(t_0 + 3.0) + Float64(Float64(Float64(0.125 * Float64(3.0 - Float64(v * 2.0))) * Float64(r * Float64(r * Float64(w * w)))) / Float64(v + -1.0))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(fma(Float64(w * Float64(Float64(r * r) * 0.25)), Float64(-w), 3.0) - 4.5); elseif (t_1 <= -2e+24) tmp = Float64(Float64(3.0 - Float64(r * Float64(r * Float64(0.375 * Float64(w * w))))) - 4.5); else tmp = Float64(t_0 + -1.5); end return tmp end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 + 3.0), $MachinePrecision] + N[(N[(N[(0.125 * N[(3.0 - N[(v * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(r * N[(r * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(v + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(w * N[(N[(r * r), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision] * (-w) + 3.0), $MachinePrecision] - 4.5), $MachinePrecision], If[LessEqual[t$95$1, -2e+24], N[(N[(3.0 - N[(r * N[(r * N[(0.375 * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision], N[(t$95$0 + -1.5), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
t_1 := \left(t\_0 + 3\right) + \frac{\left(0.125 \cdot \left(3 - v \cdot 2\right)\right) \cdot \left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right)}{v + -1}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(w \cdot \left(\left(r \cdot r\right) \cdot 0.25\right), -w, 3\right) - 4.5\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+24}:\\
\;\;\;\;\left(3 - r \cdot \left(r \cdot \left(0.375 \cdot \left(w \cdot w\right)\right)\right)\right) - 4.5\\
\mathbf{else}:\\
\;\;\;\;t\_0 + -1.5\\
\end{array}
\end{array}
if (-.f64 (+.f64 #s(literal 3 binary64) (/.f64 #s(literal 2 binary64) (*.f64 r r))) (/.f64 (*.f64 (*.f64 #s(literal 1/8 binary64) (-.f64 #s(literal 3 binary64) (*.f64 #s(literal 2 binary64) v))) (*.f64 (*.f64 (*.f64 w w) r) r)) (-.f64 #s(literal 1 binary64) v))) < -inf.0Initial program 76.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6488.0
Applied rewrites88.0%
Taylor expanded in r around inf
Applied rewrites84.8%
lift--.f64N/A
sub-negN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
Applied rewrites93.8%
Taylor expanded in v around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6488.3
Applied rewrites88.3%
if -inf.0 < (-.f64 (+.f64 #s(literal 3 binary64) (/.f64 #s(literal 2 binary64) (*.f64 r r))) (/.f64 (*.f64 (*.f64 #s(literal 1/8 binary64) (-.f64 #s(literal 3 binary64) (*.f64 #s(literal 2 binary64) v))) (*.f64 (*.f64 (*.f64 w w) r) r)) (-.f64 #s(literal 1 binary64) v))) < -2e24Initial program 97.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.3
Applied rewrites99.3%
Taylor expanded in r around inf
Applied rewrites99.3%
Taylor expanded in v around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6465.0
Applied rewrites65.0%
if -2e24 < (-.f64 (+.f64 #s(literal 3 binary64) (/.f64 #s(literal 2 binary64) (*.f64 r r))) (/.f64 (*.f64 (*.f64 #s(literal 1/8 binary64) (-.f64 #s(literal 3 binary64) (*.f64 #s(literal 2 binary64) v))) (*.f64 (*.f64 (*.f64 w w) r) r)) (-.f64 #s(literal 1 binary64) v))) Initial program 86.2%
Taylor expanded in w around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
unpow2N/A
lower-*.f6495.4
Applied rewrites95.4%
Final simplification90.0%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r)))
(t_1
(+
(+ t_0 3.0)
(/ (* (* 0.125 (- 3.0 (* v 2.0))) (* r (* r (* w w)))) (+ v -1.0)))))
(if (<= t_1 (- INFINITY))
(- (- 3.0 (* (* r r) (* (* w w) 0.25))) 4.5)
(if (<= t_1 -2e+24)
(- (- 3.0 (* r (* r (* 0.375 (* w w))))) 4.5)
(+ t_0 -1.5)))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double t_1 = (t_0 + 3.0) + (((0.125 * (3.0 - (v * 2.0))) * (r * (r * (w * w)))) / (v + -1.0));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (3.0 - ((r * r) * ((w * w) * 0.25))) - 4.5;
} else if (t_1 <= -2e+24) {
tmp = (3.0 - (r * (r * (0.375 * (w * w))))) - 4.5;
} else {
tmp = t_0 + -1.5;
}
return tmp;
}
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double t_1 = (t_0 + 3.0) + (((0.125 * (3.0 - (v * 2.0))) * (r * (r * (w * w)))) / (v + -1.0));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (3.0 - ((r * r) * ((w * w) * 0.25))) - 4.5;
} else if (t_1 <= -2e+24) {
tmp = (3.0 - (r * (r * (0.375 * (w * w))))) - 4.5;
} else {
tmp = t_0 + -1.5;
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) t_1 = (t_0 + 3.0) + (((0.125 * (3.0 - (v * 2.0))) * (r * (r * (w * w)))) / (v + -1.0)) tmp = 0 if t_1 <= -math.inf: tmp = (3.0 - ((r * r) * ((w * w) * 0.25))) - 4.5 elif t_1 <= -2e+24: tmp = (3.0 - (r * (r * (0.375 * (w * w))))) - 4.5 else: tmp = t_0 + -1.5 return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) t_1 = Float64(Float64(t_0 + 3.0) + Float64(Float64(Float64(0.125 * Float64(3.0 - Float64(v * 2.0))) * Float64(r * Float64(r * Float64(w * w)))) / Float64(v + -1.0))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(3.0 - Float64(Float64(r * r) * Float64(Float64(w * w) * 0.25))) - 4.5); elseif (t_1 <= -2e+24) tmp = Float64(Float64(3.0 - Float64(r * Float64(r * Float64(0.375 * Float64(w * w))))) - 4.5); else tmp = Float64(t_0 + -1.5); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); t_1 = (t_0 + 3.0) + (((0.125 * (3.0 - (v * 2.0))) * (r * (r * (w * w)))) / (v + -1.0)); tmp = 0.0; if (t_1 <= -Inf) tmp = (3.0 - ((r * r) * ((w * w) * 0.25))) - 4.5; elseif (t_1 <= -2e+24) tmp = (3.0 - (r * (r * (0.375 * (w * w))))) - 4.5; else tmp = t_0 + -1.5; 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[(N[(t$95$0 + 3.0), $MachinePrecision] + N[(N[(N[(0.125 * N[(3.0 - N[(v * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(r * N[(r * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(v + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(3.0 - N[(N[(r * r), $MachinePrecision] * N[(N[(w * w), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision], If[LessEqual[t$95$1, -2e+24], N[(N[(3.0 - N[(r * N[(r * N[(0.375 * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision], N[(t$95$0 + -1.5), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
t_1 := \left(t\_0 + 3\right) + \frac{\left(0.125 \cdot \left(3 - v \cdot 2\right)\right) \cdot \left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right)}{v + -1}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left(3 - \left(r \cdot r\right) \cdot \left(\left(w \cdot w\right) \cdot 0.25\right)\right) - 4.5\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+24}:\\
\;\;\;\;\left(3 - r \cdot \left(r \cdot \left(0.375 \cdot \left(w \cdot w\right)\right)\right)\right) - 4.5\\
\mathbf{else}:\\
\;\;\;\;t\_0 + -1.5\\
\end{array}
\end{array}
if (-.f64 (+.f64 #s(literal 3 binary64) (/.f64 #s(literal 2 binary64) (*.f64 r r))) (/.f64 (*.f64 (*.f64 #s(literal 1/8 binary64) (-.f64 #s(literal 3 binary64) (*.f64 #s(literal 2 binary64) v))) (*.f64 (*.f64 (*.f64 w w) r) r)) (-.f64 #s(literal 1 binary64) v))) < -inf.0Initial program 76.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6488.0
Applied rewrites88.0%
Taylor expanded in r around inf
Applied rewrites84.8%
Taylor expanded in v around inf
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6483.7
Applied rewrites83.7%
if -inf.0 < (-.f64 (+.f64 #s(literal 3 binary64) (/.f64 #s(literal 2 binary64) (*.f64 r r))) (/.f64 (*.f64 (*.f64 #s(literal 1/8 binary64) (-.f64 #s(literal 3 binary64) (*.f64 #s(literal 2 binary64) v))) (*.f64 (*.f64 (*.f64 w w) r) r)) (-.f64 #s(literal 1 binary64) v))) < -2e24Initial program 97.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.3
Applied rewrites99.3%
Taylor expanded in r around inf
Applied rewrites99.3%
Taylor expanded in v around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6465.0
Applied rewrites65.0%
if -2e24 < (-.f64 (+.f64 #s(literal 3 binary64) (/.f64 #s(literal 2 binary64) (*.f64 r r))) (/.f64 (*.f64 (*.f64 #s(literal 1/8 binary64) (-.f64 #s(literal 3 binary64) (*.f64 #s(literal 2 binary64) v))) (*.f64 (*.f64 (*.f64 w w) r) r)) (-.f64 #s(literal 1 binary64) v))) Initial program 86.2%
Taylor expanded in w around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
unpow2N/A
lower-*.f6495.4
Applied rewrites95.4%
Final simplification88.4%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<=
(+
(+ t_0 3.0)
(/ (* (* 0.125 (- 3.0 (* v 2.0))) (* r (* r (* w w)))) (+ v -1.0)))
-2e+24)
(- (- 3.0 (* r (* r (* 0.375 (* w w))))) 4.5)
(+ t_0 -1.5))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (((t_0 + 3.0) + (((0.125 * (3.0 - (v * 2.0))) * (r * (r * (w * w)))) / (v + -1.0))) <= -2e+24) {
tmp = (3.0 - (r * (r * (0.375 * (w * w))))) - 4.5;
} else {
tmp = t_0 + -1.5;
}
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 (((t_0 + 3.0d0) + (((0.125d0 * (3.0d0 - (v * 2.0d0))) * (r * (r * (w * w)))) / (v + (-1.0d0)))) <= (-2d+24)) then
tmp = (3.0d0 - (r * (r * (0.375d0 * (w * w))))) - 4.5d0
else
tmp = t_0 + (-1.5d0)
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 (((t_0 + 3.0) + (((0.125 * (3.0 - (v * 2.0))) * (r * (r * (w * w)))) / (v + -1.0))) <= -2e+24) {
tmp = (3.0 - (r * (r * (0.375 * (w * w))))) - 4.5;
} else {
tmp = t_0 + -1.5;
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if ((t_0 + 3.0) + (((0.125 * (3.0 - (v * 2.0))) * (r * (r * (w * w)))) / (v + -1.0))) <= -2e+24: tmp = (3.0 - (r * (r * (0.375 * (w * w))))) - 4.5 else: tmp = t_0 + -1.5 return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (Float64(Float64(t_0 + 3.0) + Float64(Float64(Float64(0.125 * Float64(3.0 - Float64(v * 2.0))) * Float64(r * Float64(r * Float64(w * w)))) / Float64(v + -1.0))) <= -2e+24) tmp = Float64(Float64(3.0 - Float64(r * Float64(r * Float64(0.375 * Float64(w * w))))) - 4.5); else tmp = Float64(t_0 + -1.5); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (((t_0 + 3.0) + (((0.125 * (3.0 - (v * 2.0))) * (r * (r * (w * w)))) / (v + -1.0))) <= -2e+24) tmp = (3.0 - (r * (r * (0.375 * (w * w))))) - 4.5; else tmp = t_0 + -1.5; end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(t$95$0 + 3.0), $MachinePrecision] + N[(N[(N[(0.125 * N[(3.0 - N[(v * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(r * N[(r * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(v + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2e+24], N[(N[(3.0 - N[(r * N[(r * N[(0.375 * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision], N[(t$95$0 + -1.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;\left(t\_0 + 3\right) + \frac{\left(0.125 \cdot \left(3 - v \cdot 2\right)\right) \cdot \left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right)}{v + -1} \leq -2 \cdot 10^{+24}:\\
\;\;\;\;\left(3 - r \cdot \left(r \cdot \left(0.375 \cdot \left(w \cdot w\right)\right)\right)\right) - 4.5\\
\mathbf{else}:\\
\;\;\;\;t\_0 + -1.5\\
\end{array}
\end{array}
if (-.f64 (+.f64 #s(literal 3 binary64) (/.f64 #s(literal 2 binary64) (*.f64 r r))) (/.f64 (*.f64 (*.f64 #s(literal 1/8 binary64) (-.f64 #s(literal 3 binary64) (*.f64 #s(literal 2 binary64) v))) (*.f64 (*.f64 (*.f64 w w) r) r)) (-.f64 #s(literal 1 binary64) v))) < -2e24Initial program 81.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6490.4
Applied rewrites90.4%
Taylor expanded in r around inf
Applied rewrites87.8%
Taylor expanded in v around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6475.1
Applied rewrites75.1%
if -2e24 < (-.f64 (+.f64 #s(literal 3 binary64) (/.f64 #s(literal 2 binary64) (*.f64 r r))) (/.f64 (*.f64 (*.f64 #s(literal 1/8 binary64) (-.f64 #s(literal 3 binary64) (*.f64 #s(literal 2 binary64) v))) (*.f64 (*.f64 (*.f64 w w) r) r)) (-.f64 #s(literal 1 binary64) v))) Initial program 86.2%
Taylor expanded in w around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
unpow2N/A
lower-*.f6495.4
Applied rewrites95.4%
Final simplification86.3%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<=
(+
(+ t_0 3.0)
(/ (* (* 0.125 (- 3.0 (* v 2.0))) (* r (* r (* w w)))) (+ v -1.0)))
-2e+24)
(* (* r r) (* (* w w) -0.375))
(+ t_0 -1.5))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (((t_0 + 3.0) + (((0.125 * (3.0 - (v * 2.0))) * (r * (r * (w * w)))) / (v + -1.0))) <= -2e+24) {
tmp = (r * r) * ((w * w) * -0.375);
} else {
tmp = t_0 + -1.5;
}
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 (((t_0 + 3.0d0) + (((0.125d0 * (3.0d0 - (v * 2.0d0))) * (r * (r * (w * w)))) / (v + (-1.0d0)))) <= (-2d+24)) then
tmp = (r * r) * ((w * w) * (-0.375d0))
else
tmp = t_0 + (-1.5d0)
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 (((t_0 + 3.0) + (((0.125 * (3.0 - (v * 2.0))) * (r * (r * (w * w)))) / (v + -1.0))) <= -2e+24) {
tmp = (r * r) * ((w * w) * -0.375);
} else {
tmp = t_0 + -1.5;
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if ((t_0 + 3.0) + (((0.125 * (3.0 - (v * 2.0))) * (r * (r * (w * w)))) / (v + -1.0))) <= -2e+24: tmp = (r * r) * ((w * w) * -0.375) else: tmp = t_0 + -1.5 return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (Float64(Float64(t_0 + 3.0) + Float64(Float64(Float64(0.125 * Float64(3.0 - Float64(v * 2.0))) * Float64(r * Float64(r * Float64(w * w)))) / Float64(v + -1.0))) <= -2e+24) tmp = Float64(Float64(r * r) * Float64(Float64(w * w) * -0.375)); else tmp = Float64(t_0 + -1.5); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (((t_0 + 3.0) + (((0.125 * (3.0 - (v * 2.0))) * (r * (r * (w * w)))) / (v + -1.0))) <= -2e+24) tmp = (r * r) * ((w * w) * -0.375); else tmp = t_0 + -1.5; end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(t$95$0 + 3.0), $MachinePrecision] + N[(N[(N[(0.125 * N[(3.0 - N[(v * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(r * N[(r * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(v + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2e+24], N[(N[(r * r), $MachinePrecision] * N[(N[(w * w), $MachinePrecision] * -0.375), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + -1.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;\left(t\_0 + 3\right) + \frac{\left(0.125 \cdot \left(3 - v \cdot 2\right)\right) \cdot \left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right)}{v + -1} \leq -2 \cdot 10^{+24}:\\
\;\;\;\;\left(r \cdot r\right) \cdot \left(\left(w \cdot w\right) \cdot -0.375\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 + -1.5\\
\end{array}
\end{array}
if (-.f64 (+.f64 #s(literal 3 binary64) (/.f64 #s(literal 2 binary64) (*.f64 r r))) (/.f64 (*.f64 (*.f64 #s(literal 1/8 binary64) (-.f64 #s(literal 3 binary64) (*.f64 #s(literal 2 binary64) v))) (*.f64 (*.f64 (*.f64 w w) r) r)) (-.f64 #s(literal 1 binary64) v))) < -2e24Initial program 81.0%
Taylor expanded in v around 0
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6470.9
Applied rewrites70.9%
Taylor expanded in r around inf
Applied rewrites70.9%
if -2e24 < (-.f64 (+.f64 #s(literal 3 binary64) (/.f64 #s(literal 2 binary64) (*.f64 r r))) (/.f64 (*.f64 (*.f64 #s(literal 1/8 binary64) (-.f64 #s(literal 3 binary64) (*.f64 #s(literal 2 binary64) v))) (*.f64 (*.f64 (*.f64 w w) r) r)) (-.f64 #s(literal 1 binary64) v))) Initial program 86.2%
Taylor expanded in w around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
unpow2N/A
lower-*.f6495.4
Applied rewrites95.4%
Final simplification84.4%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= (* w w) 2e-155)
(- t_0 (fma (* r (* r (* w w))) 0.375 1.5))
(if (<= (* w w) 1e+68)
(+ -1.5 (fma (* w (* -0.25 (* r r))) w t_0))
(- t_0 (* (* r (* w r)) (* 0.375 w)))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((w * w) <= 2e-155) {
tmp = t_0 - fma((r * (r * (w * w))), 0.375, 1.5);
} else if ((w * w) <= 1e+68) {
tmp = -1.5 + fma((w * (-0.25 * (r * r))), w, t_0);
} else {
tmp = t_0 - ((r * (w * r)) * (0.375 * w));
}
return tmp;
}
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (Float64(w * w) <= 2e-155) tmp = Float64(t_0 - fma(Float64(r * Float64(r * Float64(w * w))), 0.375, 1.5)); elseif (Float64(w * w) <= 1e+68) tmp = Float64(-1.5 + fma(Float64(w * Float64(-0.25 * Float64(r * r))), w, t_0)); else tmp = Float64(t_0 - Float64(Float64(r * Float64(w * r)) * Float64(0.375 * w))); end return 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-155], N[(t$95$0 - N[(N[(r * N[(r * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.375 + 1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(w * w), $MachinePrecision], 1e+68], N[(-1.5 + N[(N[(w * N[(-0.25 * N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * w + t$95$0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 - N[(N[(r * N[(w * r), $MachinePrecision]), $MachinePrecision] * N[(0.375 * w), $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^{-155}:\\
\;\;\;\;t\_0 - \mathsf{fma}\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right), 0.375, 1.5\right)\\
\mathbf{elif}\;w \cdot w \leq 10^{+68}:\\
\;\;\;\;-1.5 + \mathsf{fma}\left(w \cdot \left(-0.25 \cdot \left(r \cdot r\right)\right), w, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 - \left(r \cdot \left(w \cdot r\right)\right) \cdot \left(0.375 \cdot w\right)\\
\end{array}
\end{array}
if (*.f64 w w) < 2.00000000000000003e-155Initial program 91.6%
Taylor expanded in v around 0
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6477.9
Applied rewrites77.9%
Applied rewrites89.2%
if 2.00000000000000003e-155 < (*.f64 w w) < 9.99999999999999953e67Initial program 92.2%
Taylor expanded in v around inf
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-+l+N/A
lower-+.f64N/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
Applied rewrites96.6%
if 9.99999999999999953e67 < (*.f64 w w) Initial program 73.7%
Taylor expanded in v around 0
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6472.8
Applied rewrites72.8%
Taylor expanded in w around inf
Applied rewrites72.8%
Applied rewrites93.2%
Final simplification92.4%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= (* w w) 2e-155)
(- t_0 (fma (* 0.375 r) (* r (* w w)) 1.5))
(if (<= (* w w) 1e+68)
(+ -1.5 (fma (* w (* -0.25 (* r r))) w t_0))
(- t_0 (* (* r (* w r)) (* 0.375 w)))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((w * w) <= 2e-155) {
tmp = t_0 - fma((0.375 * r), (r * (w * w)), 1.5);
} else if ((w * w) <= 1e+68) {
tmp = -1.5 + fma((w * (-0.25 * (r * r))), w, t_0);
} else {
tmp = t_0 - ((r * (w * r)) * (0.375 * w));
}
return tmp;
}
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (Float64(w * w) <= 2e-155) tmp = Float64(t_0 - fma(Float64(0.375 * r), Float64(r * Float64(w * w)), 1.5)); elseif (Float64(w * w) <= 1e+68) tmp = Float64(-1.5 + fma(Float64(w * Float64(-0.25 * Float64(r * r))), w, t_0)); else tmp = Float64(t_0 - Float64(Float64(r * Float64(w * r)) * Float64(0.375 * w))); end return 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-155], N[(t$95$0 - N[(N[(0.375 * r), $MachinePrecision] * N[(r * N[(w * w), $MachinePrecision]), $MachinePrecision] + 1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(w * w), $MachinePrecision], 1e+68], N[(-1.5 + N[(N[(w * N[(-0.25 * N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * w + t$95$0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 - N[(N[(r * N[(w * r), $MachinePrecision]), $MachinePrecision] * N[(0.375 * w), $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^{-155}:\\
\;\;\;\;t\_0 - \mathsf{fma}\left(0.375 \cdot r, r \cdot \left(w \cdot w\right), 1.5\right)\\
\mathbf{elif}\;w \cdot w \leq 10^{+68}:\\
\;\;\;\;-1.5 + \mathsf{fma}\left(w \cdot \left(-0.25 \cdot \left(r \cdot r\right)\right), w, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 - \left(r \cdot \left(w \cdot r\right)\right) \cdot \left(0.375 \cdot w\right)\\
\end{array}
\end{array}
if (*.f64 w w) < 2.00000000000000003e-155Initial program 91.6%
Taylor expanded in v around 0
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6477.9
Applied rewrites77.9%
Applied rewrites89.2%
if 2.00000000000000003e-155 < (*.f64 w w) < 9.99999999999999953e67Initial program 92.2%
Taylor expanded in v around inf
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-+l+N/A
lower-+.f64N/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
Applied rewrites96.6%
if 9.99999999999999953e67 < (*.f64 w w) Initial program 73.7%
Taylor expanded in v around 0
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6472.8
Applied rewrites72.8%
Taylor expanded in w around inf
Applied rewrites72.8%
Applied rewrites93.2%
Final simplification92.4%
(FPCore (v w r)
:precision binary64
(if (<= r 40000.0)
(- (/ 2.0 (* r r)) (fma (* 0.375 (* r (* w r))) w 1.5))
(-
(+ 3.0 (* (* r (* w (* w r))) (/ (* 0.125 (fma v -2.0 3.0)) (+ v -1.0))))
4.5)))
double code(double v, double w, double r) {
double tmp;
if (r <= 40000.0) {
tmp = (2.0 / (r * r)) - fma((0.375 * (r * (w * r))), w, 1.5);
} else {
tmp = (3.0 + ((r * (w * (w * r))) * ((0.125 * fma(v, -2.0, 3.0)) / (v + -1.0)))) - 4.5;
}
return tmp;
}
function code(v, w, r) tmp = 0.0 if (r <= 40000.0) tmp = Float64(Float64(2.0 / Float64(r * r)) - fma(Float64(0.375 * Float64(r * Float64(w * r))), w, 1.5)); else tmp = Float64(Float64(3.0 + Float64(Float64(r * Float64(w * Float64(w * r))) * Float64(Float64(0.125 * fma(v, -2.0, 3.0)) / Float64(v + -1.0)))) - 4.5); end return tmp end
code[v_, w_, r_] := If[LessEqual[r, 40000.0], N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] - N[(N[(0.375 * N[(r * N[(w * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * w + 1.5), $MachinePrecision]), $MachinePrecision], N[(N[(3.0 + N[(N[(r * N[(w * N[(w * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(0.125 * N[(v * -2.0 + 3.0), $MachinePrecision]), $MachinePrecision] / N[(v + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 40000:\\
\;\;\;\;\frac{2}{r \cdot r} - \mathsf{fma}\left(0.375 \cdot \left(r \cdot \left(w \cdot r\right)\right), w, 1.5\right)\\
\mathbf{else}:\\
\;\;\;\;\left(3 + \left(r \cdot \left(w \cdot \left(w \cdot r\right)\right)\right) \cdot \frac{0.125 \cdot \mathsf{fma}\left(v, -2, 3\right)}{v + -1}\right) - 4.5\\
\end{array}
\end{array}
if r < 4e4Initial program 82.7%
Taylor expanded in v around 0
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6476.4
Applied rewrites76.4%
Applied rewrites88.4%
Applied rewrites90.8%
if 4e4 < r Initial program 87.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in r around inf
Applied rewrites99.9%
Final simplification93.0%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (* r (* w r))))
(if (<= r 40000.0)
(- (/ 2.0 (* r r)) (fma (* 0.375 t_0) w 1.5))
(- 3.0 (fma (fma v -0.25 0.375) (/ (* w t_0) (- 1.0 v)) 4.5)))))
double code(double v, double w, double r) {
double t_0 = r * (w * r);
double tmp;
if (r <= 40000.0) {
tmp = (2.0 / (r * r)) - fma((0.375 * t_0), w, 1.5);
} else {
tmp = 3.0 - fma(fma(v, -0.25, 0.375), ((w * t_0) / (1.0 - v)), 4.5);
}
return tmp;
}
function code(v, w, r) t_0 = Float64(r * Float64(w * r)) tmp = 0.0 if (r <= 40000.0) tmp = Float64(Float64(2.0 / Float64(r * r)) - fma(Float64(0.375 * t_0), w, 1.5)); else tmp = Float64(3.0 - fma(fma(v, -0.25, 0.375), Float64(Float64(w * t_0) / Float64(1.0 - v)), 4.5)); end return tmp end
code[v_, w_, r_] := Block[{t$95$0 = N[(r * N[(w * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r, 40000.0], N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] - N[(N[(0.375 * t$95$0), $MachinePrecision] * w + 1.5), $MachinePrecision]), $MachinePrecision], N[(3.0 - N[(N[(v * -0.25 + 0.375), $MachinePrecision] * N[(N[(w * t$95$0), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision] + 4.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := r \cdot \left(w \cdot r\right)\\
\mathbf{if}\;r \leq 40000:\\
\;\;\;\;\frac{2}{r \cdot r} - \mathsf{fma}\left(0.375 \cdot t\_0, w, 1.5\right)\\
\mathbf{else}:\\
\;\;\;\;3 - \mathsf{fma}\left(\mathsf{fma}\left(v, -0.25, 0.375\right), \frac{w \cdot t\_0}{1 - v}, 4.5\right)\\
\end{array}
\end{array}
if r < 4e4Initial program 82.7%
Taylor expanded in v around 0
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6476.4
Applied rewrites76.4%
Applied rewrites88.4%
Applied rewrites90.8%
if 4e4 < r Initial program 87.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in r around inf
Applied rewrites99.9%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
Applied rewrites96.8%
Final simplification92.3%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= v 5.0)
(- t_0 (fma (* 0.375 (* r (* w r))) w 1.5))
(+ -1.5 (fma (* w (* -0.25 (* r r))) w t_0)))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (v <= 5.0) {
tmp = t_0 - fma((0.375 * (r * (w * r))), w, 1.5);
} else {
tmp = -1.5 + fma((w * (-0.25 * (r * r))), w, t_0);
}
return tmp;
}
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (v <= 5.0) tmp = Float64(t_0 - fma(Float64(0.375 * Float64(r * Float64(w * r))), w, 1.5)); else tmp = Float64(-1.5 + fma(Float64(w * Float64(-0.25 * Float64(r * r))), w, t_0)); end return tmp end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[v, 5.0], N[(t$95$0 - N[(N[(0.375 * N[(r * N[(w * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * w + 1.5), $MachinePrecision]), $MachinePrecision], N[(-1.5 + N[(N[(w * N[(-0.25 * N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * w + t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;v \leq 5:\\
\;\;\;\;t\_0 - \mathsf{fma}\left(0.375 \cdot \left(r \cdot \left(w \cdot r\right)\right), w, 1.5\right)\\
\mathbf{else}:\\
\;\;\;\;-1.5 + \mathsf{fma}\left(w \cdot \left(-0.25 \cdot \left(r \cdot r\right)\right), w, t\_0\right)\\
\end{array}
\end{array}
if v < 5Initial program 84.3%
Taylor expanded in v around 0
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6476.8
Applied rewrites76.8%
Applied rewrites87.9%
Applied rewrites93.1%
if 5 < v Initial program 82.7%
Taylor expanded in v around inf
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-+l+N/A
lower-+.f64N/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
Applied rewrites94.8%
Final simplification93.6%
(FPCore (v w r) :precision binary64 (if (<= r 8.6e+141) (+ -1.5 (fma (* w (* -0.25 (* r r))) w (/ 2.0 (* r r)))) (- (- 3.0 (* r (* r (* 0.375 (* w w))))) 4.5)))
double code(double v, double w, double r) {
double tmp;
if (r <= 8.6e+141) {
tmp = -1.5 + fma((w * (-0.25 * (r * r))), w, (2.0 / (r * r)));
} else {
tmp = (3.0 - (r * (r * (0.375 * (w * w))))) - 4.5;
}
return tmp;
}
function code(v, w, r) tmp = 0.0 if (r <= 8.6e+141) tmp = Float64(-1.5 + fma(Float64(w * Float64(-0.25 * Float64(r * r))), w, Float64(2.0 / Float64(r * r)))); else tmp = Float64(Float64(3.0 - Float64(r * Float64(r * Float64(0.375 * Float64(w * w))))) - 4.5); end return tmp end
code[v_, w_, r_] := If[LessEqual[r, 8.6e+141], N[(-1.5 + N[(N[(w * N[(-0.25 * N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * w + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(3.0 - N[(r * N[(r * N[(0.375 * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 8.6 \cdot 10^{+141}:\\
\;\;\;\;-1.5 + \mathsf{fma}\left(w \cdot \left(-0.25 \cdot \left(r \cdot r\right)\right), w, \frac{2}{r \cdot r}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(3 - r \cdot \left(r \cdot \left(0.375 \cdot \left(w \cdot w\right)\right)\right)\right) - 4.5\\
\end{array}
\end{array}
if r < 8.5999999999999997e141Initial program 83.4%
Taylor expanded in v around inf
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-+l+N/A
lower-+.f64N/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
Applied rewrites88.7%
if 8.5999999999999997e141 < r Initial program 87.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in r around inf
Applied rewrites99.9%
Taylor expanded in v around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6486.9
Applied rewrites86.9%
Final simplification88.4%
(FPCore (v w r) :precision binary64 (if (<= r 1.15) (- (/ 2.0 (* r r)) (* w (* 0.375 (* r (* w r))))) (- (- 3.0 (* r (* r (* 0.375 (* w w))))) 4.5)))
double code(double v, double w, double r) {
double tmp;
if (r <= 1.15) {
tmp = (2.0 / (r * r)) - (w * (0.375 * (r * (w * r))));
} else {
tmp = (3.0 - (r * (r * (0.375 * (w * w))))) - 4.5;
}
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 <= 1.15d0) then
tmp = (2.0d0 / (r * r)) - (w * (0.375d0 * (r * (w * r))))
else
tmp = (3.0d0 - (r * (r * (0.375d0 * (w * w))))) - 4.5d0
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double tmp;
if (r <= 1.15) {
tmp = (2.0 / (r * r)) - (w * (0.375 * (r * (w * r))));
} else {
tmp = (3.0 - (r * (r * (0.375 * (w * w))))) - 4.5;
}
return tmp;
}
def code(v, w, r): tmp = 0 if r <= 1.15: tmp = (2.0 / (r * r)) - (w * (0.375 * (r * (w * r)))) else: tmp = (3.0 - (r * (r * (0.375 * (w * w))))) - 4.5 return tmp
function code(v, w, r) tmp = 0.0 if (r <= 1.15) tmp = Float64(Float64(2.0 / Float64(r * r)) - Float64(w * Float64(0.375 * Float64(r * Float64(w * r))))); else tmp = Float64(Float64(3.0 - Float64(r * Float64(r * Float64(0.375 * Float64(w * w))))) - 4.5); end return tmp end
function tmp_2 = code(v, w, r) tmp = 0.0; if (r <= 1.15) tmp = (2.0 / (r * r)) - (w * (0.375 * (r * (w * r)))); else tmp = (3.0 - (r * (r * (0.375 * (w * w))))) - 4.5; end tmp_2 = tmp; end
code[v_, w_, r_] := If[LessEqual[r, 1.15], N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] - N[(w * N[(0.375 * N[(r * N[(w * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(3.0 - N[(r * N[(r * N[(0.375 * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 1.15:\\
\;\;\;\;\frac{2}{r \cdot r} - w \cdot \left(0.375 \cdot \left(r \cdot \left(w \cdot r\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(3 - r \cdot \left(r \cdot \left(0.375 \cdot \left(w \cdot w\right)\right)\right)\right) - 4.5\\
\end{array}
\end{array}
if r < 1.1499999999999999Initial program 82.7%
Taylor expanded in v around 0
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6476.4
Applied rewrites76.4%
Taylor expanded in w around inf
Applied rewrites73.1%
Applied rewrites84.4%
if 1.1499999999999999 < r Initial program 87.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in r around inf
Applied rewrites99.9%
Taylor expanded in v around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6486.7
Applied rewrites86.7%
Final simplification85.0%
(FPCore (v w r) :precision binary64 (+ (/ 2.0 (* r r)) -1.5))
double code(double v, double w, double r) {
return (2.0 / (r * r)) + -1.5;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
code = (2.0d0 / (r * r)) + (-1.5d0)
end function
public static double code(double v, double w, double r) {
return (2.0 / (r * r)) + -1.5;
}
def code(v, w, r): return (2.0 / (r * r)) + -1.5
function code(v, w, r) return Float64(Float64(2.0 / Float64(r * r)) + -1.5) end
function tmp = code(v, w, r) tmp = (2.0 / (r * r)) + -1.5; end
code[v_, w_, r_] := N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{r \cdot r} + -1.5
\end{array}
Initial program 83.8%
Taylor expanded in w around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
unpow2N/A
lower-*.f6455.4
Applied rewrites55.4%
Final simplification55.4%
(FPCore (v w r) :precision binary64 (/ 2.0 (* r r)))
double code(double v, double w, double r) {
return 2.0 / (r * r);
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
code = 2.0d0 / (r * r)
end function
public static double code(double v, double w, double r) {
return 2.0 / (r * r);
}
def code(v, w, r): return 2.0 / (r * r)
function code(v, w, r) return Float64(2.0 / Float64(r * r)) end
function tmp = code(v, w, r) tmp = 2.0 / (r * r); end
code[v_, w_, r_] := N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{r \cdot r}
\end{array}
Initial program 83.8%
Taylor expanded in r around 0
lower-/.f64N/A
unpow2N/A
lower-*.f6443.6
Applied rewrites43.6%
herbie shell --seed 2024231
(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))