
(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 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (v w r) :precision binary64 (- (- (+ 3.0 (/ 2.0 (* r r))) (/ (* (* 0.125 (- 3.0 (* 2.0 v))) (* (* (* w w) r) r)) (- 1.0 v))) 4.5))
double code(double v, double w, double r) {
return ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
code = ((3.0d0 + (2.0d0 / (r * r))) - (((0.125d0 * (3.0d0 - (2.0d0 * v))) * (((w * w) * r) * r)) / (1.0d0 - v))) - 4.5d0
end function
public static double code(double v, double w, double r) {
return ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5;
}
def code(v, w, r): return ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5
function code(v, w, r) return Float64(Float64(Float64(3.0 + Float64(2.0 / Float64(r * r))) - Float64(Float64(Float64(0.125 * Float64(3.0 - Float64(2.0 * v))) * Float64(Float64(Float64(w * w) * r) * r)) / Float64(1.0 - v))) - 4.5) end
function tmp = code(v, w, r) tmp = ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5; end
code[v_, w_, r_] := N[(N[(N[(3.0 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(0.125 * N[(3.0 - N[(2.0 * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(w * w), $MachinePrecision] * r), $MachinePrecision] * r), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5
\end{array}
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (or (<= v -2e+102) (not (<= v 102000000.0)))
(+ t_0 (- -1.5 (/ (* r w) (/ (/ 4.0 r) w))))
(+
-4.5
(-
(+ 3.0 t_0)
(* (* 0.125 (* r w)) (/ (* r (* w (+ 3.0 (* v -2.0)))) (- 1.0 v))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((v <= -2e+102) || !(v <= 102000000.0)) {
tmp = t_0 + (-1.5 - ((r * w) / ((4.0 / r) / w)));
} else {
tmp = -4.5 + ((3.0 + t_0) - ((0.125 * (r * w)) * ((r * (w * (3.0 + (v * -2.0)))) / (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) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
if ((v <= (-2d+102)) .or. (.not. (v <= 102000000.0d0))) then
tmp = t_0 + ((-1.5d0) - ((r * w) / ((4.0d0 / r) / w)))
else
tmp = (-4.5d0) + ((3.0d0 + t_0) - ((0.125d0 * (r * w)) * ((r * (w * (3.0d0 + (v * (-2.0d0))))) / (1.0d0 - v))))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((v <= -2e+102) || !(v <= 102000000.0)) {
tmp = t_0 + (-1.5 - ((r * w) / ((4.0 / r) / w)));
} else {
tmp = -4.5 + ((3.0 + t_0) - ((0.125 * (r * w)) * ((r * (w * (3.0 + (v * -2.0)))) / (1.0 - v))));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if (v <= -2e+102) or not (v <= 102000000.0): tmp = t_0 + (-1.5 - ((r * w) / ((4.0 / r) / w))) else: tmp = -4.5 + ((3.0 + t_0) - ((0.125 * (r * w)) * ((r * (w * (3.0 + (v * -2.0)))) / (1.0 - v)))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if ((v <= -2e+102) || !(v <= 102000000.0)) tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(r * w) / Float64(Float64(4.0 / r) / w)))); else tmp = Float64(-4.5 + Float64(Float64(3.0 + t_0) - Float64(Float64(0.125 * Float64(r * w)) * Float64(Float64(r * Float64(w * Float64(3.0 + Float64(v * -2.0)))) / Float64(1.0 - v))))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if ((v <= -2e+102) || ~((v <= 102000000.0))) tmp = t_0 + (-1.5 - ((r * w) / ((4.0 / r) / w))); else tmp = -4.5 + ((3.0 + t_0) - ((0.125 * (r * w)) * ((r * (w * (3.0 + (v * -2.0)))) / (1.0 - v)))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[v, -2e+102], N[Not[LessEqual[v, 102000000.0]], $MachinePrecision]], N[(t$95$0 + N[(-1.5 - N[(N[(r * w), $MachinePrecision] / N[(N[(4.0 / r), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 + N[(N[(3.0 + t$95$0), $MachinePrecision] - N[(N[(0.125 * N[(r * w), $MachinePrecision]), $MachinePrecision] * N[(N[(r * N[(w * N[(3.0 + N[(v * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;v \leq -2 \cdot 10^{+102} \lor \neg \left(v \leq 102000000\right):\\
\;\;\;\;t_0 + \left(-1.5 - \frac{r \cdot w}{\frac{\frac{4}{r}}{w}}\right)\\
\mathbf{else}:\\
\;\;\;\;-4.5 + \left(\left(3 + t_0\right) - \left(0.125 \cdot \left(r \cdot w\right)\right) \cdot \frac{r \cdot \left(w \cdot \left(3 + v \cdot -2\right)\right)}{1 - v}\right)\\
\end{array}
\end{array}
if v < -1.99999999999999995e102 or 1.02e8 < v Initial program 85.0%
associate--l-85.0%
+-commutative85.0%
associate--l+85.0%
+-commutative85.0%
associate--r+85.0%
metadata-eval85.0%
associate-*r*82.3%
*-commutative82.3%
associate-/l*84.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in v around inf 90.0%
unpow290.0%
*-commutative90.0%
associate-*l*94.7%
*-commutative94.7%
Simplified94.7%
*-un-lft-identity94.7%
associate-/r*94.6%
*-commutative94.6%
Applied egg-rr94.6%
expm1-log1p-u93.8%
expm1-udef93.8%
*-un-lft-identity93.8%
*-commutative93.8%
Applied egg-rr93.8%
expm1-def93.8%
expm1-log1p94.6%
associate-/r/99.8%
associate-*l/97.3%
associate-*r/94.6%
*-commutative94.6%
associate-/l*94.6%
associate-/l/94.6%
associate-/r*94.7%
Simplified94.7%
associate-*r/99.9%
Applied egg-rr99.9%
if -1.99999999999999995e102 < v < 1.02e8Initial program 88.2%
Simplified79.5%
*-un-lft-identity79.5%
add-sqr-sqrt79.5%
times-frac79.4%
unswap-sqr79.5%
sqrt-prod41.0%
add-sqr-sqrt62.7%
unswap-sqr78.5%
sqrt-prod50.5%
add-sqr-sqrt99.7%
Applied egg-rr99.7%
times-frac99.7%
+-commutative99.7%
*-commutative99.7%
fma-def99.7%
Applied egg-rr99.7%
associate-/r/99.7%
metadata-eval99.7%
*-commutative99.7%
associate-/r/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in r around 0 99.8%
Final simplification99.8%
(FPCore (v w r) :precision binary64 (+ (- (+ 3.0 (/ 2.0 (* r r))) (* (* 0.125 (* r w)) (* (* r w) (/ (fma v -2.0 3.0) (- 1.0 v))))) -4.5))
double code(double v, double w, double r) {
return ((3.0 + (2.0 / (r * r))) - ((0.125 * (r * w)) * ((r * w) * (fma(v, -2.0, 3.0) / (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(r * w)) * Float64(Float64(r * w) * Float64(fma(v, -2.0, 3.0) / Float64(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[(r * w), $MachinePrecision]), $MachinePrecision] * N[(N[(r * w), $MachinePrecision] * N[(N[(v * -2.0 + 3.0), $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) - \left(0.125 \cdot \left(r \cdot w\right)\right) \cdot \left(\left(r \cdot w\right) \cdot \frac{\mathsf{fma}\left(v, -2, 3\right)}{1 - v}\right)\right) + -4.5
\end{array}
Initial program 86.8%
Simplified81.9%
*-un-lft-identity81.9%
add-sqr-sqrt81.9%
times-frac81.9%
unswap-sqr81.9%
sqrt-prod43.8%
add-sqr-sqrt61.5%
unswap-sqr73.9%
sqrt-prod51.8%
add-sqr-sqrt99.7%
Applied egg-rr99.7%
times-frac99.8%
+-commutative99.8%
*-commutative99.8%
fma-def99.8%
Applied egg-rr99.8%
associate-/r/99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r/99.8%
*-commutative99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (+ 3.0 (* v -2.0))) (t_1 (+ 3.0 (/ 2.0 (* r r)))))
(if (<= r 2e+105)
(+ -4.5 (- t_1 (/ (* 0.125 t_0) (/ (/ (- 1.0 v) (* (* r r) w)) w))))
(+ -4.5 (- t_1 (* (* 0.125 (* r w)) (/ (* r (* w t_0)) (- 1.0 v))))))))
double code(double v, double w, double r) {
double t_0 = 3.0 + (v * -2.0);
double t_1 = 3.0 + (2.0 / (r * r));
double tmp;
if (r <= 2e+105) {
tmp = -4.5 + (t_1 - ((0.125 * t_0) / (((1.0 - v) / ((r * r) * w)) / w)));
} else {
tmp = -4.5 + (t_1 - ((0.125 * (r * w)) * ((r * (w * t_0)) / (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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 3.0d0 + (v * (-2.0d0))
t_1 = 3.0d0 + (2.0d0 / (r * r))
if (r <= 2d+105) then
tmp = (-4.5d0) + (t_1 - ((0.125d0 * t_0) / (((1.0d0 - v) / ((r * r) * w)) / w)))
else
tmp = (-4.5d0) + (t_1 - ((0.125d0 * (r * w)) * ((r * (w * t_0)) / (1.0d0 - v))))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = 3.0 + (v * -2.0);
double t_1 = 3.0 + (2.0 / (r * r));
double tmp;
if (r <= 2e+105) {
tmp = -4.5 + (t_1 - ((0.125 * t_0) / (((1.0 - v) / ((r * r) * w)) / w)));
} else {
tmp = -4.5 + (t_1 - ((0.125 * (r * w)) * ((r * (w * t_0)) / (1.0 - v))));
}
return tmp;
}
def code(v, w, r): t_0 = 3.0 + (v * -2.0) t_1 = 3.0 + (2.0 / (r * r)) tmp = 0 if r <= 2e+105: tmp = -4.5 + (t_1 - ((0.125 * t_0) / (((1.0 - v) / ((r * r) * w)) / w))) else: tmp = -4.5 + (t_1 - ((0.125 * (r * w)) * ((r * (w * t_0)) / (1.0 - v)))) return tmp
function code(v, w, r) t_0 = Float64(3.0 + Float64(v * -2.0)) t_1 = Float64(3.0 + Float64(2.0 / Float64(r * r))) tmp = 0.0 if (r <= 2e+105) tmp = Float64(-4.5 + Float64(t_1 - Float64(Float64(0.125 * t_0) / Float64(Float64(Float64(1.0 - v) / Float64(Float64(r * r) * w)) / w)))); else tmp = Float64(-4.5 + Float64(t_1 - Float64(Float64(0.125 * Float64(r * w)) * Float64(Float64(r * Float64(w * t_0)) / Float64(1.0 - v))))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 3.0 + (v * -2.0); t_1 = 3.0 + (2.0 / (r * r)); tmp = 0.0; if (r <= 2e+105) tmp = -4.5 + (t_1 - ((0.125 * t_0) / (((1.0 - v) / ((r * r) * w)) / w))); else tmp = -4.5 + (t_1 - ((0.125 * (r * w)) * ((r * (w * t_0)) / (1.0 - v)))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(3.0 + N[(v * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r, 2e+105], N[(-4.5 + N[(t$95$1 - N[(N[(0.125 * t$95$0), $MachinePrecision] / N[(N[(N[(1.0 - v), $MachinePrecision] / N[(N[(r * r), $MachinePrecision] * w), $MachinePrecision]), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 + N[(t$95$1 - N[(N[(0.125 * N[(r * w), $MachinePrecision]), $MachinePrecision] * N[(N[(r * N[(w * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 + v \cdot -2\\
t_1 := 3 + \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 2 \cdot 10^{+105}:\\
\;\;\;\;-4.5 + \left(t_1 - \frac{0.125 \cdot t_0}{\frac{\frac{1 - v}{\left(r \cdot r\right) \cdot w}}{w}}\right)\\
\mathbf{else}:\\
\;\;\;\;-4.5 + \left(t_1 - \left(0.125 \cdot \left(r \cdot w\right)\right) \cdot \frac{r \cdot \left(w \cdot t_0\right)}{1 - v}\right)\\
\end{array}
\end{array}
if r < 1.9999999999999999e105Initial program 87.3%
Simplified85.0%
*-un-lft-identity85.0%
associate-*l*94.0%
times-frac94.4%
Applied egg-rr94.4%
associate-*l/94.4%
*-un-lft-identity94.4%
Applied egg-rr94.4%
if 1.9999999999999999e105 < r Initial program 84.4%
Simplified67.3%
*-un-lft-identity67.3%
add-sqr-sqrt67.2%
times-frac67.2%
unswap-sqr67.2%
sqrt-prod35.8%
add-sqr-sqrt35.8%
unswap-sqr55.5%
sqrt-prod53.2%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
times-frac99.7%
+-commutative99.7%
*-commutative99.7%
fma-def99.7%
Applied egg-rr99.7%
associate-/r/99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in r around 0 95.6%
Final simplification94.6%
(FPCore (v w r)
:precision binary64
(+
-4.5
(-
(+ 3.0 (/ 2.0 (* r r)))
(/
(* 0.125 (+ 3.0 (* v -2.0)))
(* (/ 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 + (v * -2.0))) / ((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 + (v * (-2.0d0)))) / ((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 + (v * -2.0))) / ((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 + (v * -2.0))) / ((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(v * -2.0))) / 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 + (v * -2.0))) / ((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[(v * -2.0), $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 + v \cdot -2\right)}{\frac{1}{r \cdot w} \cdot \frac{1 - v}{r \cdot w}}\right)
\end{array}
Initial program 86.8%
Simplified81.9%
*-un-lft-identity81.9%
add-sqr-sqrt81.9%
times-frac81.9%
unswap-sqr81.9%
sqrt-prod43.8%
add-sqr-sqrt61.5%
unswap-sqr73.9%
sqrt-prod51.8%
add-sqr-sqrt99.7%
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (or (<= v -2.75e+34) (not (<= v 1.6e-27)))
(+ t_0 (- -1.5 (/ (* r w) (/ (/ 4.0 r) w))))
(+ t_0 (- -1.5 (* (* r w) (* w (* r 0.375))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((v <= -2.75e+34) || !(v <= 1.6e-27)) {
tmp = t_0 + (-1.5 - ((r * w) / ((4.0 / r) / w)));
} else {
tmp = t_0 + (-1.5 - ((r * w) * (w * (r * 0.375))));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
if ((v <= (-2.75d+34)) .or. (.not. (v <= 1.6d-27))) then
tmp = t_0 + ((-1.5d0) - ((r * w) / ((4.0d0 / r) / w)))
else
tmp = t_0 + ((-1.5d0) - ((r * w) * (w * (r * 0.375d0))))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((v <= -2.75e+34) || !(v <= 1.6e-27)) {
tmp = t_0 + (-1.5 - ((r * w) / ((4.0 / r) / w)));
} else {
tmp = t_0 + (-1.5 - ((r * w) * (w * (r * 0.375))));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if (v <= -2.75e+34) or not (v <= 1.6e-27): tmp = t_0 + (-1.5 - ((r * w) / ((4.0 / r) / w))) else: tmp = t_0 + (-1.5 - ((r * w) * (w * (r * 0.375)))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if ((v <= -2.75e+34) || !(v <= 1.6e-27)) tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(r * w) / Float64(Float64(4.0 / r) / w)))); else tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(r * w) * Float64(w * Float64(r * 0.375))))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if ((v <= -2.75e+34) || ~((v <= 1.6e-27))) tmp = t_0 + (-1.5 - ((r * w) / ((4.0 / r) / w))); else tmp = t_0 + (-1.5 - ((r * w) * (w * (r * 0.375)))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[v, -2.75e+34], N[Not[LessEqual[v, 1.6e-27]], $MachinePrecision]], N[(t$95$0 + N[(-1.5 - N[(N[(r * w), $MachinePrecision] / N[(N[(4.0 / r), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(-1.5 - N[(N[(r * w), $MachinePrecision] * N[(w * N[(r * 0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;v \leq -2.75 \cdot 10^{+34} \lor \neg \left(v \leq 1.6 \cdot 10^{-27}\right):\\
\;\;\;\;t_0 + \left(-1.5 - \frac{r \cdot w}{\frac{\frac{4}{r}}{w}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - \left(r \cdot w\right) \cdot \left(w \cdot \left(r \cdot 0.375\right)\right)\right)\\
\end{array}
\end{array}
if v < -2.7499999999999998e34 or 1.59999999999999995e-27 < v Initial program 84.9%
associate--l-84.9%
+-commutative84.9%
associate--l+84.9%
+-commutative84.9%
associate--r+84.9%
metadata-eval84.9%
associate-*r*82.7%
*-commutative82.7%
associate-/l*85.5%
*-commutative85.5%
Simplified85.5%
Taylor expanded in v around inf 89.6%
unpow289.6%
*-commutative89.6%
associate-*l*94.3%
*-commutative94.3%
Simplified94.3%
*-un-lft-identity94.3%
associate-/r*94.3%
*-commutative94.3%
Applied egg-rr94.3%
expm1-log1p-u93.4%
expm1-udef93.4%
*-un-lft-identity93.4%
*-commutative93.4%
Applied egg-rr93.4%
expm1-def93.4%
expm1-log1p94.3%
associate-/r/99.5%
associate-*l/97.3%
associate-*r/94.3%
*-commutative94.3%
associate-/l*94.3%
associate-/l/94.3%
associate-/r*94.3%
Simplified94.3%
associate-*r/99.5%
Applied egg-rr99.5%
if -2.7499999999999998e34 < v < 1.59999999999999995e-27Initial program 88.7%
associate--l-88.7%
+-commutative88.7%
associate--l+88.7%
+-commutative88.7%
associate--r+88.7%
metadata-eval88.7%
associate-*r*88.7%
*-commutative88.7%
associate-/l*88.7%
*-commutative88.7%
Simplified88.7%
Taylor expanded in v around 0 88.1%
unpow288.1%
*-commutative88.1%
associate-*l*98.5%
*-commutative98.5%
Simplified98.5%
associate-/r/98.5%
associate-*r*99.1%
div-inv99.1%
metadata-eval99.1%
Applied egg-rr99.1%
Final simplification99.3%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= v -2.75e+34)
(+ t_0 (- -1.5 (* (* r (* r w)) (* w 0.25))))
(if (<= v 1e-19)
(+ t_0 (- -1.5 (* (* r w) (* w (* r 0.375)))))
(+ t_0 (- -1.5 (* r (/ w (/ (/ 4.0 r) w)))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (v <= -2.75e+34) {
tmp = t_0 + (-1.5 - ((r * (r * w)) * (w * 0.25)));
} else if (v <= 1e-19) {
tmp = t_0 + (-1.5 - ((r * w) * (w * (r * 0.375))));
} else {
tmp = t_0 + (-1.5 - (r * (w / ((4.0 / r) / w))));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
if (v <= (-2.75d+34)) then
tmp = t_0 + ((-1.5d0) - ((r * (r * w)) * (w * 0.25d0)))
else if (v <= 1d-19) then
tmp = t_0 + ((-1.5d0) - ((r * w) * (w * (r * 0.375d0))))
else
tmp = t_0 + ((-1.5d0) - (r * (w / ((4.0d0 / r) / w))))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (v <= -2.75e+34) {
tmp = t_0 + (-1.5 - ((r * (r * w)) * (w * 0.25)));
} else if (v <= 1e-19) {
tmp = t_0 + (-1.5 - ((r * w) * (w * (r * 0.375))));
} else {
tmp = t_0 + (-1.5 - (r * (w / ((4.0 / r) / w))));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if v <= -2.75e+34: tmp = t_0 + (-1.5 - ((r * (r * w)) * (w * 0.25))) elif v <= 1e-19: tmp = t_0 + (-1.5 - ((r * w) * (w * (r * 0.375)))) else: tmp = t_0 + (-1.5 - (r * (w / ((4.0 / r) / w)))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (v <= -2.75e+34) tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(r * Float64(r * w)) * Float64(w * 0.25)))); elseif (v <= 1e-19) tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(r * w) * Float64(w * Float64(r * 0.375))))); else tmp = Float64(t_0 + Float64(-1.5 - Float64(r * Float64(w / Float64(Float64(4.0 / r) / w))))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (v <= -2.75e+34) tmp = t_0 + (-1.5 - ((r * (r * w)) * (w * 0.25))); elseif (v <= 1e-19) tmp = t_0 + (-1.5 - ((r * w) * (w * (r * 0.375)))); else tmp = t_0 + (-1.5 - (r * (w / ((4.0 / r) / w)))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[v, -2.75e+34], N[(t$95$0 + N[(-1.5 - N[(N[(r * N[(r * w), $MachinePrecision]), $MachinePrecision] * N[(w * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[v, 1e-19], N[(t$95$0 + N[(-1.5 - N[(N[(r * w), $MachinePrecision] * N[(w * N[(r * 0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(-1.5 - N[(r * N[(w / N[(N[(4.0 / r), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;v \leq -2.75 \cdot 10^{+34}:\\
\;\;\;\;t_0 + \left(-1.5 - \left(r \cdot \left(r \cdot w\right)\right) \cdot \left(w \cdot 0.25\right)\right)\\
\mathbf{elif}\;v \leq 10^{-19}:\\
\;\;\;\;t_0 + \left(-1.5 - \left(r \cdot w\right) \cdot \left(w \cdot \left(r \cdot 0.375\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - r \cdot \frac{w}{\frac{\frac{4}{r}}{w}}\right)\\
\end{array}
\end{array}
if v < -2.7499999999999998e34Initial program 84.3%
associate--l-84.3%
+-commutative84.3%
associate--l+84.3%
+-commutative84.3%
associate--r+84.3%
metadata-eval84.3%
associate-*r*84.3%
*-commutative84.3%
associate-/l*86.0%
*-commutative86.0%
Simplified86.0%
Taylor expanded in v around inf 87.8%
unpow287.8%
*-commutative87.8%
associate-*l*92.4%
*-commutative92.4%
Simplified92.4%
*-un-lft-identity92.4%
associate-/r*92.4%
*-commutative92.4%
Applied egg-rr92.4%
*-un-lft-identity92.4%
*-un-lft-identity92.4%
div-inv92.4%
*-commutative92.4%
times-frac99.9%
clear-num99.9%
div-inv99.9%
metadata-eval99.9%
Applied egg-rr99.9%
*-commutative99.9%
associate-/r/99.9%
/-rgt-identity99.9%
Simplified99.9%
if -2.7499999999999998e34 < v < 9.9999999999999998e-20Initial program 88.1%
associate--l-88.0%
+-commutative88.0%
associate--l+88.0%
+-commutative88.0%
associate--r+88.1%
metadata-eval88.1%
associate-*r*88.1%
*-commutative88.1%
associate-/l*88.1%
*-commutative88.1%
Simplified88.1%
Taylor expanded in v around 0 87.5%
unpow287.5%
*-commutative87.5%
associate-*l*97.7%
*-commutative97.7%
Simplified97.7%
associate-/r/97.7%
associate-*r*99.1%
div-inv99.1%
metadata-eval99.1%
Applied egg-rr99.1%
if 9.9999999999999998e-20 < v Initial program 86.3%
associate--l-86.3%
+-commutative86.3%
associate--l+86.3%
+-commutative86.3%
associate--r+86.3%
metadata-eval86.3%
associate-*r*82.5%
*-commutative82.5%
associate-/l*86.1%
*-commutative86.1%
Simplified86.1%
Taylor expanded in v around inf 91.8%
unpow291.8%
*-commutative91.8%
associate-*l*96.8%
*-commutative96.8%
Simplified96.8%
*-un-lft-identity96.8%
associate-/r*96.7%
*-commutative96.7%
Applied egg-rr96.7%
expm1-log1p-u95.8%
expm1-udef95.8%
*-un-lft-identity95.8%
*-commutative95.8%
Applied egg-rr95.8%
expm1-def95.8%
expm1-log1p96.7%
associate-/r/99.2%
associate-*l/95.5%
associate-*r/96.7%
*-commutative96.7%
associate-/l*96.7%
associate-/l/96.7%
associate-/r*96.7%
Simplified96.7%
Final simplification98.6%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= v -3.35e+34)
(+ t_0 (- -1.5 (* (* r (* r w)) (* w 0.25))))
(if (<= v 1.6e-27)
(+ t_0 (- -1.5 (* (* r w) (* w (* r 0.375)))))
(+ t_0 (- -1.5 (* (* r w) (/ r (/ 4.0 w)))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (v <= -3.35e+34) {
tmp = t_0 + (-1.5 - ((r * (r * w)) * (w * 0.25)));
} else if (v <= 1.6e-27) {
tmp = t_0 + (-1.5 - ((r * w) * (w * (r * 0.375))));
} else {
tmp = t_0 + (-1.5 - ((r * w) * (r / (4.0 / w))));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
if (v <= (-3.35d+34)) then
tmp = t_0 + ((-1.5d0) - ((r * (r * w)) * (w * 0.25d0)))
else if (v <= 1.6d-27) then
tmp = t_0 + ((-1.5d0) - ((r * w) * (w * (r * 0.375d0))))
else
tmp = t_0 + ((-1.5d0) - ((r * w) * (r / (4.0d0 / w))))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (v <= -3.35e+34) {
tmp = t_0 + (-1.5 - ((r * (r * w)) * (w * 0.25)));
} else if (v <= 1.6e-27) {
tmp = t_0 + (-1.5 - ((r * w) * (w * (r * 0.375))));
} else {
tmp = t_0 + (-1.5 - ((r * w) * (r / (4.0 / w))));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if v <= -3.35e+34: tmp = t_0 + (-1.5 - ((r * (r * w)) * (w * 0.25))) elif v <= 1.6e-27: tmp = t_0 + (-1.5 - ((r * w) * (w * (r * 0.375)))) else: tmp = t_0 + (-1.5 - ((r * w) * (r / (4.0 / w)))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (v <= -3.35e+34) tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(r * Float64(r * w)) * Float64(w * 0.25)))); elseif (v <= 1.6e-27) tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(r * w) * Float64(w * Float64(r * 0.375))))); else tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(r * w) * Float64(r / Float64(4.0 / w))))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (v <= -3.35e+34) tmp = t_0 + (-1.5 - ((r * (r * w)) * (w * 0.25))); elseif (v <= 1.6e-27) tmp = t_0 + (-1.5 - ((r * w) * (w * (r * 0.375)))); else tmp = t_0 + (-1.5 - ((r * w) * (r / (4.0 / w)))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[v, -3.35e+34], N[(t$95$0 + N[(-1.5 - N[(N[(r * N[(r * w), $MachinePrecision]), $MachinePrecision] * N[(w * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[v, 1.6e-27], N[(t$95$0 + N[(-1.5 - N[(N[(r * w), $MachinePrecision] * N[(w * N[(r * 0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(-1.5 - N[(N[(r * w), $MachinePrecision] * N[(r / N[(4.0 / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;v \leq -3.35 \cdot 10^{+34}:\\
\;\;\;\;t_0 + \left(-1.5 - \left(r \cdot \left(r \cdot w\right)\right) \cdot \left(w \cdot 0.25\right)\right)\\
\mathbf{elif}\;v \leq 1.6 \cdot 10^{-27}:\\
\;\;\;\;t_0 + \left(-1.5 - \left(r \cdot w\right) \cdot \left(w \cdot \left(r \cdot 0.375\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - \left(r \cdot w\right) \cdot \frac{r}{\frac{4}{w}}\right)\\
\end{array}
\end{array}
if v < -3.3500000000000001e34Initial program 84.3%
associate--l-84.3%
+-commutative84.3%
associate--l+84.3%
+-commutative84.3%
associate--r+84.3%
metadata-eval84.3%
associate-*r*84.3%
*-commutative84.3%
associate-/l*86.0%
*-commutative86.0%
Simplified86.0%
Taylor expanded in v around inf 87.8%
unpow287.8%
*-commutative87.8%
associate-*l*92.4%
*-commutative92.4%
Simplified92.4%
*-un-lft-identity92.4%
associate-/r*92.4%
*-commutative92.4%
Applied egg-rr92.4%
*-un-lft-identity92.4%
*-un-lft-identity92.4%
div-inv92.4%
*-commutative92.4%
times-frac99.9%
clear-num99.9%
div-inv99.9%
metadata-eval99.9%
Applied egg-rr99.9%
*-commutative99.9%
associate-/r/99.9%
/-rgt-identity99.9%
Simplified99.9%
if -3.3500000000000001e34 < v < 1.59999999999999995e-27Initial program 88.7%
associate--l-88.7%
+-commutative88.7%
associate--l+88.7%
+-commutative88.7%
associate--r+88.7%
metadata-eval88.7%
associate-*r*88.7%
*-commutative88.7%
associate-/l*88.7%
*-commutative88.7%
Simplified88.7%
Taylor expanded in v around 0 88.1%
unpow288.1%
*-commutative88.1%
associate-*l*98.5%
*-commutative98.5%
Simplified98.5%
associate-/r/98.5%
associate-*r*99.1%
div-inv99.1%
metadata-eval99.1%
Applied egg-rr99.1%
if 1.59999999999999995e-27 < v Initial program 85.4%
associate--l-85.4%
+-commutative85.4%
associate--l+85.4%
+-commutative85.4%
associate--r+85.4%
metadata-eval85.4%
associate-*r*81.7%
*-commutative81.7%
associate-/l*85.2%
*-commutative85.2%
Simplified85.2%
Taylor expanded in v around inf 90.8%
unpow290.8%
*-commutative90.8%
associate-*l*95.6%
*-commutative95.6%
Simplified95.6%
*-un-lft-identity95.6%
associate-/r*95.5%
*-commutative95.5%
Applied egg-rr95.5%
expm1-log1p-u94.7%
expm1-udef94.7%
*-un-lft-identity94.7%
*-commutative94.7%
Applied egg-rr94.7%
expm1-def94.7%
expm1-log1p95.5%
associate-/r/99.2%
Simplified99.2%
Final simplification99.3%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= (* w w) 5.5e-216)
(+ t_0 -1.5)
(+ t_0 (* (* (* r r) (* w w)) -0.375)))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((w * w) <= 5.5e-216) {
tmp = t_0 + -1.5;
} else {
tmp = t_0 + (((r * r) * (w * w)) * -0.375);
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
if ((w * w) <= 5.5d-216) then
tmp = t_0 + (-1.5d0)
else
tmp = t_0 + (((r * r) * (w * w)) * (-0.375d0))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((w * w) <= 5.5e-216) {
tmp = t_0 + -1.5;
} else {
tmp = t_0 + (((r * r) * (w * w)) * -0.375);
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if (w * w) <= 5.5e-216: tmp = t_0 + -1.5 else: tmp = t_0 + (((r * r) * (w * w)) * -0.375) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (Float64(w * w) <= 5.5e-216) tmp = Float64(t_0 + -1.5); else tmp = Float64(t_0 + Float64(Float64(Float64(r * r) * Float64(w * w)) * -0.375)); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if ((w * w) <= 5.5e-216) tmp = t_0 + -1.5; else tmp = t_0 + (((r * r) * (w * w)) * -0.375); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(w * w), $MachinePrecision], 5.5e-216], N[(t$95$0 + -1.5), $MachinePrecision], N[(t$95$0 + N[(N[(N[(r * r), $MachinePrecision] * N[(w * w), $MachinePrecision]), $MachinePrecision] * -0.375), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;w \cdot w \leq 5.5 \cdot 10^{-216}:\\
\;\;\;\;t_0 + -1.5\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(\left(r \cdot r\right) \cdot \left(w \cdot w\right)\right) \cdot -0.375\\
\end{array}
\end{array}
if (*.f64 w w) < 5.49999999999999991e-216Initial program 89.6%
associate--l-89.6%
+-commutative89.6%
associate--l+89.6%
+-commutative89.6%
associate--r+89.6%
metadata-eval89.6%
associate-*r*89.5%
*-commutative89.5%
associate-/l*90.7%
*-commutative90.7%
Simplified90.7%
Taylor expanded in v around 0 88.7%
unpow288.7%
*-commutative88.7%
associate-*l*93.3%
*-commutative93.3%
Simplified93.3%
associate-/r/93.3%
associate-*r*93.3%
div-inv93.3%
metadata-eval93.3%
Applied egg-rr93.3%
Taylor expanded in r around 0 84.8%
if 5.49999999999999991e-216 < (*.f64 w w) Initial program 85.5%
associate--l-85.5%
+-commutative85.5%
associate--l+85.5%
+-commutative85.5%
associate--r+85.5%
metadata-eval85.5%
associate-*r*83.8%
*-commutative83.8%
associate-/l*85.4%
*-commutative85.4%
Simplified85.4%
Taylor expanded in v around 0 83.7%
unpow283.7%
*-commutative83.7%
associate-*l*90.5%
*-commutative90.5%
Simplified90.5%
associate-/r/90.5%
associate-*r*93.5%
div-inv93.5%
metadata-eval93.5%
Applied egg-rr93.5%
Taylor expanded in r around inf 80.5%
*-commutative80.5%
unpow280.5%
unpow280.5%
Simplified80.5%
Final simplification81.8%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= r 2e-149)
(+ t_0 -1.5)
(+ t_0 (- -1.5 (* r (/ w (/ (/ 4.0 r) w))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 2e-149) {
tmp = t_0 + -1.5;
} else {
tmp = t_0 + (-1.5 - (r * (w / ((4.0 / r) / w))));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
if (r <= 2d-149) then
tmp = t_0 + (-1.5d0)
else
tmp = t_0 + ((-1.5d0) - (r * (w / ((4.0d0 / r) / w))))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 2e-149) {
tmp = t_0 + -1.5;
} else {
tmp = t_0 + (-1.5 - (r * (w / ((4.0 / r) / w))));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if r <= 2e-149: tmp = t_0 + -1.5 else: tmp = t_0 + (-1.5 - (r * (w / ((4.0 / r) / w)))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (r <= 2e-149) tmp = Float64(t_0 + -1.5); else tmp = Float64(t_0 + Float64(-1.5 - Float64(r * Float64(w / Float64(Float64(4.0 / r) / w))))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (r <= 2e-149) tmp = t_0 + -1.5; else tmp = t_0 + (-1.5 - (r * (w / ((4.0 / r) / w)))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r, 2e-149], N[(t$95$0 + -1.5), $MachinePrecision], N[(t$95$0 + N[(-1.5 - N[(r * N[(w / N[(N[(4.0 / r), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 2 \cdot 10^{-149}:\\
\;\;\;\;t_0 + -1.5\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - r \cdot \frac{w}{\frac{\frac{4}{r}}{w}}\right)\\
\end{array}
\end{array}
if r < 1.99999999999999996e-149Initial program 84.5%
associate--l-84.5%
+-commutative84.5%
associate--l+84.5%
+-commutative84.5%
associate--r+84.5%
metadata-eval84.5%
associate-*r*83.2%
*-commutative83.2%
associate-/l*83.8%
*-commutative83.8%
Simplified83.8%
Taylor expanded in v around 0 83.8%
unpow283.8%
*-commutative83.8%
associate-*l*92.1%
*-commutative92.1%
Simplified92.1%
associate-/r/92.1%
associate-*r*95.4%
div-inv95.4%
metadata-eval95.4%
Applied egg-rr95.4%
Taylor expanded in r around 0 62.8%
if 1.99999999999999996e-149 < r Initial program 90.6%
associate--l-90.6%
+-commutative90.6%
associate--l+90.6%
+-commutative90.6%
associate--r+90.6%
metadata-eval90.6%
associate-*r*89.6%
*-commutative89.6%
associate-/l*92.5%
*-commutative92.5%
Simplified92.5%
Taylor expanded in v around inf 89.1%
unpow289.1%
*-commutative89.1%
associate-*l*92.8%
*-commutative92.8%
Simplified92.8%
*-un-lft-identity92.8%
associate-/r*92.8%
*-commutative92.8%
Applied egg-rr92.8%
expm1-log1p-u92.0%
expm1-udef92.0%
*-un-lft-identity92.0%
*-commutative92.0%
Applied egg-rr92.0%
expm1-def92.0%
expm1-log1p92.8%
associate-/r/92.8%
associate-*l/90.8%
associate-*r/92.8%
*-commutative92.8%
associate-/l*92.8%
associate-/l/92.8%
associate-/r*92.8%
Simplified92.8%
Final simplification74.1%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= r 6.2e+140)
(+ t_0 (- -1.5 (* w (* (* (* r r) w) 0.375))))
(+ t_0 (- -1.5 (* r (/ w (/ (/ 4.0 r) w))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 6.2e+140) {
tmp = t_0 + (-1.5 - (w * (((r * r) * w) * 0.375)));
} else {
tmp = t_0 + (-1.5 - (r * (w / ((4.0 / r) / w))));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
if (r <= 6.2d+140) then
tmp = t_0 + ((-1.5d0) - (w * (((r * r) * w) * 0.375d0)))
else
tmp = t_0 + ((-1.5d0) - (r * (w / ((4.0d0 / r) / w))))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 6.2e+140) {
tmp = t_0 + (-1.5 - (w * (((r * r) * w) * 0.375)));
} else {
tmp = t_0 + (-1.5 - (r * (w / ((4.0 / r) / w))));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if r <= 6.2e+140: tmp = t_0 + (-1.5 - (w * (((r * r) * w) * 0.375))) else: tmp = t_0 + (-1.5 - (r * (w / ((4.0 / r) / w)))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (r <= 6.2e+140) tmp = Float64(t_0 + Float64(-1.5 - Float64(w * Float64(Float64(Float64(r * r) * w) * 0.375)))); else tmp = Float64(t_0 + Float64(-1.5 - Float64(r * Float64(w / Float64(Float64(4.0 / r) / w))))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (r <= 6.2e+140) tmp = t_0 + (-1.5 - (w * (((r * r) * w) * 0.375))); else tmp = t_0 + (-1.5 - (r * (w / ((4.0 / r) / w)))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r, 6.2e+140], N[(t$95$0 + N[(-1.5 - N[(w * N[(N[(N[(r * r), $MachinePrecision] * w), $MachinePrecision] * 0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(-1.5 - N[(r * N[(w / N[(N[(4.0 / r), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 6.2 \cdot 10^{+140}:\\
\;\;\;\;t_0 + \left(-1.5 - w \cdot \left(\left(\left(r \cdot r\right) \cdot w\right) \cdot 0.375\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - r \cdot \frac{w}{\frac{\frac{4}{r}}{w}}\right)\\
\end{array}
\end{array}
if r < 6.2000000000000001e140Initial program 87.8%
associate--l-87.8%
+-commutative87.8%
associate--l+87.8%
+-commutative87.8%
associate--r+87.8%
metadata-eval87.8%
associate-*r*86.4%
*-commutative86.4%
associate-/l*86.9%
*-commutative86.9%
Simplified86.9%
Taylor expanded in v around 0 86.3%
unpow286.3%
*-commutative86.3%
associate-*l*92.7%
*-commutative92.7%
Simplified92.7%
associate-/r*92.7%
associate-/r/95.1%
associate-*r*93.8%
div-inv93.8%
clear-num93.8%
div-inv93.8%
metadata-eval93.8%
Applied egg-rr93.8%
Taylor expanded in r around 0 90.7%
*-commutative90.7%
unpow290.7%
Simplified90.7%
if 6.2000000000000001e140 < r Initial program 80.6%
associate--l-80.6%
+-commutative80.6%
associate--l+80.6%
+-commutative80.6%
associate--r+80.6%
metadata-eval80.6%
associate-*r*80.6%
*-commutative80.6%
associate-/l*88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in v around inf 83.9%
unpow283.9%
*-commutative83.9%
associate-*l*93.3%
*-commutative93.3%
Simplified93.3%
*-un-lft-identity93.3%
associate-/r*93.2%
*-commutative93.2%
Applied egg-rr93.2%
expm1-log1p-u91.7%
expm1-udef91.7%
*-un-lft-identity91.7%
*-commutative91.7%
Applied egg-rr91.7%
expm1-def91.7%
expm1-log1p93.2%
associate-/r/93.2%
associate-*l/88.0%
associate-*r/93.2%
*-commutative93.2%
associate-/l*93.2%
associate-/l/93.2%
associate-/r*93.2%
Simplified93.2%
Final simplification91.1%
(FPCore (v w r) :precision binary64 (+ (/ 2.0 (* r r)) -1.5))
double code(double v, double w, double r) {
return (2.0 / (r * r)) + -1.5;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
code = (2.0d0 / (r * r)) + (-1.5d0)
end function
public static double code(double v, double w, double r) {
return (2.0 / (r * r)) + -1.5;
}
def code(v, w, r): return (2.0 / (r * r)) + -1.5
function code(v, w, r) return Float64(Float64(2.0 / Float64(r * r)) + -1.5) end
function tmp = code(v, w, r) tmp = (2.0 / (r * r)) + -1.5; end
code[v_, w_, r_] := N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{r \cdot r} + -1.5
\end{array}
Initial program 86.8%
associate--l-86.8%
+-commutative86.8%
associate--l+86.8%
+-commutative86.8%
associate--r+86.8%
metadata-eval86.8%
associate-*r*85.6%
*-commutative85.6%
associate-/l*87.1%
*-commutative87.1%
Simplified87.1%
Taylor expanded in v around 0 85.3%
unpow285.3%
*-commutative85.3%
associate-*l*91.4%
*-commutative91.4%
Simplified91.4%
associate-/r/91.4%
associate-*r*93.4%
div-inv93.4%
metadata-eval93.4%
Applied egg-rr93.4%
Taylor expanded in r around 0 54.0%
Final simplification54.0%
herbie shell --seed 2023282
(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))