
(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 9 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 (+ (+ (/ 2.0 (* r r)) (* (/ (+ -0.375 (* v 0.25)) (- 1.0 v)) (/ (* r w) (/ (/ 1.0 r) w)))) -1.5))
double code(double v, double w, double r) {
return ((2.0 / (r * r)) + (((-0.375 + (v * 0.25)) / (1.0 - v)) * ((r * w) / ((1.0 / r) / w)))) + -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)) + ((((-0.375d0) + (v * 0.25d0)) / (1.0d0 - v)) * ((r * w) / ((1.0d0 / r) / w)))) + (-1.5d0)
end function
public static double code(double v, double w, double r) {
return ((2.0 / (r * r)) + (((-0.375 + (v * 0.25)) / (1.0 - v)) * ((r * w) / ((1.0 / r) / w)))) + -1.5;
}
def code(v, w, r): return ((2.0 / (r * r)) + (((-0.375 + (v * 0.25)) / (1.0 - v)) * ((r * w) / ((1.0 / r) / w)))) + -1.5
function code(v, w, r) return Float64(Float64(Float64(2.0 / Float64(r * r)) + Float64(Float64(Float64(-0.375 + Float64(v * 0.25)) / Float64(1.0 - v)) * Float64(Float64(r * w) / Float64(Float64(1.0 / r) / w)))) + -1.5) end
function tmp = code(v, w, r) tmp = ((2.0 / (r * r)) + (((-0.375 + (v * 0.25)) / (1.0 - v)) * ((r * w) / ((1.0 / r) / w)))) + -1.5; end
code[v_, w_, r_] := N[(N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(-0.375 + N[(v * 0.25), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision] * N[(N[(r * w), $MachinePrecision] / N[(N[(1.0 / r), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{2}{r \cdot r} + \frac{-0.375 + v \cdot 0.25}{1 - v} \cdot \frac{r \cdot w}{\frac{\frac{1}{r}}{w}}\right) + -1.5
\end{array}
(FPCore (v w r)
:precision binary64
(let* ((t_0 (* (* r w) (* r w))) (t_1 (/ 2.0 (* r r))))
(if (or (<= v -27000.0) (not (<= v 1.75e-68)))
(+ -1.5 (+ t_1 (* t_0 -0.25)))
(+ -1.5 (+ t_1 (* t_0 (- (* v -0.125) 0.375)))))))
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 <= -27000.0) || !(v <= 1.75e-68)) {
tmp = -1.5 + (t_1 + (t_0 * -0.25));
} else {
tmp = -1.5 + (t_1 + (t_0 * ((v * -0.125) - 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) :: t_1
real(8) :: tmp
t_0 = (r * w) * (r * w)
t_1 = 2.0d0 / (r * r)
if ((v <= (-27000.0d0)) .or. (.not. (v <= 1.75d-68))) then
tmp = (-1.5d0) + (t_1 + (t_0 * (-0.25d0)))
else
tmp = (-1.5d0) + (t_1 + (t_0 * ((v * (-0.125d0)) - 0.375d0)))
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 <= -27000.0) || !(v <= 1.75e-68)) {
tmp = -1.5 + (t_1 + (t_0 * -0.25));
} else {
tmp = -1.5 + (t_1 + (t_0 * ((v * -0.125) - 0.375)));
}
return tmp;
}
def code(v, w, r): t_0 = (r * w) * (r * w) t_1 = 2.0 / (r * r) tmp = 0 if (v <= -27000.0) or not (v <= 1.75e-68): tmp = -1.5 + (t_1 + (t_0 * -0.25)) else: tmp = -1.5 + (t_1 + (t_0 * ((v * -0.125) - 0.375))) 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 <= -27000.0) || !(v <= 1.75e-68)) tmp = Float64(-1.5 + Float64(t_1 + Float64(t_0 * -0.25))); else tmp = Float64(-1.5 + Float64(t_1 + Float64(t_0 * Float64(Float64(v * -0.125) - 0.375)))); 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 <= -27000.0) || ~((v <= 1.75e-68))) tmp = -1.5 + (t_1 + (t_0 * -0.25)); else tmp = -1.5 + (t_1 + (t_0 * ((v * -0.125) - 0.375))); 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, -27000.0], N[Not[LessEqual[v, 1.75e-68]], $MachinePrecision]], N[(-1.5 + N[(t$95$1 + N[(t$95$0 * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.5 + N[(t$95$1 + N[(t$95$0 * N[(N[(v * -0.125), $MachinePrecision] - 0.375), $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 -27000 \lor \neg \left(v \leq 1.75 \cdot 10^{-68}\right):\\
\;\;\;\;-1.5 + \left(t_1 + t_0 \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;-1.5 + \left(t_1 + t_0 \cdot \left(v \cdot -0.125 - 0.375\right)\right)\\
\end{array}
\end{array}
(FPCore (v w r) :precision binary64 (+ -1.5 (+ (/ 2.0 (* r r)) (* (/ (+ -0.375 (* v 0.25)) (- 1.0 v)) (* (* r w) (* r w))))))
double code(double v, double w, double r) {
return -1.5 + ((2.0 / (r * r)) + (((-0.375 + (v * 0.25)) / (1.0 - v)) * ((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 = (-1.5d0) + ((2.0d0 / (r * r)) + ((((-0.375d0) + (v * 0.25d0)) / (1.0d0 - v)) * ((r * w) * (r * w))))
end function
public static double code(double v, double w, double r) {
return -1.5 + ((2.0 / (r * r)) + (((-0.375 + (v * 0.25)) / (1.0 - v)) * ((r * w) * (r * w))));
}
def code(v, w, r): return -1.5 + ((2.0 / (r * r)) + (((-0.375 + (v * 0.25)) / (1.0 - v)) * ((r * w) * (r * w))))
function code(v, w, r) return Float64(-1.5 + Float64(Float64(2.0 / Float64(r * r)) + Float64(Float64(Float64(-0.375 + Float64(v * 0.25)) / Float64(1.0 - v)) * Float64(Float64(r * w) * Float64(r * w))))) end
function tmp = code(v, w, r) tmp = -1.5 + ((2.0 / (r * r)) + (((-0.375 + (v * 0.25)) / (1.0 - v)) * ((r * w) * (r * w)))); end
code[v_, w_, r_] := N[(-1.5 + N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(-0.375 + N[(v * 0.25), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision] * N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-1.5 + \left(\frac{2}{r \cdot r} + \frac{-0.375 + v \cdot 0.25}{1 - v} \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 (or (<= v -8.8e+24) (not (<= v 1.75e-68)))
(+ -1.5 (+ t_0 (* (* (* r w) (* r w)) -0.25)))
(+ -4.5 (+ 3.0 (- t_0 (* (* r w) (* (* r w) 0.375))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((v <= -8.8e+24) || !(v <= 1.75e-68)) {
tmp = -1.5 + (t_0 + (((r * w) * (r * w)) * -0.25));
} else {
tmp = -4.5 + (3.0 + (t_0 - ((r * w) * ((r * 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 ((v <= (-8.8d+24)) .or. (.not. (v <= 1.75d-68))) then
tmp = (-1.5d0) + (t_0 + (((r * w) * (r * w)) * (-0.25d0)))
else
tmp = (-4.5d0) + (3.0d0 + (t_0 - ((r * w) * ((r * 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 ((v <= -8.8e+24) || !(v <= 1.75e-68)) {
tmp = -1.5 + (t_0 + (((r * w) * (r * w)) * -0.25));
} else {
tmp = -4.5 + (3.0 + (t_0 - ((r * w) * ((r * w) * 0.375))));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if (v <= -8.8e+24) or not (v <= 1.75e-68): tmp = -1.5 + (t_0 + (((r * w) * (r * w)) * -0.25)) else: tmp = -4.5 + (3.0 + (t_0 - ((r * w) * ((r * w) * 0.375)))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if ((v <= -8.8e+24) || !(v <= 1.75e-68)) tmp = Float64(-1.5 + Float64(t_0 + Float64(Float64(Float64(r * w) * Float64(r * w)) * -0.25))); else tmp = Float64(-4.5 + Float64(3.0 + Float64(t_0 - Float64(Float64(r * w) * Float64(Float64(r * w) * 0.375))))); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if ((v <= -8.8e+24) || ~((v <= 1.75e-68))) tmp = -1.5 + (t_0 + (((r * w) * (r * w)) * -0.25)); else tmp = -4.5 + (3.0 + (t_0 - ((r * w) * ((r * 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[Or[LessEqual[v, -8.8e+24], N[Not[LessEqual[v, 1.75e-68]], $MachinePrecision]], N[(-1.5 + N[(t$95$0 + N[(N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 + N[(3.0 + N[(t$95$0 - N[(N[(r * w), $MachinePrecision] * N[(N[(r * w), $MachinePrecision] * 0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;v \leq -8.8 \cdot 10^{+24} \lor \neg \left(v \leq 1.75 \cdot 10^{-68}\right):\\
\;\;\;\;-1.5 + \left(t_0 + \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right) \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;-4.5 + \left(3 + \left(t_0 - \left(r \cdot w\right) \cdot \left(\left(r \cdot w\right) \cdot 0.375\right)\right)\right)\\
\end{array}
\end{array}
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (or (<= v -8.8e+24) (not (<= v 1.75e-68)))
(+ -1.5 (+ t_0 (* (* (* r w) (* r w)) -0.25)))
(+ (+ 3.0 (- t_0 (* (* r w) (* r (* w 0.375))))) -4.5))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((v <= -8.8e+24) || !(v <= 1.75e-68)) {
tmp = -1.5 + (t_0 + (((r * w) * (r * w)) * -0.25));
} else {
tmp = (3.0 + (t_0 - ((r * w) * (r * (w * 0.375))))) + -4.5;
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (r * r)
if ((v <= (-8.8d+24)) .or. (.not. (v <= 1.75d-68))) then
tmp = (-1.5d0) + (t_0 + (((r * w) * (r * w)) * (-0.25d0)))
else
tmp = (3.0d0 + (t_0 - ((r * w) * (r * (w * 0.375d0))))) + (-4.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 ((v <= -8.8e+24) || !(v <= 1.75e-68)) {
tmp = -1.5 + (t_0 + (((r * w) * (r * w)) * -0.25));
} else {
tmp = (3.0 + (t_0 - ((r * w) * (r * (w * 0.375))))) + -4.5;
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if (v <= -8.8e+24) or not (v <= 1.75e-68): tmp = -1.5 + (t_0 + (((r * w) * (r * w)) * -0.25)) else: tmp = (3.0 + (t_0 - ((r * w) * (r * (w * 0.375))))) + -4.5 return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if ((v <= -8.8e+24) || !(v <= 1.75e-68)) tmp = Float64(-1.5 + Float64(t_0 + Float64(Float64(Float64(r * w) * Float64(r * w)) * -0.25))); else tmp = Float64(Float64(3.0 + Float64(t_0 - Float64(Float64(r * w) * Float64(r * Float64(w * 0.375))))) + -4.5); end return tmp end
function tmp_2 = code(v, w, r) t_0 = 2.0 / (r * r); tmp = 0.0; if ((v <= -8.8e+24) || ~((v <= 1.75e-68))) tmp = -1.5 + (t_0 + (((r * w) * (r * w)) * -0.25)); else tmp = (3.0 + (t_0 - ((r * w) * (r * (w * 0.375))))) + -4.5; 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, -8.8e+24], N[Not[LessEqual[v, 1.75e-68]], $MachinePrecision]], N[(-1.5 + N[(t$95$0 + N[(N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(3.0 + N[(t$95$0 - N[(N[(r * w), $MachinePrecision] * N[(r * N[(w * 0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -4.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;v \leq -8.8 \cdot 10^{+24} \lor \neg \left(v \leq 1.75 \cdot 10^{-68}\right):\\
\;\;\;\;-1.5 + \left(t_0 + \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right) \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;\left(3 + \left(t_0 - \left(r \cdot w\right) \cdot \left(r \cdot \left(w \cdot 0.375\right)\right)\right)\right) + -4.5\\
\end{array}
\end{array}
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (or (<= v -8.8e+24) (not (<= v 1.6e-68)))
(+ -1.5 (+ t_0 (* (* (* r w) (* r w)) -0.25)))
(+ -1.5 (+ t_0 (* -0.375 (/ (* r w) (/ (/ 1.0 r) w))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if ((v <= -8.8e+24) || !(v <= 1.6e-68)) {
tmp = -1.5 + (t_0 + (((r * w) * (r * w)) * -0.25));
} else {
tmp = -1.5 + (t_0 + (-0.375 * ((r * w) / ((1.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 <= (-8.8d+24)) .or. (.not. (v <= 1.6d-68))) then
tmp = (-1.5d0) + (t_0 + (((r * w) * (r * w)) * (-0.25d0)))
else
tmp = (-1.5d0) + (t_0 + ((-0.375d0) * ((r * w) / ((1.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 <= -8.8e+24) || !(v <= 1.6e-68)) {
tmp = -1.5 + (t_0 + (((r * w) * (r * w)) * -0.25));
} else {
tmp = -1.5 + (t_0 + (-0.375 * ((r * w) / ((1.0 / r) / w))));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if (v <= -8.8e+24) or not (v <= 1.6e-68): tmp = -1.5 + (t_0 + (((r * w) * (r * w)) * -0.25)) else: tmp = -1.5 + (t_0 + (-0.375 * ((r * w) / ((1.0 / r) / w)))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if ((v <= -8.8e+24) || !(v <= 1.6e-68)) tmp = Float64(-1.5 + Float64(t_0 + Float64(Float64(Float64(r * w) * Float64(r * w)) * -0.25))); else tmp = Float64(-1.5 + Float64(t_0 + Float64(-0.375 * Float64(Float64(r * w) / Float64(Float64(1.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 <= -8.8e+24) || ~((v <= 1.6e-68))) tmp = -1.5 + (t_0 + (((r * w) * (r * w)) * -0.25)); else tmp = -1.5 + (t_0 + (-0.375 * ((r * w) / ((1.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[Or[LessEqual[v, -8.8e+24], N[Not[LessEqual[v, 1.6e-68]], $MachinePrecision]], N[(-1.5 + N[(t$95$0 + N[(N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.5 + N[(t$95$0 + N[(-0.375 * N[(N[(r * w), $MachinePrecision] / N[(N[(1.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 -8.8 \cdot 10^{+24} \lor \neg \left(v \leq 1.6 \cdot 10^{-68}\right):\\
\;\;\;\;-1.5 + \left(t_0 + \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right) \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;-1.5 + \left(t_0 + -0.375 \cdot \frac{r \cdot w}{\frac{\frac{1}{r}}{w}}\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 -4e+25) (not (<= v 1.75e-68)))
(+ -1.5 (+ t_1 (* t_0 -0.25)))
(+ -1.5 (+ t_1 (* -0.375 t_0))))))
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 <= -4e+25) || !(v <= 1.75e-68)) {
tmp = -1.5 + (t_1 + (t_0 * -0.25));
} else {
tmp = -1.5 + (t_1 + (-0.375 * t_0));
}
return tmp;
}
real(8) function code(v, w, r)
real(8), intent (in) :: v
real(8), intent (in) :: w
real(8), intent (in) :: r
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (r * w) * (r * w)
t_1 = 2.0d0 / (r * r)
if ((v <= (-4d+25)) .or. (.not. (v <= 1.75d-68))) then
tmp = (-1.5d0) + (t_1 + (t_0 * (-0.25d0)))
else
tmp = (-1.5d0) + (t_1 + ((-0.375d0) * t_0))
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 <= -4e+25) || !(v <= 1.75e-68)) {
tmp = -1.5 + (t_1 + (t_0 * -0.25));
} else {
tmp = -1.5 + (t_1 + (-0.375 * t_0));
}
return tmp;
}
def code(v, w, r): t_0 = (r * w) * (r * w) t_1 = 2.0 / (r * r) tmp = 0 if (v <= -4e+25) or not (v <= 1.75e-68): tmp = -1.5 + (t_1 + (t_0 * -0.25)) else: tmp = -1.5 + (t_1 + (-0.375 * t_0)) 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 <= -4e+25) || !(v <= 1.75e-68)) tmp = Float64(-1.5 + Float64(t_1 + Float64(t_0 * -0.25))); else tmp = Float64(-1.5 + Float64(t_1 + Float64(-0.375 * t_0))); 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 <= -4e+25) || ~((v <= 1.75e-68))) tmp = -1.5 + (t_1 + (t_0 * -0.25)); else tmp = -1.5 + (t_1 + (-0.375 * t_0)); 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, -4e+25], N[Not[LessEqual[v, 1.75e-68]], $MachinePrecision]], N[(-1.5 + N[(t$95$1 + N[(t$95$0 * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.5 + N[(t$95$1 + N[(-0.375 * t$95$0), $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 -4 \cdot 10^{+25} \lor \neg \left(v \leq 1.75 \cdot 10^{-68}\right):\\
\;\;\;\;-1.5 + \left(t_1 + t_0 \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;-1.5 + \left(t_1 + -0.375 \cdot t_0\right)\\
\end{array}
\end{array}
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ 2.0 (* r r))))
(if (<= v -1e+25)
(+ -1.5 (+ t_0 (* -0.25 (* r (* w (* r w))))))
(+ -1.5 (+ t_0 (* -0.375 (* (* r w) (* r w))))))))
double code(double v, double w, double r) {
double t_0 = 2.0 / (r * r);
double tmp;
if (v <= -1e+25) {
tmp = -1.5 + (t_0 + (-0.25 * (r * (w * (r * w)))));
} else {
tmp = -1.5 + (t_0 + (-0.375 * ((r * 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 <= (-1d+25)) then
tmp = (-1.5d0) + (t_0 + ((-0.25d0) * (r * (w * (r * w)))))
else
tmp = (-1.5d0) + (t_0 + ((-0.375d0) * ((r * 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 <= -1e+25) {
tmp = -1.5 + (t_0 + (-0.25 * (r * (w * (r * w)))));
} else {
tmp = -1.5 + (t_0 + (-0.375 * ((r * w) * (r * w))));
}
return tmp;
}
def code(v, w, r): t_0 = 2.0 / (r * r) tmp = 0 if v <= -1e+25: tmp = -1.5 + (t_0 + (-0.25 * (r * (w * (r * w))))) else: tmp = -1.5 + (t_0 + (-0.375 * ((r * w) * (r * w)))) return tmp
function code(v, w, r) t_0 = Float64(2.0 / Float64(r * r)) tmp = 0.0 if (v <= -1e+25) tmp = Float64(-1.5 + Float64(t_0 + Float64(-0.25 * Float64(r * Float64(w * Float64(r * w)))))); else tmp = Float64(-1.5 + Float64(t_0 + Float64(-0.375 * Float64(Float64(r * 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 <= -1e+25) tmp = -1.5 + (t_0 + (-0.25 * (r * (w * (r * w))))); else tmp = -1.5 + (t_0 + (-0.375 * ((r * 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, -1e+25], N[(-1.5 + N[(t$95$0 + N[(-0.25 * N[(r * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.5 + N[(t$95$0 + N[(-0.375 * N[(N[(r * 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 \cdot 10^{+25}:\\
\;\;\;\;-1.5 + \left(t_0 + -0.25 \cdot \left(r \cdot \left(w \cdot \left(r \cdot w\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-1.5 + \left(t_0 + -0.375 \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)\right)\\
\end{array}
\end{array}
(FPCore (v w r) :precision binary64 (+ -1.5 (+ (/ 2.0 (* r r)) (* -0.375 (* (* r w) (* r w))))))
double code(double v, double w, double r) {
return -1.5 + ((2.0 / (r * r)) + (-0.375 * ((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 = (-1.5d0) + ((2.0d0 / (r * r)) + ((-0.375d0) * ((r * w) * (r * w))))
end function
public static double code(double v, double w, double r) {
return -1.5 + ((2.0 / (r * r)) + (-0.375 * ((r * w) * (r * w))));
}
def code(v, w, r): return -1.5 + ((2.0 / (r * r)) + (-0.375 * ((r * w) * (r * w))))
function code(v, w, r) return Float64(-1.5 + Float64(Float64(2.0 / Float64(r * r)) + Float64(-0.375 * Float64(Float64(r * w) * Float64(r * w))))) end
function tmp = code(v, w, r) tmp = -1.5 + ((2.0 / (r * r)) + (-0.375 * ((r * w) * (r * w)))); end
code[v_, w_, r_] := N[(-1.5 + N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + N[(-0.375 * N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-1.5 + \left(\frac{2}{r \cdot r} + -0.375 \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)\right)
\end{array}
herbie shell --seed 2023347
(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))