
(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 (+ (* (pow r -2.0) 2.0) (- -1.5 (* (/ (+ -0.375 (* v 0.25)) (+ v -1.0)) (pow (* r w) 2.0)))))
double code(double v, double w, double r) {
return (pow(r, -2.0) * 2.0) + (-1.5 - (((-0.375 + (v * 0.25)) / (v + -1.0)) * pow((r * w), 2.0)));
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
code = ((r ** (-2.0d0)) * 2.0d0) + ((-1.5d0) - ((((-0.375d0) + (v * 0.25d0)) / (v + (-1.0d0))) * ((r * w) ** 2.0d0)))
end function
public static double code(double v, double w, double r) {
return (Math.pow(r, -2.0) * 2.0) + (-1.5 - (((-0.375 + (v * 0.25)) / (v + -1.0)) * Math.pow((r * w), 2.0)));
}
def code(v, w, r): return (math.pow(r, -2.0) * 2.0) + (-1.5 - (((-0.375 + (v * 0.25)) / (v + -1.0)) * math.pow((r * w), 2.0)))
function code(v, w, r) return Float64(Float64((r ^ -2.0) * 2.0) + Float64(-1.5 - Float64(Float64(Float64(-0.375 + Float64(v * 0.25)) / Float64(v + -1.0)) * (Float64(r * w) ^ 2.0)))) end
function tmp = code(v, w, r) tmp = ((r ^ -2.0) * 2.0) + (-1.5 - (((-0.375 + (v * 0.25)) / (v + -1.0)) * ((r * w) ^ 2.0))); end
code[v_, w_, r_] := N[(N[(N[Power[r, -2.0], $MachinePrecision] * 2.0), $MachinePrecision] + N[(-1.5 - N[(N[(N[(-0.375 + N[(v * 0.25), $MachinePrecision]), $MachinePrecision] / N[(v + -1.0), $MachinePrecision]), $MachinePrecision] * N[Power[N[(r * w), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{r}^{-2} \cdot 2 + \left(-1.5 - \frac{-0.375 + v \cdot 0.25}{v + -1} \cdot {\left(r \cdot w\right)}^{2}\right)
\end{array}
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= (* w w) 5e+246)
(+
t_0
(- -1.5 (* (* r (* w (* r w))) (/ (+ 0.375 (* v -0.25)) (- 1.0 v)))))
(+ t_0 (+ -1.5 (* (* r w) (* r (* -0.375 w))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((w * w) <= 5e+246) {
tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * ((0.375 + (v * -0.25)) / (1.0 - v))));
} else {
tmp = t_0 + (-1.5 + ((r * w) * (r * (-0.375 * w))));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
if ((w * w) <= 5d+246) then
tmp = t_0 + ((-1.5d0) - ((r * (w * (r * w))) * ((0.375d0 + (v * (-0.25d0))) / (1.0d0 - v))))
else
tmp = t_0 + ((-1.5d0) + ((r * w) * (r * ((-0.375d0) * w))))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((w * w) <= 5e+246) {
tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * ((0.375 + (v * -0.25)) / (1.0 - v))));
} else {
tmp = t_0 + (-1.5 + ((r * w) * (r * (-0.375 * w))));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if (w * w) <= 5e+246: tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * ((0.375 + (v * -0.25)) / (1.0 - v)))) else: tmp = t_0 + (-1.5 + ((r * w) * (r * (-0.375 * w)))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (Float64(w * w) <= 5e+246) tmp = Float64(t_0 + Float64(-1.5 - Float64(Float64(r * Float64(w * Float64(r * w))) * Float64(Float64(0.375 + Float64(v * -0.25)) / Float64(1.0 - v))))); else tmp = Float64(t_0 + Float64(-1.5 + Float64(Float64(r * w) * Float64(r * Float64(-0.375 * w))))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if ((w * w) <= 5e+246) tmp = t_0 + (-1.5 - ((r * (w * (r * w))) * ((0.375 + (v * -0.25)) / (1.0 - v)))); else tmp = t_0 + (-1.5 + ((r * w) * (r * (-0.375 * w)))); 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], 5e+246], N[(t$95$0 + N[(-1.5 - N[(N[(r * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(0.375 + N[(v * -0.25), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(-1.5 + N[(N[(r * w), $MachinePrecision] * N[(r * N[(-0.375 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;w \cdot w \leq 5 \cdot 10^{+246}:\\
\;\;\;\;t_0 + \left(-1.5 - \left(r \cdot \left(w \cdot \left(r \cdot w\right)\right)\right) \cdot \frac{0.375 + v \cdot -0.25}{1 - v}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 + \left(r \cdot w\right) \cdot \left(r \cdot \left(-0.375 \cdot w\right)\right)\right)\\
\end{array}
\end{array}
(FPCore (v w r)
:precision binary64
(let* ((t_0 (* (* r w) (* r w))) (t_1 (/ 2.0 (* r r))))
(if (or (<= v -1.0) (not (<= v 2e-5)))
(+ t_1 (- -1.5 (* 0.25 t_0)))
(+ t_1 (- -1.5 (* t_0 (+ 0.375 (* v 0.125))))))))
double code(double v, double w, double r) {
double t_0 = (r * w) * (r * w);
double t_1 = 2.0 / (r * r);
double tmp;
if ((v <= -1.0) || !(v <= 2e-5)) {
tmp = t_1 + (-1.5 - (0.25 * t_0));
} else {
tmp = t_1 + (-1.5 - (t_0 * (0.375 + (v * 0.125))));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (r * w) * (r * w)
t_1 = 2.0d0 / (r * r)
if ((v <= (-1.0d0)) .or. (.not. (v <= 2d-5))) then
tmp = t_1 + ((-1.5d0) - (0.25d0 * t_0))
else
tmp = t_1 + ((-1.5d0) - (t_0 * (0.375d0 + (v * 0.125d0))))
end if
code = tmp
end function
public static double code(double v, double w, double r) {
double t_0 = (r * w) * (r * w);
double t_1 = 2.0 / (r * r);
double tmp;
if ((v <= -1.0) || !(v <= 2e-5)) {
tmp = t_1 + (-1.5 - (0.25 * t_0));
} else {
tmp = t_1 + (-1.5 - (t_0 * (0.375 + (v * 0.125))));
}
return tmp;
}
def code(v, w, r): t_0 = (r * w) * (r * w) t_1 = 2.0 / (r * r) tmp = 0 if (v <= -1.0) or not (v <= 2e-5): tmp = t_1 + (-1.5 - (0.25 * t_0)) else: tmp = t_1 + (-1.5 - (t_0 * (0.375 + (v * 0.125)))) return tmp
function code(v, w, r) t_0 = Float64(Float64(r * w) * Float64(r * w)) t_1 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if ((v <= -1.0) || !(v <= 2e-5)) tmp = Float64(t_1 + Float64(-1.5 - Float64(0.25 * t_0))); else tmp = Float64(t_1 + Float64(-1.5 - Float64(t_0 * Float64(0.375 + Float64(v * 0.125))))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = (r * w) * (r * w); t_1 = 2.0 / (r * r); tmp = 0.0; if ((v <= -1.0) || ~((v <= 2e-5))) tmp = t_1 + (-1.5 - (0.25 * t_0)); else tmp = t_1 + (-1.5 - (t_0 * (0.375 + (v * 0.125)))); end tmp_2 = tmp; end
code[v_, w_, r_] := Block[{t$95$0 = N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[v, -1.0], N[Not[LessEqual[v, 2e-5]], $MachinePrecision]], N[(t$95$1 + N[(-1.5 - N[(0.25 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(-1.5 - N[(t$95$0 * N[(0.375 + N[(v * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(r \cdot w\right) \cdot \left(r \cdot w\right)\\
t_1 := \frac{2}{r \cdot r}\\
\mathbf{if}\;v \leq -1 \lor \neg \left(v \leq 2 \cdot 10^{-5}\right):\\
\;\;\;\;t_1 + \left(-1.5 - 0.25 \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(-1.5 - t_0 \cdot \left(0.375 + v \cdot 0.125\right)\right)\\
\end{array}
\end{array}
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= r 1.1e-30)
(+ t_0 (- -1.5 (* 0.25 (* (* r w) (* r w)))))
(+
t_0
(+ -1.5 (* (* r w) (/ (* r (* w (- (* v 0.25) 0.375))) (- 1.0 v))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 1.1e-30) {
tmp = t_0 + (-1.5 - (0.25 * ((r * w) * (r * w))));
} else {
tmp = t_0 + (-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) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
if (r <= 1.1d-30) then
tmp = t_0 + ((-1.5d0) - (0.25d0 * ((r * w) * (r * w))))
else
tmp = t_0 + ((-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 t_0 = 2.0 / (r * r);
double tmp;
if (r <= 1.1e-30) {
tmp = t_0 + (-1.5 - (0.25 * ((r * w) * (r * w))));
} else {
tmp = t_0 + (-1.5 + ((r * w) * ((r * (w * ((v * 0.25) - 0.375))) / (1.0 - v))));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if r <= 1.1e-30: tmp = t_0 + (-1.5 - (0.25 * ((r * w) * (r * w)))) else: tmp = t_0 + (-1.5 + ((r * w) * ((r * (w * ((v * 0.25) - 0.375))) / (1.0 - v)))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (r <= 1.1e-30) tmp = Float64(t_0 + Float64(-1.5 - Float64(0.25 * Float64(Float64(r * w) * Float64(r * w))))); else tmp = Float64(t_0 + Float64(-1.5 + Float64(Float64(r * w) * Float64(Float64(r * Float64(w * Float64(Float64(v * 0.25) - 0.375))) / 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 (r <= 1.1e-30) tmp = t_0 + (-1.5 - (0.25 * ((r * w) * (r * w)))); else tmp = t_0 + (-1.5 + ((r * w) * ((r * (w * ((v * 0.25) - 0.375))) / (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[LessEqual[r, 1.1e-30], N[(t$95$0 + N[(-1.5 - N[(0.25 * N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(-1.5 + N[(N[(r * w), $MachinePrecision] * N[(N[(r * N[(w * N[(N[(v * 0.25), $MachinePrecision] - 0.375), $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}\;r \leq 1.1 \cdot 10^{-30}:\\
\;\;\;\;t_0 + \left(-1.5 - 0.25 \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 + \left(r \cdot w\right) \cdot \frac{r \cdot \left(w \cdot \left(v \cdot 0.25 - 0.375\right)\right)}{1 - v}\right)\\
\end{array}
\end{array}
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (or (<= v -7.2e+29) (not (<= v 2e-5)))
(+ t_0 (- -1.5 (* 0.25 (* (* r w) (* r w)))))
(+ t_0 (+ -1.5 (* (* r w) (* r (* -0.375 w))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((v <= -7.2e+29) || !(v <= 2e-5)) {
tmp = t_0 + (-1.5 - (0.25 * ((r * w) * (r * w))));
} else {
tmp = t_0 + (-1.5 + ((r * w) * (r * (-0.375 * 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 <= (-7.2d+29)) .or. (.not. (v <= 2d-5))) then
tmp = t_0 + ((-1.5d0) - (0.25d0 * ((r * w) * (r * w))))
else
tmp = t_0 + ((-1.5d0) + ((r * w) * (r * ((-0.375d0) * 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 <= -7.2e+29) || !(v <= 2e-5)) {
tmp = t_0 + (-1.5 - (0.25 * ((r * w) * (r * w))));
} else {
tmp = t_0 + (-1.5 + ((r * w) * (r * (-0.375 * w))));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if (v <= -7.2e+29) or not (v <= 2e-5): tmp = t_0 + (-1.5 - (0.25 * ((r * w) * (r * w)))) else: tmp = t_0 + (-1.5 + ((r * w) * (r * (-0.375 * w)))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if ((v <= -7.2e+29) || !(v <= 2e-5)) tmp = Float64(t_0 + Float64(-1.5 - Float64(0.25 * Float64(Float64(r * w) * Float64(r * w))))); else tmp = Float64(t_0 + Float64(-1.5 + Float64(Float64(r * w) * Float64(r * Float64(-0.375 * w))))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if ((v <= -7.2e+29) || ~((v <= 2e-5))) tmp = t_0 + (-1.5 - (0.25 * ((r * w) * (r * w)))); else tmp = t_0 + (-1.5 + ((r * w) * (r * (-0.375 * w)))); 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, -7.2e+29], N[Not[LessEqual[v, 2e-5]], $MachinePrecision]], N[(t$95$0 + N[(-1.5 - N[(0.25 * N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(-1.5 + N[(N[(r * w), $MachinePrecision] * N[(r * N[(-0.375 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;v \leq -7.2 \cdot 10^{+29} \lor \neg \left(v \leq 2 \cdot 10^{-5}\right):\\
\;\;\;\;t_0 + \left(-1.5 - 0.25 \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 + \left(r \cdot w\right) \cdot \left(r \cdot \left(-0.375 \cdot w\right)\right)\right)\\
\end{array}
\end{array}
(FPCore (v w r) :precision binary64 (+ (/ 2.0 (* r r)) (- -1.5 (* (/ (+ -0.375 (* v 0.25)) (+ v -1.0)) (* (* r w) (* r w))))))
double code(double v, double w, double r) {
return (2.0 / (r * r)) + (-1.5 - (((-0.375 + (v * 0.25)) / (v + -1.0)) * ((r * w) * (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 = (2.0d0 / (r * r)) + ((-1.5d0) - ((((-0.375d0) + (v * 0.25d0)) / (v + (-1.0d0))) * ((r * w) * (r * w))))
end function
public static double code(double v, double w, double r) {
return (2.0 / (r * r)) + (-1.5 - (((-0.375 + (v * 0.25)) / (v + -1.0)) * ((r * w) * (r * w))));
}
def code(v, w, r): return (2.0 / (r * r)) + (-1.5 - (((-0.375 + (v * 0.25)) / (v + -1.0)) * ((r * w) * (r * w))))
function code(v, w, r) return Float64(Float64(2.0 / Float64(r * r)) + Float64(-1.5 - Float64(Float64(Float64(-0.375 + Float64(v * 0.25)) / Float64(v + -1.0)) * Float64(Float64(r * w) * Float64(r * w))))) end
function tmp = code(v, w, r) tmp = (2.0 / (r * r)) + (-1.5 - (((-0.375 + (v * 0.25)) / (v + -1.0)) * ((r * w) * (r * w)))); end
code[v_, w_, r_] := N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + N[(-1.5 - N[(N[(N[(-0.375 + N[(v * 0.25), $MachinePrecision]), $MachinePrecision] / N[(v + -1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{r \cdot r} + \left(-1.5 - \frac{-0.375 + v \cdot 0.25}{v + -1} \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)\right)
\end{array}
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= r 2.2e-102)
(+ -1.5 t_0)
(+ t_0 (+ -1.5 (* -0.375 (* (* r r) (* w w))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 2.2e-102) {
tmp = -1.5 + t_0;
} else {
tmp = t_0 + (-1.5 + (-0.375 * ((r * 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) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
if (r <= 2.2d-102) then
tmp = (-1.5d0) + t_0
else
tmp = t_0 + ((-1.5d0) + ((-0.375d0) * ((r * r) * (w * 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 <= 2.2e-102) {
tmp = -1.5 + t_0;
} else {
tmp = t_0 + (-1.5 + (-0.375 * ((r * r) * (w * w))));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if r <= 2.2e-102: tmp = -1.5 + t_0 else: tmp = t_0 + (-1.5 + (-0.375 * ((r * r) * (w * w)))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (r <= 2.2e-102) tmp = Float64(-1.5 + t_0); else tmp = Float64(t_0 + Float64(-1.5 + Float64(-0.375 * Float64(Float64(r * r) * Float64(w * w))))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (r <= 2.2e-102) tmp = -1.5 + t_0; else tmp = t_0 + (-1.5 + (-0.375 * ((r * r) * (w * 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, 2.2e-102], N[(-1.5 + t$95$0), $MachinePrecision], N[(t$95$0 + N[(-1.5 + N[(-0.375 * N[(N[(r * r), $MachinePrecision] * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 2.2 \cdot 10^{-102}:\\
\;\;\;\;-1.5 + t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 + -0.375 \cdot \left(\left(r \cdot r\right) \cdot \left(w \cdot w\right)\right)\right)\\
\end{array}
\end{array}
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= r 3.05e-102)
(+ -1.5 t_0)
(+ t_0 (+ -1.5 (* -0.25 (* (* r r) (* w w))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (r <= 3.05e-102) {
tmp = -1.5 + t_0;
} else {
tmp = t_0 + (-1.5 + (-0.25 * ((r * 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) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
if (r <= 3.05d-102) then
tmp = (-1.5d0) + t_0
else
tmp = t_0 + ((-1.5d0) + ((-0.25d0) * ((r * r) * (w * 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 <= 3.05e-102) {
tmp = -1.5 + t_0;
} else {
tmp = t_0 + (-1.5 + (-0.25 * ((r * r) * (w * w))));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if r <= 3.05e-102: tmp = -1.5 + t_0 else: tmp = t_0 + (-1.5 + (-0.25 * ((r * r) * (w * w)))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (r <= 3.05e-102) tmp = Float64(-1.5 + t_0); else tmp = Float64(t_0 + Float64(-1.5 + Float64(-0.25 * Float64(Float64(r * r) * Float64(w * w))))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if (r <= 3.05e-102) tmp = -1.5 + t_0; else tmp = t_0 + (-1.5 + (-0.25 * ((r * r) * (w * 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, 3.05e-102], N[(-1.5 + t$95$0), $MachinePrecision], N[(t$95$0 + N[(-1.5 + N[(-0.25 * N[(N[(r * r), $MachinePrecision] * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;r \leq 3.05 \cdot 10^{-102}:\\
\;\;\;\;-1.5 + t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(-1.5 + -0.25 \cdot \left(\left(r \cdot r\right) \cdot \left(w \cdot w\right)\right)\right)\\
\end{array}
\end{array}
(FPCore (v w r) :precision binary64 (+ (/ 2.0 (* r r)) (+ -1.5 (* (* r w) (* -0.375 (* r w))))))
double code(double v, double w, double r) {
return (2.0 / (r * r)) + (-1.5 + ((r * w) * (-0.375 * (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 = (2.0d0 / (r * r)) + ((-1.5d0) + ((r * w) * ((-0.375d0) * (r * w))))
end function
public static double code(double v, double w, double r) {
return (2.0 / (r * r)) + (-1.5 + ((r * w) * (-0.375 * (r * w))));
}
def code(v, w, r): return (2.0 / (r * r)) + (-1.5 + ((r * w) * (-0.375 * (r * w))))
function code(v, w, r) return Float64(Float64(2.0 / Float64(r * r)) + Float64(-1.5 + Float64(Float64(r * w) * Float64(-0.375 * Float64(r * w))))) end
function tmp = code(v, w, r) tmp = (2.0 / (r * r)) + (-1.5 + ((r * w) * (-0.375 * (r * w)))); end
code[v_, w_, r_] := N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + N[(-1.5 + N[(N[(r * w), $MachinePrecision] * N[(-0.375 * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{r \cdot r} + \left(-1.5 + \left(r \cdot w\right) \cdot \left(-0.375 \cdot \left(r \cdot w\right)\right)\right)
\end{array}
(FPCore (v w r) :precision binary64 (+ (/ 2.0 (* r r)) (+ -1.5 (* (* r w) (* r (* -0.375 w))))))
double code(double v, double w, double r) {
return (2.0 / (r * r)) + (-1.5 + ((r * w) * (r * (-0.375 * w))));
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
code = (2.0d0 / (r * r)) + ((-1.5d0) + ((r * w) * (r * ((-0.375d0) * w))))
end function
public static double code(double v, double w, double r) {
return (2.0 / (r * r)) + (-1.5 + ((r * w) * (r * (-0.375 * w))));
}
def code(v, w, r): return (2.0 / (r * r)) + (-1.5 + ((r * w) * (r * (-0.375 * w))))
function code(v, w, r) return Float64(Float64(2.0 / Float64(r * r)) + Float64(-1.5 + Float64(Float64(r * w) * Float64(r * Float64(-0.375 * w))))) end
function tmp = code(v, w, r) tmp = (2.0 / (r * r)) + (-1.5 + ((r * w) * (r * (-0.375 * w)))); end
code[v_, w_, r_] := N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + N[(-1.5 + N[(N[(r * w), $MachinePrecision] * N[(r * N[(-0.375 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{r \cdot r} + \left(-1.5 + \left(r \cdot w\right) \cdot \left(r \cdot \left(-0.375 \cdot w\right)\right)\right)
\end{array}
(FPCore (v w r) :precision binary64 (+ -1.5 (/ 2.0 (* r r))))
double code(double v, double w, double r) {
return -1.5 + (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 = (-1.5d0) + (2.0d0 / (r * r))
end function
public static double code(double v, double w, double r) {
return -1.5 + (2.0 / (r * r));
}
def code(v, w, r): return -1.5 + (2.0 / (r * r))
function code(v, w, r) return Float64(-1.5 + Float64(2.0 / Float64(r * r))) end
function tmp = code(v, w, r) tmp = -1.5 + (2.0 / (r * r)); end
code[v_, w_, r_] := N[(-1.5 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-1.5 + \frac{2}{r \cdot r}
\end{array}
herbie shell --seed 2024006
(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))