\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
\begin{array}{l}
t_0 := \frac{\frac{2}{r}}{r}\\
t_1 := \frac{\mathsf{fma}\left(v, -0.25, 0.375\right)}{1 - v}\\
\mathbf{if}\;r \leq -9.065172876585645 \cdot 10^{-21}:\\
\;\;\;\;t_0 - \mathsf{fma}\left(r, w \cdot \left(\left(r \cdot w\right) \cdot t_1\right), 1.5\right)\\
\mathbf{elif}\;r \leq 5.929669123769266 \cdot 10^{-41}:\\
\;\;\;\;\begin{array}{l}
t_2 := \sqrt{\mathsf{fma}\left(w \cdot \left(r \cdot r\right), \mathsf{fma}\left(v, -0.25, 0.375\right) \cdot \frac{w}{1 - v}, 1.5\right)}\\
t_0 - t_2 \cdot t_2
\end{array}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{r \cdot r} - \mathsf{fma}\left(r, \left(r \cdot w\right) \cdot \left(w \cdot t_1\right), 1.5\right)\\
\end{array}
(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))
(FPCore (v w r)
:precision binary64
(let* ((t_0 (/ (/ 2.0 r) r)) (t_1 (/ (fma v -0.25 0.375) (- 1.0 v))))
(if (<= r -9.065172876585645e-21)
(- t_0 (fma r (* w (* (* r w) t_1)) 1.5))
(if (<= r 5.929669123769266e-41)
(let* ((t_2
(sqrt
(fma
(* w (* r r))
(* (fma v -0.25 0.375) (/ w (- 1.0 v)))
1.5))))
(- t_0 (* t_2 t_2)))
(- (/ 2.0 (* r r)) (fma r (* (* r w) (* w t_1)) 1.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;
}
double code(double v, double w, double r) {
double t_0 = (2.0 / r) / r;
double t_1 = fma(v, -0.25, 0.375) / (1.0 - v);
double tmp;
if (r <= -9.065172876585645e-21) {
tmp = t_0 - fma(r, (w * ((r * w) * t_1)), 1.5);
} else if (r <= 5.929669123769266e-41) {
double t_2 = sqrt(fma((w * (r * r)), (fma(v, -0.25, 0.375) * (w / (1.0 - v))), 1.5));
tmp = t_0 - (t_2 * t_2);
} else {
tmp = (2.0 / (r * r)) - fma(r, ((r * w) * (w * t_1)), 1.5);
}
return tmp;
}



Bits error versus v



Bits error versus w



Bits error versus r
if r < -9.06517287658564543e-21Initial program 13.6
Simplified7.2
Applied associate-*r*_binary640.2
Applied associate-/r*_binary640.2
Taylor expanded in r around 0 9.6
Simplified0.2
if -9.06517287658564543e-21 < r < 5.92966912376926576e-41Initial program 11.4
Simplified10.4
Applied associate-*r*_binary645.8
Applied associate-/r*_binary645.8
Applied associate-*l*_binary645.8
Applied add-sqr-sqrt_binary645.8
Simplified5.8
Simplified0.3
if 5.92966912376926576e-41 < r Initial program 12.6
Simplified7.0
Applied associate-*r*_binary640.5
Applied associate-/r*_binary640.5
Applied associate-*l*_binary640.5
Applied *-un-lft-identity_binary640.5
Applied *-un-lft-identity_binary640.5
Applied *-un-lft-identity_binary640.5
Applied times-frac_binary640.5
Applied times-frac_binary640.5
Simplified0.5
Simplified0.5
Final simplification0.3
herbie shell --seed 2022081
(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))