
(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 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (v w r) :precision binary64 (- (- (+ 3.0 (/ 2.0 (* r r))) (/ (* (* 0.125 (- 3.0 (* 2.0 v))) (* (* (* w w) r) r)) (- 1.0 v))) 4.5))
double code(double v, double w, double r) {
return ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
code = ((3.0d0 + (2.0d0 / (r * r))) - (((0.125d0 * (3.0d0 - (2.0d0 * v))) * (((w * w) * r) * r)) / (1.0d0 - v))) - 4.5d0
end function
public static double code(double v, double w, double r) {
return ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5;
}
def code(v, w, r): return ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5
function code(v, w, r) return Float64(Float64(Float64(3.0 + Float64(2.0 / Float64(r * r))) - Float64(Float64(Float64(0.125 * Float64(3.0 - Float64(2.0 * v))) * Float64(Float64(Float64(w * w) * r) * r)) / Float64(1.0 - v))) - 4.5) end
function tmp = code(v, w, r) tmp = ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5; end
code[v_, w_, r_] := N[(N[(N[(3.0 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(0.125 * N[(3.0 - N[(2.0 * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(w * w), $MachinePrecision] * r), $MachinePrecision] * r), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5
\end{array}
(FPCore (v w r) :precision binary64 (+ (- (+ 3.0 (/ 2.0 (* r r))) (/ (* 0.125 (+ 3.0 (* -2.0 v))) (/ 1.0 (/ (* (* r w) (* r w)) (- 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))) / (1.0 / (((r * w) * (r * w)) / (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))) / (1.0d0 / (((r * w) * (r * w)) / (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))) / (1.0 / (((r * w) * (r * w)) / (1.0 - v))))) + -4.5;
}
def code(v, w, r): return ((3.0 + (2.0 / (r * r))) - ((0.125 * (3.0 + (-2.0 * v))) / (1.0 / (((r * w) * (r * w)) / (1.0 - v))))) + -4.5
function code(v, w, r) return Float64(Float64(Float64(3.0 + Float64(2.0 / Float64(r * r))) - Float64(Float64(0.125 * Float64(3.0 + Float64(-2.0 * v))) / Float64(1.0 / Float64(Float64(Float64(r * w) * Float64(r * w)) / 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))) / (1.0 / (((r * w) * (r * w)) / (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[(0.125 * N[(3.0 + N[(-2.0 * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -4.5), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{0.125 \cdot \left(3 + -2 \cdot v\right)}{\frac{1}{\frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}}}\right) + -4.5
\end{array}
Initial program 84.4%
Simplified79.5%
clear-num79.5%
inv-pow79.5%
unswap-sqr99.4%
pow299.4%
Applied egg-rr99.4%
unpow-199.4%
*-commutative99.4%
Simplified99.4%
unpow299.4%
Applied egg-rr99.4%
Final simplification99.4%
(FPCore (v w r)
:precision binary64
(+
-4.5
(-
(+ 3.0 (/ 2.0 (* r r)))
(/
(* 0.125 (+ 3.0 (* -2.0 v)))
(* (/ 1.0 (* r w)) (/ (- 1.0 v) (* r w)))))))
double code(double v, double w, double r) {
return -4.5 + ((3.0 + (2.0 / (r * r))) - ((0.125 * (3.0 + (-2.0 * v))) / ((1.0 / (r * w)) * ((1.0 - v) / (r * w)))));
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
code = (-4.5d0) + ((3.0d0 + (2.0d0 / (r * r))) - ((0.125d0 * (3.0d0 + ((-2.0d0) * v))) / ((1.0d0 / (r * w)) * ((1.0d0 - v) / (r * w)))))
end function
public static double code(double v, double w, double r) {
return -4.5 + ((3.0 + (2.0 / (r * r))) - ((0.125 * (3.0 + (-2.0 * v))) / ((1.0 / (r * w)) * ((1.0 - v) / (r * w)))));
}
def code(v, w, r): return -4.5 + ((3.0 + (2.0 / (r * r))) - ((0.125 * (3.0 + (-2.0 * v))) / ((1.0 / (r * w)) * ((1.0 - v) / (r * w)))))
function code(v, w, r) return Float64(-4.5 + Float64(Float64(3.0 + Float64(2.0 / Float64(r * r))) - Float64(Float64(0.125 * Float64(3.0 + Float64(-2.0 * v))) / Float64(Float64(1.0 / Float64(r * w)) * Float64(Float64(1.0 - v) / Float64(r * w)))))) end
function tmp = code(v, w, r) tmp = -4.5 + ((3.0 + (2.0 / (r * r))) - ((0.125 * (3.0 + (-2.0 * v))) / ((1.0 / (r * w)) * ((1.0 - v) / (r * w))))); end
code[v_, w_, r_] := N[(-4.5 + N[(N[(3.0 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(0.125 * N[(3.0 + N[(-2.0 * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 / N[(r * w), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - v), $MachinePrecision] / N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-4.5 + \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{0.125 \cdot \left(3 + -2 \cdot v\right)}{\frac{1}{r \cdot w} \cdot \frac{1 - v}{r \cdot w}}\right)
\end{array}
Initial program 84.4%
Simplified79.5%
*-un-lft-identity79.5%
add-sqr-sqrt79.5%
times-frac79.5%
unswap-sqr79.5%
sqrt-prod45.0%
add-sqr-sqrt63.7%
unswap-sqr78.0%
sqrt-prod54.6%
add-sqr-sqrt99.4%
Applied egg-rr99.4%
Final simplification99.4%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))) (t_1 (* w (* r w))))
(if (<= v -118000000.0)
(+ t_0 (- -1.5 (* t_1 (/ r 4.0))))
(if (<= v 1.65e-25)
(+
-4.5
(- (+ 3.0 t_0) (/ 0.375 (* (/ 1.0 (* r w)) (/ (- 1.0 v) (* r w))))))
(+ t_0 (- -1.5 (/ r (/ 4.0 t_1))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double t_1 = w * (r * w);
double tmp;
if (v <= -118000000.0) {
tmp = t_0 + (-1.5 - (t_1 * (r / 4.0)));
} else if (v <= 1.65e-25) {
tmp = -4.5 + ((3.0 + t_0) - (0.375 / ((1.0 / (r * w)) * ((1.0 - v) / (r * w)))));
} else {
tmp = t_0 + (-1.5 - (r / (4.0 / t_1)));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
t_1 = w * (r * w)
if (v <= (-118000000.0d0)) then
tmp = t_0 + ((-1.5d0) - (t_1 * (r / 4.0d0)))
else if (v <= 1.65d-25) then
tmp = (-4.5d0) + ((3.0d0 + t_0) - (0.375d0 / ((1.0d0 / (r * w)) * ((1.0d0 - v) / (r * w)))))
else
tmp = t_0 + ((-1.5d0) - (r / (4.0d0 / t_1)))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double t_1 = w * (r * w);
double tmp;
if (v <= -118000000.0) {
tmp = t_0 + (-1.5 - (t_1 * (r / 4.0)));
} else if (v <= 1.65e-25) {
tmp = -4.5 + ((3.0 + t_0) - (0.375 / ((1.0 / (r * w)) * ((1.0 - v) / (r * w)))));
} else {
tmp = t_0 + (-1.5 - (r / (4.0 / t_1)));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) t_1 = w * (r * w) tmp = 0 if v <= -118000000.0: tmp = t_0 + (-1.5 - (t_1 * (r / 4.0))) elif v <= 1.65e-25: tmp = -4.5 + ((3.0 + t_0) - (0.375 / ((1.0 / (r * w)) * ((1.0 - v) / (r * w))))) else: tmp = t_0 + (-1.5 - (r / (4.0 / t_1))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) t_1 = Float64(w * Float64(r * w)) tmp = 0.0 if (v <= -118000000.0) tmp = Float64(t_0 + Float64(-1.5 - Float64(t_1 * Float64(r / 4.0)))); elseif (v <= 1.65e-25) tmp = Float64(-4.5 + Float64(Float64(3.0 + t_0) - Float64(0.375 / Float64(Float64(1.0 / Float64(r * w)) * Float64(Float64(1.0 - v) / Float64(r * w)))))); else tmp = Float64(t_0 + Float64(-1.5 - Float64(r / Float64(4.0 / t_1)))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); t_1 = w * (r * w); tmp = 0.0; if (v <= -118000000.0) tmp = t_0 + (-1.5 - (t_1 * (r / 4.0))); elseif (v <= 1.65e-25) tmp = -4.5 + ((3.0 + t_0) - (0.375 / ((1.0 / (r * w)) * ((1.0 - v) / (r * w))))); else tmp = t_0 + (-1.5 - (r / (4.0 / t_1))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[v, -118000000.0], N[(t$95$0 + N[(-1.5 - N[(t$95$1 * N[(r / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[v, 1.65e-25], N[(-4.5 + N[(N[(3.0 + t$95$0), $MachinePrecision] - N[(0.375 / N[(N[(1.0 / N[(r * w), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - v), $MachinePrecision] / N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(-1.5 - N[(r / N[(4.0 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
t_1 := w \cdot \left(r \cdot w\right)\\
\mathbf{if}\;v \leq -118000000:\\
\;\;\;\;t_0 + \left(-1.5 - t_1 \cdot \frac{r}{4}\right)\\
\mathbf{elif}\;v \leq 1.65 \cdot 10^{-25}:\\
\;\;\;\;-4.5 + \left(\left(3 + t_0\right) - \frac{0.375}{\frac{1}{r \cdot w} \cdot \frac{1 - v}{r \cdot w}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - \frac{r}{\frac{4}{t_1}}\right)\\
\end{array}
\end{array}
if v < -1.18e8Initial program 80.8%
associate--l-80.8%
+-commutative80.8%
associate--l+80.8%
+-commutative80.8%
associate--r+80.8%
metadata-eval80.8%
associate-*r*80.8%
*-commutative80.8%
associate-/l*82.3%
*-commutative82.3%
Simplified82.3%
Taylor expanded in v around inf 83.7%
unpow283.7%
Simplified83.7%
associate-/r/83.7%
associate-*r*96.1%
*-commutative96.1%
*-commutative96.1%
Applied egg-rr96.1%
if -1.18e8 < v < 1.6499999999999999e-25Initial program 86.5%
Simplified79.1%
*-un-lft-identity79.1%
add-sqr-sqrt79.0%
times-frac79.0%
unswap-sqr79.0%
sqrt-prod44.1%
add-sqr-sqrt62.0%
unswap-sqr79.5%
sqrt-prod55.1%
add-sqr-sqrt99.7%
Applied egg-rr99.7%
Taylor expanded in v around 0 99.7%
if 1.6499999999999999e-25 < v Initial program 84.1%
associate--l-84.1%
+-commutative84.1%
associate--l+84.1%
+-commutative84.1%
associate--r+84.1%
metadata-eval84.1%
associate-*r*84.0%
*-commutative84.0%
associate-/l*85.5%
*-commutative85.5%
Simplified85.5%
Taylor expanded in v around inf 88.4%
unpow288.4%
associate-*r*97.1%
*-commutative97.1%
associate-*l*97.1%
Simplified97.1%
Final simplification98.1%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))) (t_1 (* w (* r w))))
(if (<= v -100000000.0)
(+ t_0 (- -1.5 (* t_1 (/ r 4.0))))
(if (<= v 1.65e-25)
(+
-4.5
(- (+ 3.0 t_0) (/ 0.375 (/ 1.0 (/ (* (* r w) (* r w)) (- 1.0 v))))))
(+ t_0 (- -1.5 (/ r (/ 4.0 t_1))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double t_1 = w * (r * w);
double tmp;
if (v <= -100000000.0) {
tmp = t_0 + (-1.5 - (t_1 * (r / 4.0)));
} else if (v <= 1.65e-25) {
tmp = -4.5 + ((3.0 + t_0) - (0.375 / (1.0 / (((r * w) * (r * w)) / (1.0 - v)))));
} else {
tmp = t_0 + (-1.5 - (r / (4.0 / t_1)));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
t_1 = w * (r * w)
if (v <= (-100000000.0d0)) then
tmp = t_0 + ((-1.5d0) - (t_1 * (r / 4.0d0)))
else if (v <= 1.65d-25) then
tmp = (-4.5d0) + ((3.0d0 + t_0) - (0.375d0 / (1.0d0 / (((r * w) * (r * w)) / (1.0d0 - v)))))
else
tmp = t_0 + ((-1.5d0) - (r / (4.0d0 / t_1)))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double t_1 = w * (r * w);
double tmp;
if (v <= -100000000.0) {
tmp = t_0 + (-1.5 - (t_1 * (r / 4.0)));
} else if (v <= 1.65e-25) {
tmp = -4.5 + ((3.0 + t_0) - (0.375 / (1.0 / (((r * w) * (r * w)) / (1.0 - v)))));
} else {
tmp = t_0 + (-1.5 - (r / (4.0 / t_1)));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) t_1 = w * (r * w) tmp = 0 if v <= -100000000.0: tmp = t_0 + (-1.5 - (t_1 * (r / 4.0))) elif v <= 1.65e-25: tmp = -4.5 + ((3.0 + t_0) - (0.375 / (1.0 / (((r * w) * (r * w)) / (1.0 - v))))) else: tmp = t_0 + (-1.5 - (r / (4.0 / t_1))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) t_1 = Float64(w * Float64(r * w)) tmp = 0.0 if (v <= -100000000.0) tmp = Float64(t_0 + Float64(-1.5 - Float64(t_1 * Float64(r / 4.0)))); elseif (v <= 1.65e-25) tmp = Float64(-4.5 + Float64(Float64(3.0 + t_0) - Float64(0.375 / Float64(1.0 / Float64(Float64(Float64(r * w) * Float64(r * w)) / Float64(1.0 - v)))))); else tmp = Float64(t_0 + Float64(-1.5 - Float64(r / Float64(4.0 / t_1)))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); t_1 = w * (r * w); tmp = 0.0; if (v <= -100000000.0) tmp = t_0 + (-1.5 - (t_1 * (r / 4.0))); elseif (v <= 1.65e-25) tmp = -4.5 + ((3.0 + t_0) - (0.375 / (1.0 / (((r * w) * (r * w)) / (1.0 - v))))); else tmp = t_0 + (-1.5 - (r / (4.0 / t_1))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[v, -100000000.0], N[(t$95$0 + N[(-1.5 - N[(t$95$1 * N[(r / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[v, 1.65e-25], N[(-4.5 + N[(N[(3.0 + t$95$0), $MachinePrecision] - N[(0.375 / N[(1.0 / N[(N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(-1.5 - N[(r / N[(4.0 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
t_1 := w \cdot \left(r \cdot w\right)\\
\mathbf{if}\;v \leq -100000000:\\
\;\;\;\;t_0 + \left(-1.5 - t_1 \cdot \frac{r}{4}\right)\\
\mathbf{elif}\;v \leq 1.65 \cdot 10^{-25}:\\
\;\;\;\;-4.5 + \left(\left(3 + t_0\right) - \frac{0.375}{\frac{1}{\frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - \frac{r}{\frac{4}{t_1}}\right)\\
\end{array}
\end{array}
if v < -1e8Initial program 80.8%
associate--l-80.8%
+-commutative80.8%
associate--l+80.8%
+-commutative80.8%
associate--r+80.8%
metadata-eval80.8%
associate-*r*80.8%
*-commutative80.8%
associate-/l*82.3%
*-commutative82.3%
Simplified82.3%
Taylor expanded in v around inf 83.7%
unpow283.7%
Simplified83.7%
associate-/r/83.7%
associate-*r*96.1%
*-commutative96.1%
*-commutative96.1%
Applied egg-rr96.1%
if -1e8 < v < 1.6499999999999999e-25Initial program 86.5%
Simplified79.1%
clear-num79.1%
inv-pow79.1%
unswap-sqr99.8%
pow299.8%
Applied egg-rr99.8%
unpow-199.8%
*-commutative99.8%
Simplified99.8%
unpow299.8%
Applied egg-rr99.8%
Taylor expanded in v around 0 99.7%
if 1.6499999999999999e-25 < v Initial program 84.1%
associate--l-84.1%
+-commutative84.1%
associate--l+84.1%
+-commutative84.1%
associate--r+84.1%
metadata-eval84.1%
associate-*r*84.0%
*-commutative84.0%
associate-/l*85.5%
*-commutative85.5%
Simplified85.5%
Taylor expanded in v around inf 88.4%
unpow288.4%
associate-*r*97.1%
*-commutative97.1%
associate-*l*97.1%
Simplified97.1%
Final simplification98.1%
(FPCore (v w r)
:precision binary64
(if (<= r 1.26e-50)
(+
-4.5
(-
(+ 3.0 (/ 2.0 (* r r)))
(/ (* v -0.25) (/ 1.0 (/ (* (* r w) (* r w)) (- 1.0 v))))))
(+
(- -1.5 (* (* r (* w (* r w))) (/ (+ (* v -0.25) 0.375) (- 1.0 v))))
(* (/ 2.0 r) (/ 1.0 r)))))
double code(double v, double w, double r) {
double tmp;
if (r <= 1.26e-50) {
tmp = -4.5 + ((3.0 + (2.0 / (r * r))) - ((v * -0.25) / (1.0 / (((r * w) * (r * w)) / (1.0 - v)))));
} else {
tmp = (-1.5 - ((r * (w * (r * w))) * (((v * -0.25) + 0.375) / (1.0 - v)))) + ((2.0 / r) * (1.0 / r));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: tmp
if (r <= 1.26d-50) then
tmp = (-4.5d0) + ((3.0d0 + (2.0d0 / (r * r))) - ((v * (-0.25d0)) / (1.0d0 / (((r * w) * (r * w)) / (1.0d0 - v)))))
else
tmp = ((-1.5d0) - ((r * (w * (r * w))) * (((v * (-0.25d0)) + 0.375d0) / (1.0d0 - v)))) + ((2.0d0 / r) * (1.0d0 / r))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double tmp;
if (r <= 1.26e-50) {
tmp = -4.5 + ((3.0 + (2.0 / (r * r))) - ((v * -0.25) / (1.0 / (((r * w) * (r * w)) / (1.0 - v)))));
} else {
tmp = (-1.5 - ((r * (w * (r * w))) * (((v * -0.25) + 0.375) / (1.0 - v)))) + ((2.0 / r) * (1.0 / r));
}
return tmp;
}
def code(v, w, r): tmp = 0 if r <= 1.26e-50: tmp = -4.5 + ((3.0 + (2.0 / (r * r))) - ((v * -0.25) / (1.0 / (((r * w) * (r * w)) / (1.0 - v))))) else: tmp = (-1.5 - ((r * (w * (r * w))) * (((v * -0.25) + 0.375) / (1.0 - v)))) + ((2.0 / r) * (1.0 / r)) return tmp
function code(v, w, r) tmp = 0.0 if (r <= 1.26e-50) tmp = Float64(-4.5 + Float64(Float64(3.0 + Float64(2.0 / Float64(r * r))) - Float64(Float64(v * -0.25) / Float64(1.0 / Float64(Float64(Float64(r * w) * Float64(r * w)) / Float64(1.0 - v)))))); else tmp = Float64(Float64(-1.5 - Float64(Float64(r * Float64(w * Float64(r * w))) * Float64(Float64(Float64(v * -0.25) + 0.375) / Float64(1.0 - v)))) + Float64(Float64(2.0 / r) * Float64(1.0 / r))); end return tmp end
function tmp_2 = code(v, w, r) tmp = 0.0; if (r <= 1.26e-50) tmp = -4.5 + ((3.0 + (2.0 / (r * r))) - ((v * -0.25) / (1.0 / (((r * w) * (r * w)) / (1.0 - v))))); else tmp = (-1.5 - ((r * (w * (r * w))) * (((v * -0.25) + 0.375) / (1.0 - v)))) + ((2.0 / r) * (1.0 / r)); end tmp_2 = tmp; end
code[v_, w_, r_] := If[LessEqual[r, 1.26e-50], N[(-4.5 + N[(N[(3.0 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(v * -0.25), $MachinePrecision] / N[(1.0 / N[(N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.5 - N[(N[(r * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(v * -0.25), $MachinePrecision] + 0.375), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 / r), $MachinePrecision] * N[(1.0 / r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 1.26 \cdot 10^{-50}:\\
\;\;\;\;-4.5 + \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{v \cdot -0.25}{\frac{1}{\frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-1.5 - \left(r \cdot \left(w \cdot \left(r \cdot w\right)\right)\right) \cdot \frac{v \cdot -0.25 + 0.375}{1 - v}\right) + \frac{2}{r} \cdot \frac{1}{r}\\
\end{array}
\end{array}
if r < 1.26e-50Initial program 82.1%
Simplified78.1%
clear-num78.1%
inv-pow78.1%
unswap-sqr99.8%
pow299.8%
Applied egg-rr99.8%
unpow-199.8%
*-commutative99.8%
Simplified99.8%
unpow299.8%
Applied egg-rr99.8%
Taylor expanded in v around inf 90.4%
*-commutative90.4%
Simplified90.4%
if 1.26e-50 < r Initial program 91.9%
associate--l-91.9%
+-commutative91.9%
associate--l+91.9%
+-commutative91.9%
associate--r+91.9%
metadata-eval91.9%
associate-*l/95.1%
*-commutative95.1%
*-commutative95.1%
*-commutative95.1%
Simplified95.1%
clear-num13.1%
inv-pow13.1%
Applied egg-rr95.1%
unpow-113.1%
associate-/l*13.1%
Simplified95.2%
Taylor expanded in r around 0 95.2%
unpow295.1%
associate-*r*98.3%
*-commutative98.3%
associate-*l*98.3%
Simplified98.3%
associate-/r/98.3%
Applied egg-rr98.3%
Final simplification92.2%
(FPCore (v w r)
:precision binary64
(if (<= r 2.05e-35)
(+
-4.5
(-
(+ 3.0 (/ 2.0 (* r r)))
(/ (* v -0.25) (/ 1.0 (/ (* (* r w) (* r w)) (- 1.0 v))))))
(+
(/ 1.0 (/ r (/ 2.0 r)))
(- -1.5 (* (* r (* w (* r w))) (/ (+ (* v -0.25) 0.375) (- 1.0 v)))))))
double code(double v, double w, double r) {
double tmp;
if (r <= 2.05e-35) {
tmp = -4.5 + ((3.0 + (2.0 / (r * r))) - ((v * -0.25) / (1.0 / (((r * w) * (r * w)) / (1.0 - v)))));
} else {
tmp = (1.0 / (r / (2.0 / r))) + (-1.5 - ((r * (w * (r * w))) * (((v * -0.25) + 0.375) / (1.0 - v))));
}
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 <= 2.05d-35) then
tmp = (-4.5d0) + ((3.0d0 + (2.0d0 / (r * r))) - ((v * (-0.25d0)) / (1.0d0 / (((r * w) * (r * w)) / (1.0d0 - v)))))
else
tmp = (1.0d0 / (r / (2.0d0 / r))) + ((-1.5d0) - ((r * (w * (r * w))) * (((v * (-0.25d0)) + 0.375d0) / (1.0d0 - v))))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double tmp;
if (r <= 2.05e-35) {
tmp = -4.5 + ((3.0 + (2.0 / (r * r))) - ((v * -0.25) / (1.0 / (((r * w) * (r * w)) / (1.0 - v)))));
} else {
tmp = (1.0 / (r / (2.0 / r))) + (-1.5 - ((r * (w * (r * w))) * (((v * -0.25) + 0.375) / (1.0 - v))));
}
return tmp;
}
def code(v, w, r): tmp = 0 if r <= 2.05e-35: tmp = -4.5 + ((3.0 + (2.0 / (r * r))) - ((v * -0.25) / (1.0 / (((r * w) * (r * w)) / (1.0 - v))))) else: tmp = (1.0 / (r / (2.0 / r))) + (-1.5 - ((r * (w * (r * w))) * (((v * -0.25) + 0.375) / (1.0 - v)))) return tmp
function code(v, w, r) tmp = 0.0 if (r <= 2.05e-35) tmp = Float64(-4.5 + Float64(Float64(3.0 + Float64(2.0 / Float64(r * r))) - Float64(Float64(v * -0.25) / Float64(1.0 / Float64(Float64(Float64(r * w) * Float64(r * w)) / Float64(1.0 - v)))))); else tmp = Float64(Float64(1.0 / Float64(r / Float64(2.0 / r))) + Float64(-1.5 - Float64(Float64(r * Float64(w * Float64(r * w))) * Float64(Float64(Float64(v * -0.25) + 0.375) / Float64(1.0 - v))))); end return tmp end
function tmp_2 = code(v, w, r) tmp = 0.0; if (r <= 2.05e-35) tmp = -4.5 + ((3.0 + (2.0 / (r * r))) - ((v * -0.25) / (1.0 / (((r * w) * (r * w)) / (1.0 - v))))); else tmp = (1.0 / (r / (2.0 / r))) + (-1.5 - ((r * (w * (r * w))) * (((v * -0.25) + 0.375) / (1.0 - v)))); end tmp_2 = tmp; end
code[v_, w_, r_] := If[LessEqual[r, 2.05e-35], N[(-4.5 + N[(N[(3.0 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(v * -0.25), $MachinePrecision] / N[(1.0 / N[(N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(r / N[(2.0 / r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.5 - N[(N[(r * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(v * -0.25), $MachinePrecision] + 0.375), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 2.05 \cdot 10^{-35}:\\
\;\;\;\;-4.5 + \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{v \cdot -0.25}{\frac{1}{\frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{r}{\frac{2}{r}}} + \left(-1.5 - \left(r \cdot \left(w \cdot \left(r \cdot w\right)\right)\right) \cdot \frac{v \cdot -0.25 + 0.375}{1 - v}\right)\\
\end{array}
\end{array}
if r < 2.05000000000000013e-35Initial program 82.4%
Simplified78.5%
clear-num78.5%
inv-pow78.5%
unswap-sqr99.7%
pow299.7%
Applied egg-rr99.7%
unpow-199.7%
*-commutative99.7%
Simplified99.7%
unpow299.7%
Applied egg-rr99.7%
Taylor expanded in v around inf 90.5%
*-commutative90.5%
Simplified90.5%
if 2.05000000000000013e-35 < r Initial program 91.5%
associate--l-91.5%
+-commutative91.5%
associate--l+91.5%
+-commutative91.5%
associate--r+91.5%
metadata-eval91.5%
associate-*l/94.8%
*-commutative94.8%
*-commutative94.8%
*-commutative94.8%
Simplified94.9%
clear-num8.6%
inv-pow8.6%
Applied egg-rr94.9%
unpow-18.6%
associate-/l*8.6%
Simplified94.9%
Taylor expanded in r around 0 94.9%
unpow294.9%
associate-*r*98.3%
*-commutative98.3%
associate-*l*98.3%
Simplified98.3%
Final simplification92.2%
(FPCore (v w r)
:precision binary64
(if (<= r 4e-147)
(/ 1.0 (/ r (/ 2.0 r)))
(+
(/ 2.0 (* r r))
(- -1.5 (* (* r (* w (* r w))) (/ (+ (* v -0.25) 0.375) (- 1.0 v)))))))
double code(double v, double w, double r) {
double tmp;
if (r <= 4e-147) {
tmp = 1.0 / (r / (2.0 / r));
} else {
tmp = (2.0 / (r * r)) + (-1.5 - ((r * (w * (r * w))) * (((v * -0.25) + 0.375) / (1.0 - v))));
}
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 <= 4d-147) then
tmp = 1.0d0 / (r / (2.0d0 / r))
else
tmp = (2.0d0 / (r * r)) + ((-1.5d0) - ((r * (w * (r * w))) * (((v * (-0.25d0)) + 0.375d0) / (1.0d0 - v))))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double tmp;
if (r <= 4e-147) {
tmp = 1.0 / (r / (2.0 / r));
} else {
tmp = (2.0 / (r * r)) + (-1.5 - ((r * (w * (r * w))) * (((v * -0.25) + 0.375) / (1.0 - v))));
}
return tmp;
}
def code(v, w, r): tmp = 0 if r <= 4e-147: tmp = 1.0 / (r / (2.0 / r)) else: tmp = (2.0 / (r * r)) + (-1.5 - ((r * (w * (r * w))) * (((v * -0.25) + 0.375) / (1.0 - v)))) return tmp
function code(v, w, r) tmp = 0.0 if (r <= 4e-147) tmp = Float64(1.0 / Float64(r / Float64(2.0 / r))); else tmp = Float64(Float64(2.0 / Float64(r * r)) + Float64(-1.5 - Float64(Float64(r * Float64(w * Float64(r * w))) * Float64(Float64(Float64(v * -0.25) + 0.375) / Float64(1.0 - v))))); end return tmp end
function tmp_2 = code(v, w, r) tmp = 0.0; if (r <= 4e-147) tmp = 1.0 / (r / (2.0 / r)); else tmp = (2.0 / (r * r)) + (-1.5 - ((r * (w * (r * w))) * (((v * -0.25) + 0.375) / (1.0 - v)))); end tmp_2 = tmp; end
code[v_, w_, r_] := If[LessEqual[r, 4e-147], N[(1.0 / N[(r / N[(2.0 / r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + N[(-1.5 - N[(N[(r * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(v * -0.25), $MachinePrecision] + 0.375), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 4 \cdot 10^{-147}:\\
\;\;\;\;\frac{1}{\frac{r}{\frac{2}{r}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{r \cdot r} + \left(-1.5 - \left(r \cdot \left(w \cdot \left(r \cdot w\right)\right)\right) \cdot \frac{v \cdot -0.25 + 0.375}{1 - v}\right)\\
\end{array}
\end{array}
if r < 3.9999999999999999e-147Initial program 80.4%
Simplified75.9%
Taylor expanded in v around inf 74.0%
*-commutative74.0%
unpow274.0%
unpow274.0%
*-commutative74.0%
Simplified74.0%
Taylor expanded in r around 0 53.9%
unpow253.9%
Simplified53.9%
clear-num53.9%
inv-pow53.9%
Applied egg-rr53.9%
unpow-153.9%
associate-/l*53.9%
Simplified53.9%
if 3.9999999999999999e-147 < r Initial program 92.8%
associate--l-92.8%
+-commutative92.8%
associate--l+92.8%
+-commutative92.8%
associate--r+92.8%
metadata-eval92.8%
associate-*l/95.1%
*-commutative95.1%
*-commutative95.1%
*-commutative95.1%
Simplified95.2%
Taylor expanded in r around 0 95.2%
unpow295.2%
associate-*r*98.7%
*-commutative98.7%
associate-*l*98.7%
Simplified98.7%
Final simplification68.4%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))) (t_1 (* w (* r w))))
(if (<= v -23000000.0)
(+ t_0 (- -1.5 (* t_1 (/ r 4.0))))
(if (<= v 1.65e-25)
(+ t_0 (- -1.5 (/ r (/ (/ 2.6666666666666665 (* r w)) w))))
(+ t_0 (- -1.5 (/ r (/ 4.0 t_1))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double t_1 = w * (r * w);
double tmp;
if (v <= -23000000.0) {
tmp = t_0 + (-1.5 - (t_1 * (r / 4.0)));
} else if (v <= 1.65e-25) {
tmp = t_0 + (-1.5 - (r / ((2.6666666666666665 / (r * w)) / w)));
} else {
tmp = t_0 + (-1.5 - (r / (4.0 / t_1)));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
t_1 = w * (r * w)
if (v <= (-23000000.0d0)) then
tmp = t_0 + ((-1.5d0) - (t_1 * (r / 4.0d0)))
else if (v <= 1.65d-25) then
tmp = t_0 + ((-1.5d0) - (r / ((2.6666666666666665d0 / (r * w)) / w)))
else
tmp = t_0 + ((-1.5d0) - (r / (4.0d0 / t_1)))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double t_1 = w * (r * w);
double tmp;
if (v <= -23000000.0) {
tmp = t_0 + (-1.5 - (t_1 * (r / 4.0)));
} else if (v <= 1.65e-25) {
tmp = t_0 + (-1.5 - (r / ((2.6666666666666665 / (r * w)) / w)));
} else {
tmp = t_0 + (-1.5 - (r / (4.0 / t_1)));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) t_1 = w * (r * w) tmp = 0 if v <= -23000000.0: tmp = t_0 + (-1.5 - (t_1 * (r / 4.0))) elif v <= 1.65e-25: tmp = t_0 + (-1.5 - (r / ((2.6666666666666665 / (r * w)) / w))) else: tmp = t_0 + (-1.5 - (r / (4.0 / t_1))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) t_1 = Float64(w * Float64(r * w)) tmp = 0.0 if (v <= -23000000.0) tmp = Float64(t_0 + Float64(-1.5 - Float64(t_1 * Float64(r / 4.0)))); elseif (v <= 1.65e-25) tmp = Float64(t_0 + Float64(-1.5 - Float64(r / Float64(Float64(2.6666666666666665 / Float64(r * w)) / w)))); else tmp = Float64(t_0 + Float64(-1.5 - Float64(r / Float64(4.0 / t_1)))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); t_1 = w * (r * w); tmp = 0.0; if (v <= -23000000.0) tmp = t_0 + (-1.5 - (t_1 * (r / 4.0))); elseif (v <= 1.65e-25) tmp = t_0 + (-1.5 - (r / ((2.6666666666666665 / (r * w)) / w))); else tmp = t_0 + (-1.5 - (r / (4.0 / t_1))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[v, -23000000.0], N[(t$95$0 + N[(-1.5 - N[(t$95$1 * N[(r / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[v, 1.65e-25], N[(t$95$0 + N[(-1.5 - N[(r / N[(N[(2.6666666666666665 / N[(r * w), $MachinePrecision]), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(-1.5 - N[(r / N[(4.0 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
t_1 := w \cdot \left(r \cdot w\right)\\
\mathbf{if}\;v \leq -23000000:\\
\;\;\;\;t_0 + \left(-1.5 - t_1 \cdot \frac{r}{4}\right)\\
\mathbf{elif}\;v \leq 1.65 \cdot 10^{-25}:\\
\;\;\;\;t_0 + \left(-1.5 - \frac{r}{\frac{\frac{2.6666666666666665}{r \cdot w}}{w}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - \frac{r}{\frac{4}{t_1}}\right)\\
\end{array}
\end{array}
if v < -2.3e7Initial program 80.8%
associate--l-80.8%
+-commutative80.8%
associate--l+80.8%
+-commutative80.8%
associate--r+80.8%
metadata-eval80.8%
associate-*r*80.8%
*-commutative80.8%
associate-/l*82.3%
*-commutative82.3%
Simplified82.3%
Taylor expanded in v around inf 83.7%
unpow283.7%
Simplified83.7%
associate-/r/83.7%
associate-*r*96.1%
*-commutative96.1%
*-commutative96.1%
Applied egg-rr96.1%
if -2.3e7 < v < 1.6499999999999999e-25Initial program 86.5%
associate--l-86.5%
+-commutative86.5%
associate--l+86.5%
+-commutative86.5%
associate--r+86.5%
metadata-eval86.5%
associate-*r*86.6%
*-commutative86.6%
associate-/l*86.6%
*-commutative86.6%
Simplified86.6%
Taylor expanded in v around 0 86.5%
unpow286.5%
Simplified86.5%
Taylor expanded in r around 0 86.5%
unpow286.5%
associate-*r*92.5%
Simplified92.5%
associate-/r*95.4%
div-inv95.4%
Applied egg-rr95.4%
associate-*r/95.4%
*-rgt-identity95.4%
Simplified95.4%
if 1.6499999999999999e-25 < v Initial program 84.1%
associate--l-84.1%
+-commutative84.1%
associate--l+84.1%
+-commutative84.1%
associate--r+84.1%
metadata-eval84.1%
associate-*r*84.0%
*-commutative84.0%
associate-/l*85.5%
*-commutative85.5%
Simplified85.5%
Taylor expanded in v around inf 88.4%
unpow288.4%
associate-*r*97.1%
*-commutative97.1%
associate-*l*97.1%
Simplified97.1%
Final simplification96.0%
(FPCore (v w r) :precision binary64 (if (<= r 1.6e-145) (/ 1.0 (/ r (/ 2.0 r))) (+ (/ 2.0 (* r r)) (- -1.5 (* (* r 0.375) (* r (* w w)))))))
double code(double v, double w, double r) {
double tmp;
if (r <= 1.6e-145) {
tmp = 1.0 / (r / (2.0 / r));
} else {
tmp = (2.0 / (r * r)) + (-1.5 - ((r * 0.375) * (r * (w * w))));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: tmp
if (r <= 1.6d-145) then
tmp = 1.0d0 / (r / (2.0d0 / r))
else
tmp = (2.0d0 / (r * r)) + ((-1.5d0) - ((r * 0.375d0) * (r * (w * w))))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double tmp;
if (r <= 1.6e-145) {
tmp = 1.0 / (r / (2.0 / r));
} else {
tmp = (2.0 / (r * r)) + (-1.5 - ((r * 0.375) * (r * (w * w))));
}
return tmp;
}
def code(v, w, r): tmp = 0 if r <= 1.6e-145: tmp = 1.0 / (r / (2.0 / r)) else: tmp = (2.0 / (r * r)) + (-1.5 - ((r * 0.375) * (r * (w * w)))) return tmp
function code(v, w, r) tmp = 0.0 if (r <= 1.6e-145) tmp = Float64(1.0 / Float64(r / Float64(2.0 / r))); else tmp = Float64(Float64(2.0 / Float64(r * r)) + Float64(-1.5 - Float64(Float64(r * 0.375) * Float64(r * Float64(w * w))))); end return tmp end
function tmp_2 = code(v, w, r) tmp = 0.0; if (r <= 1.6e-145) tmp = 1.0 / (r / (2.0 / r)); else tmp = (2.0 / (r * r)) + (-1.5 - ((r * 0.375) * (r * (w * w)))); end tmp_2 = tmp; end
code[v_, w_, r_] := If[LessEqual[r, 1.6e-145], N[(1.0 / N[(r / N[(2.0 / r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + N[(-1.5 - N[(N[(r * 0.375), $MachinePrecision] * N[(r * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 1.6 \cdot 10^{-145}:\\
\;\;\;\;\frac{1}{\frac{r}{\frac{2}{r}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{r \cdot r} + \left(-1.5 - \left(r \cdot 0.375\right) \cdot \left(r \cdot \left(w \cdot w\right)\right)\right)\\
\end{array}
\end{array}
if r < 1.60000000000000004e-145Initial program 80.4%
Simplified75.9%
Taylor expanded in v around inf 74.0%
*-commutative74.0%
unpow274.0%
unpow274.0%
*-commutative74.0%
Simplified74.0%
Taylor expanded in r around 0 53.9%
unpow253.9%
Simplified53.9%
clear-num53.9%
inv-pow53.9%
Applied egg-rr53.9%
unpow-153.9%
associate-/l*53.9%
Simplified53.9%
if 1.60000000000000004e-145 < r Initial program 92.8%
associate--l-92.8%
+-commutative92.8%
associate--l+92.8%
+-commutative92.8%
associate--r+92.8%
metadata-eval92.8%
associate-*r*92.9%
*-commutative92.9%
associate-/l*94.0%
*-commutative94.0%
Simplified94.1%
Taylor expanded in v around 0 90.4%
unpow290.4%
Simplified90.4%
Taylor expanded in r around 0 90.4%
unpow290.4%
associate-*r*92.0%
Simplified92.0%
associate-/r/92.0%
div-inv92.0%
metadata-eval92.0%
associate-*l*90.4%
Applied egg-rr90.4%
Final simplification65.7%
(FPCore (v w r) :precision binary64 (if (<= r 3.8e-146) (/ 1.0 (/ r (/ 2.0 r))) (+ (/ 2.0 (* r r)) (- -1.5 (* (* w (* r w)) (/ r 4.0))))))
double code(double v, double w, double r) {
double tmp;
if (r <= 3.8e-146) {
tmp = 1.0 / (r / (2.0 / r));
} else {
tmp = (2.0 / (r * r)) + (-1.5 - ((w * (r * w)) * (r / 4.0)));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: tmp
if (r <= 3.8d-146) then
tmp = 1.0d0 / (r / (2.0d0 / r))
else
tmp = (2.0d0 / (r * r)) + ((-1.5d0) - ((w * (r * w)) * (r / 4.0d0)))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double tmp;
if (r <= 3.8e-146) {
tmp = 1.0 / (r / (2.0 / r));
} else {
tmp = (2.0 / (r * r)) + (-1.5 - ((w * (r * w)) * (r / 4.0)));
}
return tmp;
}
def code(v, w, r): tmp = 0 if r <= 3.8e-146: tmp = 1.0 / (r / (2.0 / r)) else: tmp = (2.0 / (r * r)) + (-1.5 - ((w * (r * w)) * (r / 4.0))) return tmp
function code(v, w, r) tmp = 0.0 if (r <= 3.8e-146) tmp = Float64(1.0 / Float64(r / Float64(2.0 / r))); else tmp = Float64(Float64(2.0 / Float64(r * r)) + Float64(-1.5 - Float64(Float64(w * Float64(r * w)) * Float64(r / 4.0)))); end return tmp end
function tmp_2 = code(v, w, r) tmp = 0.0; if (r <= 3.8e-146) tmp = 1.0 / (r / (2.0 / r)); else tmp = (2.0 / (r * r)) + (-1.5 - ((w * (r * w)) * (r / 4.0))); end tmp_2 = tmp; end
code[v_, w_, r_] := If[LessEqual[r, 3.8e-146], N[(1.0 / N[(r / N[(2.0 / r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + N[(-1.5 - N[(N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision] * N[(r / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 3.8 \cdot 10^{-146}:\\
\;\;\;\;\frac{1}{\frac{r}{\frac{2}{r}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{r \cdot r} + \left(-1.5 - \left(w \cdot \left(r \cdot w\right)\right) \cdot \frac{r}{4}\right)\\
\end{array}
\end{array}
if r < 3.79999999999999994e-146Initial program 80.4%
Simplified75.9%
Taylor expanded in v around inf 74.0%
*-commutative74.0%
unpow274.0%
unpow274.0%
*-commutative74.0%
Simplified74.0%
Taylor expanded in r around 0 53.9%
unpow253.9%
Simplified53.9%
clear-num53.9%
inv-pow53.9%
Applied egg-rr53.9%
unpow-153.9%
associate-/l*53.9%
Simplified53.9%
if 3.79999999999999994e-146 < r Initial program 92.8%
associate--l-92.8%
+-commutative92.8%
associate--l+92.8%
+-commutative92.8%
associate--r+92.8%
metadata-eval92.8%
associate-*r*92.9%
*-commutative92.9%
associate-/l*94.0%
*-commutative94.0%
Simplified94.1%
Taylor expanded in v around inf 88.5%
unpow288.5%
Simplified88.5%
associate-/r/88.5%
associate-*r*92.0%
*-commutative92.0%
*-commutative92.0%
Applied egg-rr92.0%
Final simplification66.2%
(FPCore (v w r) :precision binary64 (if (<= r 4e-147) (/ 1.0 (/ r (/ 2.0 r))) (+ (/ 2.0 (* r r)) (- -1.5 (/ r (/ 4.0 (* w (* r w))))))))
double code(double v, double w, double r) {
double tmp;
if (r <= 4e-147) {
tmp = 1.0 / (r / (2.0 / r));
} else {
tmp = (2.0 / (r * r)) + (-1.5 - (r / (4.0 / (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 (r <= 4d-147) then
tmp = 1.0d0 / (r / (2.0d0 / r))
else
tmp = (2.0d0 / (r * r)) + ((-1.5d0) - (r / (4.0d0 / (w * (r * w)))))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double tmp;
if (r <= 4e-147) {
tmp = 1.0 / (r / (2.0 / r));
} else {
tmp = (2.0 / (r * r)) + (-1.5 - (r / (4.0 / (w * (r * w)))));
}
return tmp;
}
def code(v, w, r): tmp = 0 if r <= 4e-147: tmp = 1.0 / (r / (2.0 / r)) else: tmp = (2.0 / (r * r)) + (-1.5 - (r / (4.0 / (w * (r * w))))) return tmp
function code(v, w, r) tmp = 0.0 if (r <= 4e-147) tmp = Float64(1.0 / Float64(r / Float64(2.0 / r))); else tmp = Float64(Float64(2.0 / Float64(r * r)) + Float64(-1.5 - Float64(r / Float64(4.0 / Float64(w * Float64(r * w)))))); end return tmp end
function tmp_2 = code(v, w, r) tmp = 0.0; if (r <= 4e-147) tmp = 1.0 / (r / (2.0 / r)); else tmp = (2.0 / (r * r)) + (-1.5 - (r / (4.0 / (w * (r * w))))); end tmp_2 = tmp; end
code[v_, w_, r_] := If[LessEqual[r, 4e-147], N[(1.0 / N[(r / N[(2.0 / r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + N[(-1.5 - N[(r / N[(4.0 / N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 4 \cdot 10^{-147}:\\
\;\;\;\;\frac{1}{\frac{r}{\frac{2}{r}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{r \cdot r} + \left(-1.5 - \frac{r}{\frac{4}{w \cdot \left(r \cdot w\right)}}\right)\\
\end{array}
\end{array}
if r < 3.9999999999999999e-147Initial program 80.4%
Simplified75.9%
Taylor expanded in v around inf 74.0%
*-commutative74.0%
unpow274.0%
unpow274.0%
*-commutative74.0%
Simplified74.0%
Taylor expanded in r around 0 53.9%
unpow253.9%
Simplified53.9%
clear-num53.9%
inv-pow53.9%
Applied egg-rr53.9%
unpow-153.9%
associate-/l*53.9%
Simplified53.9%
if 3.9999999999999999e-147 < r Initial program 92.8%
associate--l-92.8%
+-commutative92.8%
associate--l+92.8%
+-commutative92.8%
associate--r+92.8%
metadata-eval92.8%
associate-*r*92.9%
*-commutative92.9%
associate-/l*94.0%
*-commutative94.0%
Simplified94.1%
Taylor expanded in v around inf 88.5%
unpow288.5%
associate-*r*92.0%
*-commutative92.0%
associate-*l*92.0%
Simplified92.0%
Final simplification66.2%
(FPCore (v w r) :precision binary64 (if (<= r 8e-6) (/ 2.0 (* r r)) -1.5))
double code(double v, double w, double r) {
double tmp;
if (r <= 8e-6) {
tmp = 2.0 / (r * r);
} else {
tmp = -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) :: tmp
if (r <= 8d-6) then
tmp = 2.0d0 / (r * r)
else
tmp = -1.5d0
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double tmp;
if (r <= 8e-6) {
tmp = 2.0 / (r * r);
} else {
tmp = -1.5;
}
return tmp;
}
def code(v, w, r): tmp = 0 if r <= 8e-6: tmp = 2.0 / (r * r) else: tmp = -1.5 return tmp
function code(v, w, r) tmp = 0.0 if (r <= 8e-6) tmp = Float64(2.0 / Float64(r * r)); else tmp = -1.5; end return tmp end
function tmp_2 = code(v, w, r) tmp = 0.0; if (r <= 8e-6) tmp = 2.0 / (r * r); else tmp = -1.5; end tmp_2 = tmp; end
code[v_, w_, r_] := If[LessEqual[r, 8e-6], N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision], -1.5]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 8 \cdot 10^{-6}:\\
\;\;\;\;\frac{2}{r \cdot r}\\
\mathbf{else}:\\
\;\;\;\;-1.5\\
\end{array}
\end{array}
if r < 7.99999999999999964e-6Initial program 82.6%
Simplified78.9%
Taylor expanded in v around inf 77.0%
*-commutative77.0%
unpow277.0%
unpow277.0%
*-commutative77.0%
Simplified77.0%
Taylor expanded in r around 0 58.5%
unpow258.5%
Simplified58.5%
if 7.99999999999999964e-6 < r Initial program 92.0%
Simplified82.1%
Taylor expanded in v around inf 77.3%
*-commutative77.3%
unpow277.3%
unpow277.3%
*-commutative77.3%
Simplified77.3%
Taylor expanded in r around 0 29.2%
sub-neg29.2%
associate-*r/29.2%
metadata-eval29.2%
unpow229.2%
metadata-eval29.2%
Simplified29.2%
Taylor expanded in r around inf 29.2%
Final simplification52.9%
(FPCore (v w r) :precision binary64 (+ (/ 2.0 (* r r)) -1.5))
double code(double v, double w, double r) {
return (2.0 / (r * r)) + -1.5;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
code = (2.0d0 / (r * r)) + (-1.5d0)
end function
public static double code(double v, double w, double r) {
return (2.0 / (r * r)) + -1.5;
}
def code(v, w, r): return (2.0 / (r * r)) + -1.5
function code(v, w, r) return Float64(Float64(2.0 / Float64(r * r)) + -1.5) end
function tmp = code(v, w, r) tmp = (2.0 / (r * r)) + -1.5; end
code[v_, w_, r_] := N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{r \cdot r} + -1.5
\end{array}
Initial program 84.4%
Simplified79.5%
Taylor expanded in v around inf 77.0%
*-commutative77.0%
unpow277.0%
unpow277.0%
*-commutative77.0%
Simplified77.0%
Taylor expanded in r around 0 58.6%
sub-neg58.6%
associate-*r/58.6%
metadata-eval58.6%
unpow258.6%
metadata-eval58.6%
Simplified58.6%
Final simplification58.6%
(FPCore (v w r) :precision binary64 -1.5)
double code(double v, double w, double r) {
return -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 = -1.5d0
end function
public static double code(double v, double w, double r) {
return -1.5;
}
def code(v, w, r): return -1.5
function code(v, w, r) return -1.5 end
function tmp = code(v, w, r) tmp = -1.5; end
code[v_, w_, r_] := -1.5
\begin{array}{l}
\\
-1.5
\end{array}
Initial program 84.4%
Simplified79.5%
Taylor expanded in v around inf 77.0%
*-commutative77.0%
unpow277.0%
unpow277.0%
*-commutative77.0%
Simplified77.0%
Taylor expanded in r around 0 58.6%
sub-neg58.6%
associate-*r/58.6%
metadata-eval58.6%
unpow258.6%
metadata-eval58.6%
Simplified58.6%
Taylor expanded in r around inf 12.2%
Final simplification12.2%
herbie shell --seed 2023293
(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))