
(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 (+ (- (+ 3.0 (/ 2.0 (* r r))) (/ (+ 0.375 (* -0.25 v)) (/ (- 1.0 v) (* (* r w) (* r w))))) -4.5))
double code(double v, double w, double r) {
return ((3.0 + (2.0 / (r * r))) - ((0.375 + (-0.25 * v)) / ((1.0 - v) / ((r * w) * (r * w))))) + -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.375d0 + ((-0.25d0) * v)) / ((1.0d0 - v) / ((r * w) * (r * w))))) + (-4.5d0)
end function
public static double code(double v, double w, double r) {
return ((3.0 + (2.0 / (r * r))) - ((0.375 + (-0.25 * v)) / ((1.0 - v) / ((r * w) * (r * w))))) + -4.5;
}
def code(v, w, r): return ((3.0 + (2.0 / (r * r))) - ((0.375 + (-0.25 * v)) / ((1.0 - v) / ((r * w) * (r * w))))) + -4.5
function code(v, w, r) return Float64(Float64(Float64(3.0 + Float64(2.0 / Float64(r * r))) - Float64(Float64(0.375 + Float64(-0.25 * v)) / Float64(Float64(1.0 - v) / Float64(Float64(r * w) * Float64(r * w))))) + -4.5) end
function tmp = code(v, w, r) tmp = ((3.0 + (2.0 / (r * r))) - ((0.375 + (-0.25 * v)) / ((1.0 - v) / ((r * w) * (r * w))))) + -4.5; end
code[v_, w_, r_] := N[(N[(N[(3.0 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(0.375 + N[(-0.25 * v), $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 - v), $MachinePrecision] / N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -4.5), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{0.375 + -0.25 \cdot v}{\frac{1 - v}{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}}\right) + -4.5
\end{array}
Initial program 84.5%
Simplified79.5%
*-un-lft-identity79.5%
add-sqr-sqrt79.5%
times-frac79.5%
unswap-sqr79.5%
sqrt-prod46.6%
add-sqr-sqrt64.6%
unswap-sqr80.3%
sqrt-prod56.5%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
Taylor expanded in v around 0 92.0%
+-commutative92.0%
*-commutative92.0%
mul-1-neg92.0%
sub-neg92.0%
*-commutative92.0%
div-sub99.8%
associate-/r*99.0%
Simplified99.0%
div-inv99.0%
distribute-lft-in99.0%
metadata-eval99.0%
frac-times95.2%
*-un-lft-identity95.2%
*-commutative95.2%
Applied egg-rr95.2%
associate-*r/95.2%
associate-*r*95.2%
metadata-eval95.2%
associate-/r*96.0%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= (* w w) 1e+240)
(+
t_0
(- -1.5 (* (* r (* w (* r w))) (/ (+ 0.375 (* -0.25 v)) (- 1.0 v)))))
(+ t_0 (- -1.5 (/ (* (* r w) (* r w)) 2.6666666666666665))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((w * w) <= 1e+240) {
tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * ((0.375 + (-0.25 * v)) / (1.0 - v))));
} else {
tmp = t_0 + (-1.5 - (((r * w) * (r * w)) / 2.6666666666666665));
}
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) <= 1d+240) then
tmp = t_0 + ((-1.5d0) - ((r * (w * (r * w))) * ((0.375d0 + ((-0.25d0) * v)) / (1.0d0 - v))))
else
tmp = t_0 + ((-1.5d0) - (((r * w) * (r * w)) / 2.6666666666666665d0))
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) <= 1e+240) {
tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * ((0.375 + (-0.25 * v)) / (1.0 - v))));
} else {
tmp = t_0 + (-1.5 - (((r * w) * (r * w)) / 2.6666666666666665));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if (w * w) <= 1e+240: tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * ((0.375 + (-0.25 * v)) / (1.0 - v)))) else: tmp = t_0 + (-1.5 - (((r * w) * (r * w)) / 2.6666666666666665)) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (Float64(w * w) <= 1e+240) tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(r * Float64(w * Float64(r * w))) * Float64(Float64(0.375 + Float64(-0.25 * v)) / Float64(1.0 - v))))); else tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(Float64(r * w) * Float64(r * w)) / 2.6666666666666665))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if ((w * w) <= 1e+240) tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * ((0.375 + (-0.25 * v)) / (1.0 - v)))); else tmp = t_0 + (-1.5 - (((r * w) * (r * w)) / 2.6666666666666665)); 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], 1e+240], N[(t$95$0 + N[(-1.5 - N[(N[(r * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(0.375 + N[(-0.25 * v), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(-1.5 - N[(N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision] / 2.6666666666666665), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;w \cdot w \leq 10^{+240}:\\
\;\;\;\;t_0 + \left(-1.5 - \left(r \cdot \left(w \cdot \left(r \cdot w\right)\right)\right) \cdot \frac{0.375 + -0.25 \cdot v}{1 - v}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{2.6666666666666665}\right)\\
\end{array}
\end{array}
if (*.f64 w w) < 1.00000000000000001e240Initial program 92.2%
associate--l-92.2%
+-commutative92.2%
associate--l+92.3%
+-commutative92.3%
associate--r+92.3%
metadata-eval92.3%
associate-*l/95.3%
*-commutative95.3%
*-commutative95.3%
*-commutative95.3%
Simplified95.3%
Taylor expanded in r around 0 95.3%
unpow295.3%
*-commutative95.3%
associate-*l*99.8%
*-commutative99.8%
Simplified99.8%
if 1.00000000000000001e240 < (*.f64 w w) Initial program 66.5%
associate--l-66.5%
+-commutative66.5%
associate--l+66.5%
+-commutative66.5%
associate--r+66.5%
metadata-eval66.5%
associate-*r*63.9%
*-commutative63.9%
associate-/l*63.9%
*-commutative63.9%
Simplified63.9%
Taylor expanded in v around 0 66.5%
unpow266.5%
Simplified66.5%
associate-/r/66.5%
*-commutative66.5%
associate-*l*87.3%
Applied egg-rr87.3%
associate-*l/87.3%
Applied egg-rr87.3%
associate-*r*99.0%
*-commutative99.0%
*-commutative99.0%
*-commutative99.0%
Simplified99.0%
Final simplification99.5%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (* w (* r w))) (t_1 (/ 2.0 (* r r))))
(if (or (<= v -3.2e+26) (not (<= v 2e-30)))
(+ t_1 (- -1.5 (* (/ r 4.0) t_0)))
(+ t_1 (- -1.5 (* t_0 (/ r 2.6666666666666665)))))))
double code(double v, double w, double r) {
double t_0 = w * (r * w);
double t_1 = 2.0 / (r * r);
double tmp;
if ((v <= -3.2e+26) || !(v <= 2e-30)) {
tmp = t_1 + (-1.5 - ((r / 4.0) * t_0));
} else {
tmp = t_1 + (-1.5 - (t_0 * (r / 2.6666666666666665)));
}
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 = w * (r * w)
t_1 = 2.0d0 / (r * r)
if ((v <= (-3.2d+26)) .or. (.not. (v <= 2d-30))) then
tmp = t_1 + ((-1.5d0) - ((r / 4.0d0) * t_0))
else
tmp = t_1 + ((-1.5d0) - (t_0 * (r / 2.6666666666666665d0)))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = w * (r * w);
double t_1 = 2.0 / (r * r);
double tmp;
if ((v <= -3.2e+26) || !(v <= 2e-30)) {
tmp = t_1 + (-1.5 - ((r / 4.0) * t_0));
} else {
tmp = t_1 + (-1.5 - (t_0 * (r / 2.6666666666666665)));
}
return tmp;
}
def code(v, w, r): t_0 = w * (r * w) t_1 = 2.0 / (r * r) tmp = 0 if (v <= -3.2e+26) or not (v <= 2e-30): tmp = t_1 + (-1.5 - ((r / 4.0) * t_0)) else: tmp = t_1 + (-1.5 - (t_0 * (r / 2.6666666666666665))) return tmp
function code(v, w, r) t_0 = Float64(w * Float64(r * w)) t_1 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if ((v <= -3.2e+26) || !(v <= 2e-30)) tmp = Float64(t_1 + Float64(-1.5 - Float64(Float64(r / 4.0) * t_0))); else tmp = Float64(t_1 + Float64(-1.5 - Float64(t_0 * Float64(r / 2.6666666666666665)))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = w * (r * w); t_1 = 2.0 / (r * r); tmp = 0.0; if ((v <= -3.2e+26) || ~((v <= 2e-30))) tmp = t_1 + (-1.5 - ((r / 4.0) * t_0)); else tmp = t_1 + (-1.5 - (t_0 * (r / 2.6666666666666665))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[v, -3.2e+26], N[Not[LessEqual[v, 2e-30]], $MachinePrecision]], N[(t$95$1 + N[(-1.5 - N[(N[(r / 4.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(-1.5 - N[(t$95$0 * N[(r / 2.6666666666666665), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := w \cdot \left(r \cdot w\right)\\
t_1 := \frac{2}{r \cdot r}\\
\mathbf{if}\;v \leq -3.2 \cdot 10^{+26} \lor \neg \left(v \leq 2 \cdot 10^{-30}\right):\\
\;\;\;\;t_1 + \left(-1.5 - \frac{r}{4} \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(-1.5 - t_0 \cdot \frac{r}{2.6666666666666665}\right)\\
\end{array}
\end{array}
if v < -3.20000000000000029e26 or 2e-30 < v Initial program 82.2%
associate--l-82.2%
+-commutative82.2%
associate--l+82.2%
+-commutative82.2%
associate--r+82.2%
metadata-eval82.2%
associate-*r*80.5%
*-commutative80.5%
associate-/l*82.8%
*-commutative82.8%
Simplified82.8%
Taylor expanded in v around inf 86.7%
unpow286.7%
*-commutative86.7%
associate-*l*95.7%
*-commutative95.7%
Simplified95.7%
associate-/r/95.8%
*-commutative95.8%
Applied egg-rr95.8%
if -3.20000000000000029e26 < v < 2e-30Initial program 86.6%
associate--l-86.6%
+-commutative86.6%
associate--l+86.6%
+-commutative86.6%
associate--r+86.6%
metadata-eval86.6%
associate-*r*86.6%
*-commutative86.6%
associate-/l*86.6%
*-commutative86.6%
Simplified86.6%
Taylor expanded in v around 0 86.6%
unpow286.6%
Simplified86.6%
associate-/r/86.6%
*-commutative86.6%
associate-*l*95.8%
Applied egg-rr95.8%
Final simplification95.8%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (or (<= v -5e+26) (not (<= v 3.6e-26)))
(- (+ t_0 -1.5) (* (* r w) (/ r (/ 4.0 w))))
(+ t_0 (- -1.5 (/ (* (* r w) (* r w)) 2.6666666666666665))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((v <= -5e+26) || !(v <= 3.6e-26)) {
tmp = (t_0 + -1.5) - ((r * w) * (r / (4.0 / w)));
} else {
tmp = t_0 + (-1.5 - (((r * w) * (r * w)) / 2.6666666666666665));
}
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 <= (-5d+26)) .or. (.not. (v <= 3.6d-26))) then
tmp = (t_0 + (-1.5d0)) - ((r * w) * (r / (4.0d0 / w)))
else
tmp = t_0 + ((-1.5d0) - (((r * w) * (r * w)) / 2.6666666666666665d0))
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 <= -5e+26) || !(v <= 3.6e-26)) {
tmp = (t_0 + -1.5) - ((r * w) * (r / (4.0 / w)));
} else {
tmp = t_0 + (-1.5 - (((r * w) * (r * w)) / 2.6666666666666665));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if (v <= -5e+26) or not (v <= 3.6e-26): tmp = (t_0 + -1.5) - ((r * w) * (r / (4.0 / w))) else: tmp = t_0 + (-1.5 - (((r * w) * (r * w)) / 2.6666666666666665)) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if ((v <= -5e+26) || !(v <= 3.6e-26)) tmp = Float64(Float64(t_0 + -1.5) - Float64(Float64(r * w) * Float64(r / Float64(4.0 / w)))); else tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(Float64(r * w) * Float64(r * w)) / 2.6666666666666665))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if ((v <= -5e+26) || ~((v <= 3.6e-26))) tmp = (t_0 + -1.5) - ((r * w) * (r / (4.0 / w))); else tmp = t_0 + (-1.5 - (((r * w) * (r * w)) / 2.6666666666666665)); 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, -5e+26], N[Not[LessEqual[v, 3.6e-26]], $MachinePrecision]], N[(N[(t$95$0 + -1.5), $MachinePrecision] - N[(N[(r * w), $MachinePrecision] * N[(r / N[(4.0 / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(-1.5 - N[(N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision] / 2.6666666666666665), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;v \leq -5 \cdot 10^{+26} \lor \neg \left(v \leq 3.6 \cdot 10^{-26}\right):\\
\;\;\;\;\left(t_0 + -1.5\right) - \left(r \cdot w\right) \cdot \frac{r}{\frac{4}{w}}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{2.6666666666666665}\right)\\
\end{array}
\end{array}
if v < -5.0000000000000001e26 or 3.6000000000000001e-26 < v Initial program 82.2%
associate--l-82.2%
+-commutative82.2%
associate--l+82.2%
+-commutative82.2%
associate--r+82.2%
metadata-eval82.2%
associate-*r*80.5%
*-commutative80.5%
associate-/l*82.8%
*-commutative82.8%
Simplified82.8%
Taylor expanded in v around inf 86.7%
unpow286.7%
*-commutative86.7%
associate-*l*95.7%
*-commutative95.7%
Simplified95.7%
Taylor expanded in w around 0 86.7%
*-commutative86.7%
unpow286.7%
associate-*r*95.7%
associate-/r*97.4%
*-commutative97.4%
Simplified97.4%
associate-+r-97.4%
associate-/r/99.6%
*-commutative99.6%
Applied egg-rr99.6%
if -5.0000000000000001e26 < v < 3.6000000000000001e-26Initial program 86.6%
associate--l-86.6%
+-commutative86.6%
associate--l+86.6%
+-commutative86.6%
associate--r+86.6%
metadata-eval86.6%
associate-*r*86.6%
*-commutative86.6%
associate-/l*86.6%
*-commutative86.6%
Simplified86.6%
Taylor expanded in v around 0 86.6%
unpow286.6%
Simplified86.6%
associate-/r/86.6%
*-commutative86.6%
associate-*l*95.8%
Applied egg-rr95.8%
associate-*l/95.8%
Applied egg-rr95.8%
associate-*r*99.3%
*-commutative99.3%
*-commutative99.3%
*-commutative99.3%
Simplified99.3%
Final simplification99.4%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (* w (* r w))) (t_1 (/ 2.0 (* r r))))
(if (<= v -2e+27)
(+ t_1 (- -1.5 (* (/ r 4.0) t_0)))
(if (<= v 3.6e-26)
(+ t_1 (- -1.5 (* t_0 (/ r 2.6666666666666665))))
(+ t_1 (- -1.5 (/ r (/ (/ 4.0 w) (* r w)))))))))
double code(double v, double w, double r) {
double t_0 = w * (r * w);
double t_1 = 2.0 / (r * r);
double tmp;
if (v <= -2e+27) {
tmp = t_1 + (-1.5 - ((r / 4.0) * t_0));
} else if (v <= 3.6e-26) {
tmp = t_1 + (-1.5 - (t_0 * (r / 2.6666666666666665)));
} else {
tmp = t_1 + (-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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = w * (r * w)
t_1 = 2.0d0 / (r * r)
if (v <= (-2d+27)) then
tmp = t_1 + ((-1.5d0) - ((r / 4.0d0) * t_0))
else if (v <= 3.6d-26) then
tmp = t_1 + ((-1.5d0) - (t_0 * (r / 2.6666666666666665d0)))
else
tmp = t_1 + ((-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 t_0 = w * (r * w);
double t_1 = 2.0 / (r * r);
double tmp;
if (v <= -2e+27) {
tmp = t_1 + (-1.5 - ((r / 4.0) * t_0));
} else if (v <= 3.6e-26) {
tmp = t_1 + (-1.5 - (t_0 * (r / 2.6666666666666665)));
} else {
tmp = t_1 + (-1.5 - (r / ((4.0 / w) / (r * w))));
}
return tmp;
}
def code(v, w, r): t_0 = w * (r * w) t_1 = 2.0 / (r * r) tmp = 0 if v <= -2e+27: tmp = t_1 + (-1.5 - ((r / 4.0) * t_0)) elif v <= 3.6e-26: tmp = t_1 + (-1.5 - (t_0 * (r / 2.6666666666666665))) else: tmp = t_1 + (-1.5 - (r / ((4.0 / w) / (r * w)))) return tmp
function code(v, w, r) t_0 = Float64(w * Float64(r * w)) t_1 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (v <= -2e+27) tmp = Float64(t_1 + Float64(-1.5 - Float64(Float64(r / 4.0) * t_0))); elseif (v <= 3.6e-26) tmp = Float64(t_1 + Float64(-1.5 - Float64(t_0 * Float64(r / 2.6666666666666665)))); else tmp = Float64(t_1 + Float64(-1.5 - Float64(r / Float64(Float64(4.0 / w) / Float64(r * w))))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = w * (r * w); t_1 = 2.0 / (r * r); tmp = 0.0; if (v <= -2e+27) tmp = t_1 + (-1.5 - ((r / 4.0) * t_0)); elseif (v <= 3.6e-26) tmp = t_1 + (-1.5 - (t_0 * (r / 2.6666666666666665))); else tmp = t_1 + (-1.5 - (r / ((4.0 / w) / (r * w)))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[v, -2e+27], N[(t$95$1 + N[(-1.5 - N[(N[(r / 4.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[v, 3.6e-26], N[(t$95$1 + N[(-1.5 - N[(t$95$0 * N[(r / 2.6666666666666665), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(-1.5 - N[(r / N[(N[(4.0 / w), $MachinePrecision] / N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := w \cdot \left(r \cdot w\right)\\
t_1 := \frac{2}{r \cdot r}\\
\mathbf{if}\;v \leq -2 \cdot 10^{+27}:\\
\;\;\;\;t_1 + \left(-1.5 - \frac{r}{4} \cdot t_0\right)\\
\mathbf{elif}\;v \leq 3.6 \cdot 10^{-26}:\\
\;\;\;\;t_1 + \left(-1.5 - t_0 \cdot \frac{r}{2.6666666666666665}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(-1.5 - \frac{r}{\frac{\frac{4}{w}}{r \cdot w}}\right)\\
\end{array}
\end{array}
if v < -2e27Initial program 82.0%
associate--l-82.0%
+-commutative82.0%
associate--l+82.0%
+-commutative82.0%
associate--r+82.0%
metadata-eval82.0%
associate-*r*80.2%
*-commutative80.2%
associate-/l*83.5%
*-commutative83.5%
Simplified83.5%
Taylor expanded in v around inf 87.1%
unpow287.1%
*-commutative87.1%
associate-*l*98.0%
*-commutative98.0%
Simplified98.0%
associate-/r/98.1%
*-commutative98.1%
Applied egg-rr98.1%
if -2e27 < v < 3.6000000000000001e-26Initial program 86.6%
associate--l-86.6%
+-commutative86.6%
associate--l+86.6%
+-commutative86.6%
associate--r+86.6%
metadata-eval86.6%
associate-*r*86.6%
*-commutative86.6%
associate-/l*86.6%
*-commutative86.6%
Simplified86.6%
Taylor expanded in v around 0 86.6%
unpow286.6%
Simplified86.6%
associate-/r/86.6%
*-commutative86.6%
associate-*l*95.8%
Applied egg-rr95.8%
if 3.6000000000000001e-26 < v Initial program 82.4%
associate--l-82.4%
+-commutative82.4%
associate--l+82.4%
+-commutative82.4%
associate--r+82.4%
metadata-eval82.4%
associate-*r*80.8%
*-commutative80.8%
associate-/l*82.2%
*-commutative82.2%
Simplified82.2%
Taylor expanded in v around inf 86.5%
unpow286.5%
*-commutative86.5%
associate-*l*93.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in w around 0 86.5%
*-commutative86.5%
unpow286.5%
associate-*r*93.9%
associate-/r*96.9%
*-commutative96.9%
Simplified96.9%
Final simplification96.5%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (* w (* r w))) (t_1 (/ 2.0 (* r r))))
(if (<= v -3.2e+26)
(+ t_1 (- -1.5 (* (/ r 4.0) t_0)))
(if (<= v 3.6e-26)
(+ t_1 (- -1.5 (/ (* r t_0) 2.6666666666666665)))
(+ t_1 (- -1.5 (/ r (/ (/ 4.0 w) (* r w)))))))))
double code(double v, double w, double r) {
double t_0 = w * (r * w);
double t_1 = 2.0 / (r * r);
double tmp;
if (v <= -3.2e+26) {
tmp = t_1 + (-1.5 - ((r / 4.0) * t_0));
} else if (v <= 3.6e-26) {
tmp = t_1 + (-1.5 - ((r * t_0) / 2.6666666666666665));
} else {
tmp = t_1 + (-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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = w * (r * w)
t_1 = 2.0d0 / (r * r)
if (v <= (-3.2d+26)) then
tmp = t_1 + ((-1.5d0) - ((r / 4.0d0) * t_0))
else if (v <= 3.6d-26) then
tmp = t_1 + ((-1.5d0) - ((r * t_0) / 2.6666666666666665d0))
else
tmp = t_1 + ((-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 t_0 = w * (r * w);
double t_1 = 2.0 / (r * r);
double tmp;
if (v <= -3.2e+26) {
tmp = t_1 + (-1.5 - ((r / 4.0) * t_0));
} else if (v <= 3.6e-26) {
tmp = t_1 + (-1.5 - ((r * t_0) / 2.6666666666666665));
} else {
tmp = t_1 + (-1.5 - (r / ((4.0 / w) / (r * w))));
}
return tmp;
}
def code(v, w, r): t_0 = w * (r * w) t_1 = 2.0 / (r * r) tmp = 0 if v <= -3.2e+26: tmp = t_1 + (-1.5 - ((r / 4.0) * t_0)) elif v <= 3.6e-26: tmp = t_1 + (-1.5 - ((r * t_0) / 2.6666666666666665)) else: tmp = t_1 + (-1.5 - (r / ((4.0 / w) / (r * w)))) return tmp
function code(v, w, r) t_0 = Float64(w * Float64(r * w)) t_1 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (v <= -3.2e+26) tmp = Float64(t_1 + Float64(-1.5 - Float64(Float64(r / 4.0) * t_0))); elseif (v <= 3.6e-26) tmp = Float64(t_1 + Float64(-1.5 - Float64(Float64(r * t_0) / 2.6666666666666665))); else tmp = Float64(t_1 + Float64(-1.5 - Float64(r / Float64(Float64(4.0 / w) / Float64(r * w))))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = w * (r * w); t_1 = 2.0 / (r * r); tmp = 0.0; if (v <= -3.2e+26) tmp = t_1 + (-1.5 - ((r / 4.0) * t_0)); elseif (v <= 3.6e-26) tmp = t_1 + (-1.5 - ((r * t_0) / 2.6666666666666665)); else tmp = t_1 + (-1.5 - (r / ((4.0 / w) / (r * w)))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[v, -3.2e+26], N[(t$95$1 + N[(-1.5 - N[(N[(r / 4.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[v, 3.6e-26], N[(t$95$1 + N[(-1.5 - N[(N[(r * t$95$0), $MachinePrecision] / 2.6666666666666665), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(-1.5 - N[(r / N[(N[(4.0 / w), $MachinePrecision] / N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := w \cdot \left(r \cdot w\right)\\
t_1 := \frac{2}{r \cdot r}\\
\mathbf{if}\;v \leq -3.2 \cdot 10^{+26}:\\
\;\;\;\;t_1 + \left(-1.5 - \frac{r}{4} \cdot t_0\right)\\
\mathbf{elif}\;v \leq 3.6 \cdot 10^{-26}:\\
\;\;\;\;t_1 + \left(-1.5 - \frac{r \cdot t_0}{2.6666666666666665}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(-1.5 - \frac{r}{\frac{\frac{4}{w}}{r \cdot w}}\right)\\
\end{array}
\end{array}
if v < -3.20000000000000029e26Initial program 82.0%
associate--l-82.0%
+-commutative82.0%
associate--l+82.0%
+-commutative82.0%
associate--r+82.0%
metadata-eval82.0%
associate-*r*80.2%
*-commutative80.2%
associate-/l*83.5%
*-commutative83.5%
Simplified83.5%
Taylor expanded in v around inf 87.1%
unpow287.1%
*-commutative87.1%
associate-*l*98.0%
*-commutative98.0%
Simplified98.0%
associate-/r/98.1%
*-commutative98.1%
Applied egg-rr98.1%
if -3.20000000000000029e26 < v < 3.6000000000000001e-26Initial program 86.6%
associate--l-86.6%
+-commutative86.6%
associate--l+86.6%
+-commutative86.6%
associate--r+86.6%
metadata-eval86.6%
associate-*r*86.6%
*-commutative86.6%
associate-/l*86.6%
*-commutative86.6%
Simplified86.6%
Taylor expanded in v around 0 86.6%
unpow286.6%
Simplified86.6%
associate-/r/86.6%
*-commutative86.6%
associate-*l*95.8%
Applied egg-rr95.8%
associate-*l/95.8%
Applied egg-rr95.8%
if 3.6000000000000001e-26 < v Initial program 82.4%
associate--l-82.4%
+-commutative82.4%
associate--l+82.4%
+-commutative82.4%
associate--r+82.4%
metadata-eval82.4%
associate-*r*80.8%
*-commutative80.8%
associate-/l*82.2%
*-commutative82.2%
Simplified82.2%
Taylor expanded in v around inf 86.5%
unpow286.5%
*-commutative86.5%
associate-*l*93.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in w around 0 86.5%
*-commutative86.5%
unpow286.5%
associate-*r*93.9%
associate-/r*96.9%
*-commutative96.9%
Simplified96.9%
Final simplification96.5%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= v -1.12e+27)
(+ t_0 (- -1.5 (* (/ r 4.0) (* w (* r w)))))
(if (<= v 1950000000.0)
(+ t_0 (- -1.5 (/ (* (* r w) (* r w)) 2.6666666666666665)))
(+ t_0 (- -1.5 (/ r (/ (/ 4.0 w) (* r w)))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (v <= -1.12e+27) {
tmp = t_0 + (-1.5 - ((r / 4.0) * (w * (r * w))));
} else if (v <= 1950000000.0) {
tmp = t_0 + (-1.5 - (((r * w) * (r * w)) / 2.6666666666666665));
} else {
tmp = t_0 + (-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) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
if (v <= (-1.12d+27)) then
tmp = t_0 + ((-1.5d0) - ((r / 4.0d0) * (w * (r * w))))
else if (v <= 1950000000.0d0) then
tmp = t_0 + ((-1.5d0) - (((r * w) * (r * w)) / 2.6666666666666665d0))
else
tmp = t_0 + ((-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 t_0 = 2.0 / (r * r);
double tmp;
if (v <= -1.12e+27) {
tmp = t_0 + (-1.5 - ((r / 4.0) * (w * (r * w))));
} else if (v <= 1950000000.0) {
tmp = t_0 + (-1.5 - (((r * w) * (r * w)) / 2.6666666666666665));
} else {
tmp = t_0 + (-1.5 - (r / ((4.0 / w) / (r * w))));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if v <= -1.12e+27: tmp = t_0 + (-1.5 - ((r / 4.0) * (w * (r * w)))) elif v <= 1950000000.0: tmp = t_0 + (-1.5 - (((r * w) * (r * w)) / 2.6666666666666665)) else: tmp = t_0 + (-1.5 - (r / ((4.0 / w) / (r * w)))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (v <= -1.12e+27) tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(r / 4.0) * Float64(w * Float64(r * w))))); elseif (v <= 1950000000.0) tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(Float64(r * w) * Float64(r * w)) / 2.6666666666666665))); else tmp = Float64(t_0 + Float64(-1.5 - Float64(r / Float64(Float64(4.0 / w) / Float64(r * w))))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (v <= -1.12e+27) tmp = t_0 + (-1.5 - ((r / 4.0) * (w * (r * w)))); elseif (v <= 1950000000.0) tmp = t_0 + (-1.5 - (((r * w) * (r * w)) / 2.6666666666666665)); else tmp = t_0 + (-1.5 - (r / ((4.0 / w) / (r * w)))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[v, -1.12e+27], N[(t$95$0 + N[(-1.5 - N[(N[(r / 4.0), $MachinePrecision] * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[v, 1950000000.0], N[(t$95$0 + N[(-1.5 - N[(N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision] / 2.6666666666666665), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(-1.5 - N[(r / N[(N[(4.0 / w), $MachinePrecision] / N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;v \leq -1.12 \cdot 10^{+27}:\\
\;\;\;\;t_0 + \left(-1.5 - \frac{r}{4} \cdot \left(w \cdot \left(r \cdot w\right)\right)\right)\\
\mathbf{elif}\;v \leq 1950000000:\\
\;\;\;\;t_0 + \left(-1.5 - \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{2.6666666666666665}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - \frac{r}{\frac{\frac{4}{w}}{r \cdot w}}\right)\\
\end{array}
\end{array}
if v < -1.12e27Initial program 82.0%
associate--l-82.0%
+-commutative82.0%
associate--l+82.0%
+-commutative82.0%
associate--r+82.0%
metadata-eval82.0%
associate-*r*80.2%
*-commutative80.2%
associate-/l*83.5%
*-commutative83.5%
Simplified83.5%
Taylor expanded in v around inf 87.1%
unpow287.1%
*-commutative87.1%
associate-*l*98.0%
*-commutative98.0%
Simplified98.0%
associate-/r/98.1%
*-commutative98.1%
Applied egg-rr98.1%
if -1.12e27 < v < 1.95e9Initial program 85.2%
associate--l-85.2%
+-commutative85.2%
associate--l+85.2%
+-commutative85.2%
associate--r+85.2%
metadata-eval85.2%
associate-*r*85.2%
*-commutative85.2%
associate-/l*85.2%
*-commutative85.2%
Simplified85.2%
Taylor expanded in v around 0 85.2%
unpow285.2%
Simplified85.2%
associate-/r/85.2%
*-commutative85.2%
associate-*l*93.9%
Applied egg-rr93.9%
associate-*l/93.9%
Applied egg-rr93.9%
associate-*r*98.8%
*-commutative98.8%
*-commutative98.8%
*-commutative98.8%
Simplified98.8%
if 1.95e9 < v Initial program 85.2%
associate--l-85.2%
+-commutative85.2%
associate--l+85.2%
+-commutative85.2%
associate--r+85.2%
metadata-eval85.2%
associate-*r*83.5%
*-commutative83.5%
associate-/l*85.1%
*-commutative85.1%
Simplified85.1%
Taylor expanded in v around inf 89.8%
unpow289.8%
*-commutative89.8%
associate-*l*98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in w around 0 89.8%
*-commutative89.8%
unpow289.8%
associate-*r*98.1%
associate-/r*99.8%
*-commutative99.8%
Simplified99.8%
Final simplification98.9%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= r 1e-143)
t_0
(+ t_0 (- -1.5 (* (* w (* r w)) (/ r 2.6666666666666665)))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 1e-143) {
tmp = t_0;
} else {
tmp = t_0 + (-1.5 - ((w * (r * w)) * (r / 2.6666666666666665)));
}
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 <= 1d-143) then
tmp = t_0
else
tmp = t_0 + ((-1.5d0) - ((w * (r * w)) * (r / 2.6666666666666665d0)))
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 <= 1e-143) {
tmp = t_0;
} else {
tmp = t_0 + (-1.5 - ((w * (r * w)) * (r / 2.6666666666666665)));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if r <= 1e-143: tmp = t_0 else: tmp = t_0 + (-1.5 - ((w * (r * w)) * (r / 2.6666666666666665))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (r <= 1e-143) tmp = t_0; else tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(w * Float64(r * w)) * Float64(r / 2.6666666666666665)))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (r <= 1e-143) tmp = t_0; else tmp = t_0 + (-1.5 - ((w * (r * w)) * (r / 2.6666666666666665))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r, 1e-143], t$95$0, N[(t$95$0 + N[(-1.5 - N[(N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision] * N[(r / 2.6666666666666665), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 10^{-143}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 - \left(w \cdot \left(r \cdot w\right)\right) \cdot \frac{r}{2.6666666666666665}\right)\\
\end{array}
\end{array}
if r < 9.9999999999999995e-144Initial program 79.4%
associate--l-79.4%
+-commutative79.4%
associate--l+79.5%
+-commutative79.5%
associate--r+79.5%
metadata-eval79.5%
associate-*r*78.1%
*-commutative78.1%
associate-/l*78.7%
*-commutative78.7%
Simplified78.7%
Taylor expanded in v around inf 77.0%
unpow277.0%
*-commutative77.0%
associate-*l*88.9%
*-commutative88.9%
Simplified88.9%
Taylor expanded in w around 0 77.0%
*-commutative77.0%
unpow277.0%
associate-*r*88.9%
associate-/r*90.3%
*-commutative90.3%
Simplified90.3%
Taylor expanded in r around 0 56.0%
unpow256.0%
Simplified56.0%
if 9.9999999999999995e-144 < 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-*r*91.9%
*-commutative91.9%
associate-/l*93.7%
*-commutative93.7%
Simplified93.7%
Taylor expanded in v around 0 85.5%
unpow285.5%
Simplified85.5%
associate-/r/85.5%
*-commutative85.5%
associate-*l*89.0%
Applied egg-rr89.0%
Final simplification69.4%
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= r 2.45e-57)
t_0
(if (or (<= r 4.5e-40) (not (<= r 1.8e+103)))
(* (* w w) (* (* r r) -0.25))
(+ t_0 -1.5)))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 2.45e-57) {
tmp = t_0;
} else if ((r <= 4.5e-40) || !(r <= 1.8e+103)) {
tmp = (w * w) * ((r * r) * -0.25);
} 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 (r <= 2.45d-57) then
tmp = t_0
else if ((r <= 4.5d-40) .or. (.not. (r <= 1.8d+103))) then
tmp = (w * w) * ((r * r) * (-0.25d0))
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 (r <= 2.45e-57) {
tmp = t_0;
} else if ((r <= 4.5e-40) || !(r <= 1.8e+103)) {
tmp = (w * w) * ((r * r) * -0.25);
} else {
tmp = t_0 + -1.5;
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if r <= 2.45e-57: tmp = t_0 elif (r <= 4.5e-40) or not (r <= 1.8e+103): tmp = (w * w) * ((r * r) * -0.25) 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 (r <= 2.45e-57) tmp = t_0; elseif ((r <= 4.5e-40) || !(r <= 1.8e+103)) tmp = Float64(Float64(w * w) * Float64(Float64(r * r) * -0.25)); 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 (r <= 2.45e-57) tmp = t_0; elseif ((r <= 4.5e-40) || ~((r <= 1.8e+103))) tmp = (w * w) * ((r * r) * -0.25); 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[r, 2.45e-57], t$95$0, If[Or[LessEqual[r, 4.5e-40], N[Not[LessEqual[r, 1.8e+103]], $MachinePrecision]], N[(N[(w * w), $MachinePrecision] * N[(N[(r * r), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + -1.5), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 2.45 \cdot 10^{-57}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;r \leq 4.5 \cdot 10^{-40} \lor \neg \left(r \leq 1.8 \cdot 10^{+103}\right):\\
\;\;\;\;\left(w \cdot w\right) \cdot \left(\left(r \cdot r\right) \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + -1.5\\
\end{array}
\end{array}
if r < 2.44999999999999994e-57Initial program 80.8%
associate--l-80.8%
+-commutative80.8%
associate--l+80.8%
+-commutative80.8%
associate--r+80.8%
metadata-eval80.8%
associate-*r*79.7%
*-commutative79.7%
associate-/l*80.2%
*-commutative80.2%
Simplified80.2%
Taylor expanded in v around inf 78.6%
unpow278.6%
*-commutative78.6%
associate-*l*89.4%
*-commutative89.4%
Simplified89.4%
Taylor expanded in w around 0 78.6%
*-commutative78.6%
unpow278.6%
associate-*r*89.4%
associate-/r*90.7%
*-commutative90.7%
Simplified90.7%
Taylor expanded in r around 0 58.4%
unpow258.4%
Simplified58.4%
if 2.44999999999999994e-57 < r < 4.5000000000000001e-40 or 1.80000000000000008e103 < r Initial program 88.2%
associate--l-88.2%
+-commutative88.2%
associate--l+88.2%
+-commutative88.2%
associate--r+88.2%
metadata-eval88.2%
associate-*r*88.2%
*-commutative88.2%
associate-/l*91.7%
*-commutative91.7%
Simplified91.7%
Taylor expanded in v around inf 87.3%
unpow287.3%
*-commutative87.3%
associate-*l*89.7%
*-commutative89.7%
Simplified89.7%
Taylor expanded in w around 0 87.3%
*-commutative87.3%
unpow287.3%
associate-*r*89.7%
associate-/r*89.8%
*-commutative89.8%
Simplified89.8%
Taylor expanded in r around inf 64.0%
*-commutative64.0%
*-commutative64.0%
associate-*l*64.0%
unpow264.0%
unpow264.0%
Simplified64.0%
if 4.5000000000000001e-40 < r < 1.80000000000000008e103Initial program 96.9%
associate--l-96.9%
+-commutative96.9%
associate--l+96.9%
+-commutative96.9%
associate--r+96.9%
metadata-eval96.9%
associate-*r*96.8%
*-commutative96.8%
associate-/l*96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in v around inf 97.3%
unpow297.3%
*-commutative97.3%
associate-*l*97.3%
*-commutative97.3%
Simplified97.3%
Taylor expanded in w around 0 97.3%
*-commutative97.3%
unpow297.3%
associate-*r*97.3%
associate-/r*97.2%
*-commutative97.2%
Simplified97.2%
Taylor expanded in r around 0 68.6%
sub-neg68.6%
associate-*r/68.6%
metadata-eval68.6%
unpow268.6%
metadata-eval68.6%
Simplified68.6%
Final simplification60.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.5%
associate--l-84.5%
+-commutative84.5%
associate--l+84.5%
+-commutative84.5%
associate--r+84.5%
metadata-eval84.5%
associate-*r*83.7%
*-commutative83.7%
associate-/l*84.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in v around inf 82.9%
unpow282.9%
*-commutative82.9%
associate-*l*90.5%
*-commutative90.5%
Simplified90.5%
Taylor expanded in w around 0 82.9%
*-commutative82.9%
unpow282.9%
associate-*r*90.5%
associate-/r*91.4%
*-commutative91.4%
Simplified91.4%
Taylor expanded in r around 0 59.5%
sub-neg59.5%
associate-*r/59.5%
metadata-eval59.5%
unpow259.5%
metadata-eval59.5%
Simplified59.5%
Final simplification59.5%
(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 84.5%
associate--l-84.5%
+-commutative84.5%
associate--l+84.5%
+-commutative84.5%
associate--r+84.5%
metadata-eval84.5%
associate-*r*83.7%
*-commutative83.7%
associate-/l*84.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in v around inf 82.9%
unpow282.9%
*-commutative82.9%
associate-*l*90.5%
*-commutative90.5%
Simplified90.5%
Taylor expanded in w around 0 82.9%
*-commutative82.9%
unpow282.9%
associate-*r*90.5%
associate-/r*91.4%
*-commutative91.4%
Simplified91.4%
Taylor expanded in r around 0 42.9%
unpow242.9%
Simplified42.9%
Final simplification42.9%
herbie shell --seed 2023271
(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))