Rosa's TurbineBenchmark

Percentage Accurate: 84.9% → 99.8%
Time: 6.1s
Alternatives: 8
Speedup: N/A×

Specification

?
\[\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.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;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(v, w, r)
use fmin_fmax_functions
    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:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 8 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 84.9% accurate, 1.0× speedup?

\[\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.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;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(v, w, r)
use fmin_fmax_functions
    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}

Alternative 1: 99.8% accurate, N/A× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot 0.125, \frac{{\left(r \cdot w\right)}^{2}}{1 - v}, 4.5\right) \end{array} \]
(FPCore (v w r)
 :precision binary64
 (-
  (fma (pow r -2.0) 2.0 3.0)
  (fma (* (fma -2.0 v 3.0) 0.125) (/ (pow (* r w) 2.0) (- 1.0 v)) 4.5)))
double code(double v, double w, double r) {
	return fma(pow(r, -2.0), 2.0, 3.0) - fma((fma(-2.0, v, 3.0) * 0.125), (pow((r * w), 2.0) / (1.0 - v)), 4.5);
}
function code(v, w, r)
	return Float64(fma((r ^ -2.0), 2.0, 3.0) - fma(Float64(fma(-2.0, v, 3.0) * 0.125), Float64((Float64(r * w) ^ 2.0) / Float64(1.0 - v)), 4.5))
end
code[v_, w_, r_] := N[(N[(N[Power[r, -2.0], $MachinePrecision] * 2.0 + 3.0), $MachinePrecision] - N[(N[(N[(-2.0 * v + 3.0), $MachinePrecision] * 0.125), $MachinePrecision] * N[(N[Power[N[(r * w), $MachinePrecision], 2.0], $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision] + 4.5), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot 0.125, \frac{{\left(r \cdot w\right)}^{2}}{1 - v}, 4.5\right)
\end{array}
Derivation
  1. Initial program 82.0%

    \[\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 \]
  2. Add Preprocessing
  3. Applied rewrites99.8%

    \[\leadsto \color{blue}{\mathsf{fma}\left({\left(r \cdot r\right)}^{-1}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot 0.125, \frac{{\left(r \cdot w\right)}^{1} \cdot {\left(r \cdot w\right)}^{1}}{1 - v}, 4.5\right)} \]
  4. Step-by-step derivation
    1. lift-pow.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{{\left(r \cdot r\right)}^{-1}}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{{\left(r \cdot w\right)}^{1} \cdot {\left(r \cdot w\right)}^{1}}{1 - v}, \frac{9}{2}\right) \]
    2. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left({\color{blue}{\left(r \cdot r\right)}}^{-1}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{{\left(r \cdot w\right)}^{1} \cdot {\left(r \cdot w\right)}^{1}}{1 - v}, \frac{9}{2}\right) \]
    3. pow2N/A

      \[\leadsto \mathsf{fma}\left({\color{blue}{\left({r}^{2}\right)}}^{-1}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{{\left(r \cdot w\right)}^{1} \cdot {\left(r \cdot w\right)}^{1}}{1 - v}, \frac{9}{2}\right) \]
    4. inv-powN/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{{r}^{2}}}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{{\left(r \cdot w\right)}^{1} \cdot {\left(r \cdot w\right)}^{1}}{1 - v}, \frac{9}{2}\right) \]
    5. pow-flipN/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{{r}^{\left(\mathsf{neg}\left(2\right)\right)}}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{{\left(r \cdot w\right)}^{1} \cdot {\left(r \cdot w\right)}^{1}}{1 - v}, \frac{9}{2}\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left({r}^{\color{blue}{-2}}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{{\left(r \cdot w\right)}^{1} \cdot {\left(r \cdot w\right)}^{1}}{1 - v}, \frac{9}{2}\right) \]
    7. lower-pow.f6499.9

      \[\leadsto \mathsf{fma}\left(\color{blue}{{r}^{-2}}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot 0.125, \frac{{\left(r \cdot w\right)}^{1} \cdot {\left(r \cdot w\right)}^{1}}{1 - v}, 4.5\right) \]
    8. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{\color{blue}{{\left(r \cdot w\right)}^{1} \cdot {\left(r \cdot w\right)}^{1}}}{1 - v}, \frac{9}{2}\right) \]
    9. pow2N/A

      \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{\color{blue}{{\left({\left(r \cdot w\right)}^{1}\right)}^{2}}}{1 - v}, \frac{9}{2}\right) \]
    10. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{{\left({\color{blue}{\left(r \cdot w\right)}}^{1}\right)}^{2}}{1 - v}, \frac{9}{2}\right) \]
    11. lift-pow.f64N/A

      \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{{\color{blue}{\left({\left(r \cdot w\right)}^{1}\right)}}^{2}}{1 - v}, \frac{9}{2}\right) \]
    12. unpow1N/A

      \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{{\color{blue}{\left(r \cdot w\right)}}^{2}}{1 - v}, \frac{9}{2}\right) \]
    13. lower-pow.f64N/A

      \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{\color{blue}{{\left(r \cdot w\right)}^{2}}}{1 - v}, \frac{9}{2}\right) \]
    14. lift-*.f6499.9

      \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot 0.125, \frac{{\color{blue}{\left(r \cdot w\right)}}^{2}}{1 - v}, 4.5\right) \]
  5. Applied rewrites99.9%

    \[\leadsto \color{blue}{\mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot 0.125, \frac{{\left(r \cdot w\right)}^{2}}{1 - v}, 4.5\right)} \]
  6. Add Preprocessing

Alternative 2: 98.6% accurate, N/A× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;r \leq 5 \cdot 10^{+148}:\\ \;\;\;\;\mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot 0.125, \frac{w \cdot \left(\left(w \cdot r\right) \cdot r\right)}{1 - v}, 4.5\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(w \cdot \left(w \cdot r\right)\right) \cdot r\right)}{1 - v}\right) + -1 \cdot 4.5\\ \end{array} \end{array} \]
(FPCore (v w r)
 :precision binary64
 (if (<= r 5e+148)
   (-
    (fma (pow r -2.0) 2.0 3.0)
    (fma (* (fma -2.0 v 3.0) 0.125) (/ (* w (* (* w r) r)) (- 1.0 v)) 4.5))
   (+
    (-
     (+ 3.0 (/ 2.0 (* r r)))
     (/ (* (* 0.125 (- 3.0 (* 2.0 v))) (* (* w (* w r)) r)) (- 1.0 v)))
    (* -1.0 4.5))))
double code(double v, double w, double r) {
	double tmp;
	if (r <= 5e+148) {
		tmp = fma(pow(r, -2.0), 2.0, 3.0) - fma((fma(-2.0, v, 3.0) * 0.125), ((w * ((w * r) * r)) / (1.0 - v)), 4.5);
	} else {
		tmp = ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * ((w * (w * r)) * r)) / (1.0 - v))) + (-1.0 * 4.5);
	}
	return tmp;
}
function code(v, w, r)
	tmp = 0.0
	if (r <= 5e+148)
		tmp = Float64(fma((r ^ -2.0), 2.0, 3.0) - fma(Float64(fma(-2.0, v, 3.0) * 0.125), Float64(Float64(w * Float64(Float64(w * r) * r)) / Float64(1.0 - v)), 4.5));
	else
		tmp = 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(w * Float64(w * r)) * r)) / Float64(1.0 - v))) + Float64(-1.0 * 4.5));
	end
	return tmp
end
code[v_, w_, r_] := If[LessEqual[r, 5e+148], N[(N[(N[Power[r, -2.0], $MachinePrecision] * 2.0 + 3.0), $MachinePrecision] - N[(N[(N[(-2.0 * v + 3.0), $MachinePrecision] * 0.125), $MachinePrecision] * N[(N[(w * N[(N[(w * r), $MachinePrecision] * r), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision] + 4.5), $MachinePrecision]), $MachinePrecision], 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[(w * N[(w * r), $MachinePrecision]), $MachinePrecision] * r), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 * 4.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;r \leq 5 \cdot 10^{+148}:\\
\;\;\;\;\mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot 0.125, \frac{w \cdot \left(\left(w \cdot r\right) \cdot r\right)}{1 - v}, 4.5\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(w \cdot \left(w \cdot r\right)\right) \cdot r\right)}{1 - v}\right) + -1 \cdot 4.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if r < 5.00000000000000024e148

    1. Initial program 80.3%

      \[\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 \]
    2. Add Preprocessing
    3. Applied rewrites99.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left({\left(r \cdot r\right)}^{-1}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot 0.125, \frac{{\left(r \cdot w\right)}^{1} \cdot {\left(r \cdot w\right)}^{1}}{1 - v}, 4.5\right)} \]
    4. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{{\left(r \cdot r\right)}^{-1}}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{{\left(r \cdot w\right)}^{1} \cdot {\left(r \cdot w\right)}^{1}}{1 - v}, \frac{9}{2}\right) \]
      2. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left({\color{blue}{\left(r \cdot r\right)}}^{-1}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{{\left(r \cdot w\right)}^{1} \cdot {\left(r \cdot w\right)}^{1}}{1 - v}, \frac{9}{2}\right) \]
      3. pow2N/A

        \[\leadsto \mathsf{fma}\left({\color{blue}{\left({r}^{2}\right)}}^{-1}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{{\left(r \cdot w\right)}^{1} \cdot {\left(r \cdot w\right)}^{1}}{1 - v}, \frac{9}{2}\right) \]
      4. inv-powN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{{r}^{2}}}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{{\left(r \cdot w\right)}^{1} \cdot {\left(r \cdot w\right)}^{1}}{1 - v}, \frac{9}{2}\right) \]
      5. pow-flipN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{{r}^{\left(\mathsf{neg}\left(2\right)\right)}}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{{\left(r \cdot w\right)}^{1} \cdot {\left(r \cdot w\right)}^{1}}{1 - v}, \frac{9}{2}\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left({r}^{\color{blue}{-2}}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{{\left(r \cdot w\right)}^{1} \cdot {\left(r \cdot w\right)}^{1}}{1 - v}, \frac{9}{2}\right) \]
      7. lower-pow.f6499.9

        \[\leadsto \mathsf{fma}\left(\color{blue}{{r}^{-2}}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot 0.125, \frac{{\left(r \cdot w\right)}^{1} \cdot {\left(r \cdot w\right)}^{1}}{1 - v}, 4.5\right) \]
      8. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{\color{blue}{{\left(r \cdot w\right)}^{1} \cdot {\left(r \cdot w\right)}^{1}}}{1 - v}, \frac{9}{2}\right) \]
      9. pow2N/A

        \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{\color{blue}{{\left({\left(r \cdot w\right)}^{1}\right)}^{2}}}{1 - v}, \frac{9}{2}\right) \]
      10. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{{\left({\color{blue}{\left(r \cdot w\right)}}^{1}\right)}^{2}}{1 - v}, \frac{9}{2}\right) \]
      11. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{{\color{blue}{\left({\left(r \cdot w\right)}^{1}\right)}}^{2}}{1 - v}, \frac{9}{2}\right) \]
      12. unpow1N/A

        \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{{\color{blue}{\left(r \cdot w\right)}}^{2}}{1 - v}, \frac{9}{2}\right) \]
      13. lower-pow.f64N/A

        \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{\color{blue}{{\left(r \cdot w\right)}^{2}}}{1 - v}, \frac{9}{2}\right) \]
      14. lift-*.f6499.9

        \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot 0.125, \frac{{\color{blue}{\left(r \cdot w\right)}}^{2}}{1 - v}, 4.5\right) \]
    5. Applied rewrites99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot 0.125, \frac{{\left(r \cdot w\right)}^{2}}{1 - v}, 4.5\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{{\color{blue}{\left(r \cdot w\right)}}^{2}}{1 - v}, \frac{9}{2}\right) \]
      2. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{\color{blue}{{\left(r \cdot w\right)}^{2}}}{1 - v}, \frac{9}{2}\right) \]
      3. unpow-prod-downN/A

        \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{\color{blue}{{r}^{2} \cdot {w}^{2}}}{1 - v}, \frac{9}{2}\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{\color{blue}{{w}^{2} \cdot {r}^{2}}}{1 - v}, \frac{9}{2}\right) \]
      5. pow2N/A

        \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{{w}^{2} \cdot \color{blue}{\left(r \cdot r\right)}}{1 - v}, \frac{9}{2}\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{\color{blue}{\left({w}^{2} \cdot r\right) \cdot r}}{1 - v}, \frac{9}{2}\right) \]
      7. pow2N/A

        \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{\left(\color{blue}{\left(w \cdot w\right)} \cdot r\right) \cdot r}{1 - v}, \frac{9}{2}\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{\color{blue}{\left(w \cdot \left(w \cdot r\right)\right)} \cdot r}{1 - v}, \frac{9}{2}\right) \]
      9. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{\left(w \cdot \color{blue}{\left(w \cdot r\right)}\right) \cdot r}{1 - v}, \frac{9}{2}\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{\color{blue}{w \cdot \left(\left(w \cdot r\right) \cdot r\right)}}{1 - v}, \frac{9}{2}\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{\color{blue}{w \cdot \left(\left(w \cdot r\right) \cdot r\right)}}{1 - v}, \frac{9}{2}\right) \]
      12. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{w \cdot \left(\color{blue}{\left(w \cdot r\right)} \cdot r\right)}{1 - v}, \frac{9}{2}\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{w \cdot \left(\color{blue}{\left(r \cdot w\right)} \cdot r\right)}{1 - v}, \frac{9}{2}\right) \]
      14. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{w \cdot \color{blue}{\left(\left(r \cdot w\right) \cdot r\right)}}{1 - v}, \frac{9}{2}\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \frac{1}{8}, \frac{w \cdot \left(\color{blue}{\left(w \cdot r\right)} \cdot r\right)}{1 - v}, \frac{9}{2}\right) \]
      16. lift-*.f6498.2

        \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot 0.125, \frac{w \cdot \left(\color{blue}{\left(w \cdot r\right)} \cdot r\right)}{1 - v}, 4.5\right) \]
    7. Applied rewrites98.2%

      \[\leadsto \mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot 0.125, \frac{\color{blue}{w \cdot \left(\left(w \cdot r\right) \cdot r\right)}}{1 - v}, 4.5\right) \]

    if 5.00000000000000024e148 < r

    1. Initial program 93.2%

      \[\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 \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\color{blue}{\left(\left(w \cdot w\right) \cdot r\right)} \cdot r\right)}{1 - v}\right) - \frac{9}{2} \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\color{blue}{\left(w \cdot w\right)} \cdot r\right) \cdot r\right)}{1 - v}\right) - \frac{9}{2} \]
      3. associate-*l*N/A

        \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\color{blue}{\left(w \cdot \left(w \cdot r\right)\right)} \cdot r\right)}{1 - v}\right) - \frac{9}{2} \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\color{blue}{\left(w \cdot \left(w \cdot r\right)\right)} \cdot r\right)}{1 - v}\right) - \frac{9}{2} \]
      5. lower-*.f6497.1

        \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(w \cdot \color{blue}{\left(w \cdot r\right)}\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
    4. Applied rewrites97.1%

      \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\color{blue}{\left(w \cdot \left(w \cdot r\right)\right)} \cdot r\right)}{1 - v}\right) - 4.5 \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;r \leq 5 \cdot 10^{+148}:\\ \;\;\;\;\mathsf{fma}\left({r}^{-2}, 2, 3\right) - \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot 0.125, \frac{w \cdot \left(\left(w \cdot r\right) \cdot r\right)}{1 - v}, 4.5\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(w \cdot \left(w \cdot r\right)\right) \cdot r\right)}{1 - v}\right) + -1 \cdot 4.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 98.6% accurate, N/A× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 3 + \frac{2}{r \cdot r}\\ t_1 := 0.125 \cdot \left(3 - 2 \cdot v\right)\\ t_2 := \left(t\_0 - \frac{t\_1 \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) + -1 \cdot 4.5\\ t_3 := 2 \cdot {r}^{-2} - \left(1.5 + 0.25 \cdot {\left(r \cdot w\right)}^{2}\right)\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq -1:\\ \;\;\;\;\left(t\_0 - \frac{t\_1 \cdot \left(\left(w \cdot \left(w \cdot r\right)\right) \cdot r\right)}{1 - v}\right) + -1 \cdot 4.5\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (v w r)
 :precision binary64
 (let* ((t_0 (+ 3.0 (/ 2.0 (* r r))))
        (t_1 (* 0.125 (- 3.0 (* 2.0 v))))
        (t_2
         (+ (- t_0 (/ (* t_1 (* (* (* w w) r) r)) (- 1.0 v))) (* -1.0 4.5)))
        (t_3 (- (* 2.0 (pow r -2.0)) (+ 1.5 (* 0.25 (pow (* r w) 2.0))))))
   (if (<= t_2 (- INFINITY))
     t_3
     (if (<= t_2 -1.0)
       (+ (- t_0 (/ (* t_1 (* (* w (* w r)) r)) (- 1.0 v))) (* -1.0 4.5))
       t_3))))
double code(double v, double w, double r) {
	double t_0 = 3.0 + (2.0 / (r * r));
	double t_1 = 0.125 * (3.0 - (2.0 * v));
	double t_2 = (t_0 - ((t_1 * (((w * w) * r) * r)) / (1.0 - v))) + (-1.0 * 4.5);
	double t_3 = (2.0 * pow(r, -2.0)) - (1.5 + (0.25 * pow((r * w), 2.0)));
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = t_3;
	} else if (t_2 <= -1.0) {
		tmp = (t_0 - ((t_1 * ((w * (w * r)) * r)) / (1.0 - v))) + (-1.0 * 4.5);
	} else {
		tmp = t_3;
	}
	return tmp;
}
public static double code(double v, double w, double r) {
	double t_0 = 3.0 + (2.0 / (r * r));
	double t_1 = 0.125 * (3.0 - (2.0 * v));
	double t_2 = (t_0 - ((t_1 * (((w * w) * r) * r)) / (1.0 - v))) + (-1.0 * 4.5);
	double t_3 = (2.0 * Math.pow(r, -2.0)) - (1.5 + (0.25 * Math.pow((r * w), 2.0)));
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = t_3;
	} else if (t_2 <= -1.0) {
		tmp = (t_0 - ((t_1 * ((w * (w * r)) * r)) / (1.0 - v))) + (-1.0 * 4.5);
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(v, w, r):
	t_0 = 3.0 + (2.0 / (r * r))
	t_1 = 0.125 * (3.0 - (2.0 * v))
	t_2 = (t_0 - ((t_1 * (((w * w) * r) * r)) / (1.0 - v))) + (-1.0 * 4.5)
	t_3 = (2.0 * math.pow(r, -2.0)) - (1.5 + (0.25 * math.pow((r * w), 2.0)))
	tmp = 0
	if t_2 <= -math.inf:
		tmp = t_3
	elif t_2 <= -1.0:
		tmp = (t_0 - ((t_1 * ((w * (w * r)) * r)) / (1.0 - v))) + (-1.0 * 4.5)
	else:
		tmp = t_3
	return tmp
function code(v, w, r)
	t_0 = Float64(3.0 + Float64(2.0 / Float64(r * r)))
	t_1 = Float64(0.125 * Float64(3.0 - Float64(2.0 * v)))
	t_2 = Float64(Float64(t_0 - Float64(Float64(t_1 * Float64(Float64(Float64(w * w) * r) * r)) / Float64(1.0 - v))) + Float64(-1.0 * 4.5))
	t_3 = Float64(Float64(2.0 * (r ^ -2.0)) - Float64(1.5 + Float64(0.25 * (Float64(r * w) ^ 2.0))))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = t_3;
	elseif (t_2 <= -1.0)
		tmp = Float64(Float64(t_0 - Float64(Float64(t_1 * Float64(Float64(w * Float64(w * r)) * r)) / Float64(1.0 - v))) + Float64(-1.0 * 4.5));
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(v, w, r)
	t_0 = 3.0 + (2.0 / (r * r));
	t_1 = 0.125 * (3.0 - (2.0 * v));
	t_2 = (t_0 - ((t_1 * (((w * w) * r) * r)) / (1.0 - v))) + (-1.0 * 4.5);
	t_3 = (2.0 * (r ^ -2.0)) - (1.5 + (0.25 * ((r * w) ^ 2.0)));
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = t_3;
	elseif (t_2 <= -1.0)
		tmp = (t_0 - ((t_1 * ((w * (w * r)) * r)) / (1.0 - v))) + (-1.0 * 4.5);
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[v_, w_, r_] := Block[{t$95$0 = N[(3.0 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.125 * N[(3.0 - N[(2.0 * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$0 - N[(N[(t$95$1 * N[(N[(N[(w * w), $MachinePrecision] * r), $MachinePrecision] * r), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 * 4.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(2.0 * N[Power[r, -2.0], $MachinePrecision]), $MachinePrecision] - N[(1.5 + N[(0.25 * N[Power[N[(r * w), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, -1.0], N[(N[(t$95$0 - N[(N[(t$95$1 * N[(N[(w * N[(w * r), $MachinePrecision]), $MachinePrecision] * r), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 * 4.5), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 3 + \frac{2}{r \cdot r}\\
t_1 := 0.125 \cdot \left(3 - 2 \cdot v\right)\\
t_2 := \left(t\_0 - \frac{t\_1 \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) + -1 \cdot 4.5\\
t_3 := 2 \cdot {r}^{-2} - \left(1.5 + 0.25 \cdot {\left(r \cdot w\right)}^{2}\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_2 \leq -1:\\
\;\;\;\;\left(t\_0 - \frac{t\_1 \cdot \left(\left(w \cdot \left(w \cdot r\right)\right) \cdot r\right)}{1 - v}\right) + -1 \cdot 4.5\\

\mathbf{else}:\\
\;\;\;\;t\_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (-.f64 (+.f64 #s(literal 3 binary64) (/.f64 #s(literal 2 binary64) (*.f64 r r))) (/.f64 (*.f64 (*.f64 #s(literal 1/8 binary64) (-.f64 #s(literal 3 binary64) (*.f64 #s(literal 2 binary64) v))) (*.f64 (*.f64 (*.f64 w w) r) r)) (-.f64 #s(literal 1 binary64) v))) #s(literal 9/2 binary64)) < -inf.0 or -1 < (-.f64 (-.f64 (+.f64 #s(literal 3 binary64) (/.f64 #s(literal 2 binary64) (*.f64 r r))) (/.f64 (*.f64 (*.f64 #s(literal 1/8 binary64) (-.f64 #s(literal 3 binary64) (*.f64 #s(literal 2 binary64) v))) (*.f64 (*.f64 (*.f64 w w) r) r)) (-.f64 #s(literal 1 binary64) v))) #s(literal 9/2 binary64))

    1. Initial program 79.6%

      \[\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 \]
    2. Add Preprocessing
    3. Taylor expanded in w around inf

      \[\leadsto \color{blue}{{w}^{2} \cdot \left(\frac{2}{{r}^{2} \cdot {w}^{2}} - \left(\frac{1}{8} \cdot \frac{{r}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(\frac{2}{{r}^{2} \cdot {w}^{2}} - \left(\frac{1}{8} \cdot \frac{{r}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \color{blue}{{w}^{2}} \]
      2. lower-*.f64N/A

        \[\leadsto \left(\frac{2}{{r}^{2} \cdot {w}^{2}} - \left(\frac{1}{8} \cdot \frac{{r}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \color{blue}{{w}^{2}} \]
    5. Applied rewrites73.2%

      \[\leadsto \color{blue}{\left(\frac{{\left(r \cdot r\right)}^{-1}}{w} \cdot \frac{2}{w} - \mathsf{fma}\left(\frac{\left(r \cdot r\right) \cdot \mathsf{fma}\left(-2, v, 3\right)}{1 - v}, 0.125, {\left(w \cdot w\right)}^{-1} \cdot 1.5\right)\right) \cdot \left(w \cdot w\right)} \]
    6. Taylor expanded in v around inf

      \[\leadsto \color{blue}{2 \cdot \frac{1}{{r}^{2}} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)} \]
    7. Step-by-step derivation
      1. lower--.f64N/A

        \[\leadsto 2 \cdot \frac{1}{{r}^{2}} - \color{blue}{\left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)} \]
      2. inv-powN/A

        \[\leadsto 2 \cdot {\left({r}^{2}\right)}^{-1} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
      3. pow2N/A

        \[\leadsto 2 \cdot {\left(r \cdot r\right)}^{-1} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
      4. lift-*.f64N/A

        \[\leadsto 2 \cdot {\left(r \cdot r\right)}^{-1} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
      5. lift-pow.f64N/A

        \[\leadsto 2 \cdot {\left(r \cdot r\right)}^{-1} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto 2 \cdot {\left(r \cdot r\right)}^{-1} - \left(\color{blue}{\frac{3}{2}} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
      7. lift-pow.f64N/A

        \[\leadsto 2 \cdot {\left(r \cdot r\right)}^{-1} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
      8. lift-*.f64N/A

        \[\leadsto 2 \cdot {\left(r \cdot r\right)}^{-1} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
      9. pow2N/A

        \[\leadsto 2 \cdot {\left({r}^{2}\right)}^{-1} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
      10. inv-powN/A

        \[\leadsto 2 \cdot \frac{1}{{r}^{2}} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
      11. pow-flipN/A

        \[\leadsto 2 \cdot {r}^{\left(\mathsf{neg}\left(2\right)\right)} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto 2 \cdot {r}^{-2} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
      13. lower-pow.f64N/A

        \[\leadsto 2 \cdot {r}^{-2} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
      14. lower-+.f64N/A

        \[\leadsto 2 \cdot {r}^{-2} - \left(\frac{3}{2} + \color{blue}{\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)}\right) \]
      15. lower-*.f64N/A

        \[\leadsto 2 \cdot {r}^{-2} - \left(\frac{3}{2} + \frac{1}{4} \cdot \color{blue}{\left({r}^{2} \cdot {w}^{2}\right)}\right) \]
      16. pow-prod-downN/A

        \[\leadsto 2 \cdot {r}^{-2} - \left(\frac{3}{2} + \frac{1}{4} \cdot {\left(r \cdot w\right)}^{\color{blue}{2}}\right) \]
      17. lower-pow.f64N/A

        \[\leadsto 2 \cdot {r}^{-2} - \left(\frac{3}{2} + \frac{1}{4} \cdot {\left(r \cdot w\right)}^{\color{blue}{2}}\right) \]
      18. lift-*.f6499.1

        \[\leadsto 2 \cdot {r}^{-2} - \left(1.5 + 0.25 \cdot {\left(r \cdot w\right)}^{2}\right) \]
    8. Applied rewrites99.1%

      \[\leadsto \color{blue}{2 \cdot {r}^{-2} - \left(1.5 + 0.25 \cdot {\left(r \cdot w\right)}^{2}\right)} \]

    if -inf.0 < (-.f64 (-.f64 (+.f64 #s(literal 3 binary64) (/.f64 #s(literal 2 binary64) (*.f64 r r))) (/.f64 (*.f64 (*.f64 #s(literal 1/8 binary64) (-.f64 #s(literal 3 binary64) (*.f64 #s(literal 2 binary64) v))) (*.f64 (*.f64 (*.f64 w w) r) r)) (-.f64 #s(literal 1 binary64) v))) #s(literal 9/2 binary64)) < -1

    1. Initial program 89.1%

      \[\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 \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\color{blue}{\left(\left(w \cdot w\right) \cdot r\right)} \cdot r\right)}{1 - v}\right) - \frac{9}{2} \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\color{blue}{\left(w \cdot w\right)} \cdot r\right) \cdot r\right)}{1 - v}\right) - \frac{9}{2} \]
      3. associate-*l*N/A

        \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\color{blue}{\left(w \cdot \left(w \cdot r\right)\right)} \cdot r\right)}{1 - v}\right) - \frac{9}{2} \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\color{blue}{\left(w \cdot \left(w \cdot r\right)\right)} \cdot r\right)}{1 - v}\right) - \frac{9}{2} \]
      5. lower-*.f6499.8

        \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(w \cdot \color{blue}{\left(w \cdot r\right)}\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
    4. Applied rewrites99.8%

      \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\color{blue}{\left(w \cdot \left(w \cdot r\right)\right)} \cdot r\right)}{1 - v}\right) - 4.5 \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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) + -1 \cdot 4.5 \leq -\infty:\\ \;\;\;\;2 \cdot {r}^{-2} - \left(1.5 + 0.25 \cdot {\left(r \cdot w\right)}^{2}\right)\\ \mathbf{elif}\;\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) + -1 \cdot 4.5 \leq -1:\\ \;\;\;\;\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(w \cdot \left(w \cdot r\right)\right) \cdot r\right)}{1 - v}\right) + -1 \cdot 4.5\\ \mathbf{else}:\\ \;\;\;\;2 \cdot {r}^{-2} - \left(1.5 + 0.25 \cdot {\left(r \cdot w\right)}^{2}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 97.7% accurate, N/A× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.125 \cdot \left(3 - 2 \cdot v\right)\\ t_1 := 3 + \frac{2}{r \cdot r}\\ t_2 := \left(t\_1 - \frac{t\_0 \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) + -1 \cdot 4.5\\ \mathbf{if}\;t\_2 \leq -\infty \lor \neg \left(t\_2 \leq -1\right):\\ \;\;\;\;2 \cdot {r}^{-2} - \left(1.5 + 0.25 \cdot {\left(r \cdot w\right)}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t\_1 - \frac{t\_0 \cdot \left(\left(w \cdot \left(w \cdot r\right)\right) \cdot r\right)}{v \cdot \left({v}^{-1} - 1\right)}\right) - 4.5\\ \end{array} \end{array} \]
(FPCore (v w r)
 :precision binary64
 (let* ((t_0 (* 0.125 (- 3.0 (* 2.0 v))))
        (t_1 (+ 3.0 (/ 2.0 (* r r))))
        (t_2
         (+ (- t_1 (/ (* t_0 (* (* (* w w) r) r)) (- 1.0 v))) (* -1.0 4.5))))
   (if (or (<= t_2 (- INFINITY)) (not (<= t_2 -1.0)))
     (- (* 2.0 (pow r -2.0)) (+ 1.5 (* 0.25 (pow (* r w) 2.0))))
     (-
      (- t_1 (/ (* t_0 (* (* w (* w r)) r)) (* v (- (pow v -1.0) 1.0))))
      4.5))))
double code(double v, double w, double r) {
	double t_0 = 0.125 * (3.0 - (2.0 * v));
	double t_1 = 3.0 + (2.0 / (r * r));
	double t_2 = (t_1 - ((t_0 * (((w * w) * r) * r)) / (1.0 - v))) + (-1.0 * 4.5);
	double tmp;
	if ((t_2 <= -((double) INFINITY)) || !(t_2 <= -1.0)) {
		tmp = (2.0 * pow(r, -2.0)) - (1.5 + (0.25 * pow((r * w), 2.0)));
	} else {
		tmp = (t_1 - ((t_0 * ((w * (w * r)) * r)) / (v * (pow(v, -1.0) - 1.0)))) - 4.5;
	}
	return tmp;
}
public static double code(double v, double w, double r) {
	double t_0 = 0.125 * (3.0 - (2.0 * v));
	double t_1 = 3.0 + (2.0 / (r * r));
	double t_2 = (t_1 - ((t_0 * (((w * w) * r) * r)) / (1.0 - v))) + (-1.0 * 4.5);
	double tmp;
	if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= -1.0)) {
		tmp = (2.0 * Math.pow(r, -2.0)) - (1.5 + (0.25 * Math.pow((r * w), 2.0)));
	} else {
		tmp = (t_1 - ((t_0 * ((w * (w * r)) * r)) / (v * (Math.pow(v, -1.0) - 1.0)))) - 4.5;
	}
	return tmp;
}
def code(v, w, r):
	t_0 = 0.125 * (3.0 - (2.0 * v))
	t_1 = 3.0 + (2.0 / (r * r))
	t_2 = (t_1 - ((t_0 * (((w * w) * r) * r)) / (1.0 - v))) + (-1.0 * 4.5)
	tmp = 0
	if (t_2 <= -math.inf) or not (t_2 <= -1.0):
		tmp = (2.0 * math.pow(r, -2.0)) - (1.5 + (0.25 * math.pow((r * w), 2.0)))
	else:
		tmp = (t_1 - ((t_0 * ((w * (w * r)) * r)) / (v * (math.pow(v, -1.0) - 1.0)))) - 4.5
	return tmp
function code(v, w, r)
	t_0 = Float64(0.125 * Float64(3.0 - Float64(2.0 * v)))
	t_1 = Float64(3.0 + Float64(2.0 / Float64(r * r)))
	t_2 = Float64(Float64(t_1 - Float64(Float64(t_0 * Float64(Float64(Float64(w * w) * r) * r)) / Float64(1.0 - v))) + Float64(-1.0 * 4.5))
	tmp = 0.0
	if ((t_2 <= Float64(-Inf)) || !(t_2 <= -1.0))
		tmp = Float64(Float64(2.0 * (r ^ -2.0)) - Float64(1.5 + Float64(0.25 * (Float64(r * w) ^ 2.0))));
	else
		tmp = Float64(Float64(t_1 - Float64(Float64(t_0 * Float64(Float64(w * Float64(w * r)) * r)) / Float64(v * Float64((v ^ -1.0) - 1.0)))) - 4.5);
	end
	return tmp
end
function tmp_2 = code(v, w, r)
	t_0 = 0.125 * (3.0 - (2.0 * v));
	t_1 = 3.0 + (2.0 / (r * r));
	t_2 = (t_1 - ((t_0 * (((w * w) * r) * r)) / (1.0 - v))) + (-1.0 * 4.5);
	tmp = 0.0;
	if ((t_2 <= -Inf) || ~((t_2 <= -1.0)))
		tmp = (2.0 * (r ^ -2.0)) - (1.5 + (0.25 * ((r * w) ^ 2.0)));
	else
		tmp = (t_1 - ((t_0 * ((w * (w * r)) * r)) / (v * ((v ^ -1.0) - 1.0)))) - 4.5;
	end
	tmp_2 = tmp;
end
code[v_, w_, r_] := Block[{t$95$0 = N[(0.125 * N[(3.0 - N[(2.0 * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 - N[(N[(t$95$0 * N[(N[(N[(w * w), $MachinePrecision] * r), $MachinePrecision] * r), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 * 4.5), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, -1.0]], $MachinePrecision]], N[(N[(2.0 * N[Power[r, -2.0], $MachinePrecision]), $MachinePrecision] - N[(1.5 + N[(0.25 * N[Power[N[(r * w), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[(N[(t$95$0 * N[(N[(w * N[(w * r), $MachinePrecision]), $MachinePrecision] * r), $MachinePrecision]), $MachinePrecision] / N[(v * N[(N[Power[v, -1.0], $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.125 \cdot \left(3 - 2 \cdot v\right)\\
t_1 := 3 + \frac{2}{r \cdot r}\\
t_2 := \left(t\_1 - \frac{t\_0 \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) + -1 \cdot 4.5\\
\mathbf{if}\;t\_2 \leq -\infty \lor \neg \left(t\_2 \leq -1\right):\\
\;\;\;\;2 \cdot {r}^{-2} - \left(1.5 + 0.25 \cdot {\left(r \cdot w\right)}^{2}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(t\_1 - \frac{t\_0 \cdot \left(\left(w \cdot \left(w \cdot r\right)\right) \cdot r\right)}{v \cdot \left({v}^{-1} - 1\right)}\right) - 4.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (-.f64 (+.f64 #s(literal 3 binary64) (/.f64 #s(literal 2 binary64) (*.f64 r r))) (/.f64 (*.f64 (*.f64 #s(literal 1/8 binary64) (-.f64 #s(literal 3 binary64) (*.f64 #s(literal 2 binary64) v))) (*.f64 (*.f64 (*.f64 w w) r) r)) (-.f64 #s(literal 1 binary64) v))) #s(literal 9/2 binary64)) < -inf.0 or -1 < (-.f64 (-.f64 (+.f64 #s(literal 3 binary64) (/.f64 #s(literal 2 binary64) (*.f64 r r))) (/.f64 (*.f64 (*.f64 #s(literal 1/8 binary64) (-.f64 #s(literal 3 binary64) (*.f64 #s(literal 2 binary64) v))) (*.f64 (*.f64 (*.f64 w w) r) r)) (-.f64 #s(literal 1 binary64) v))) #s(literal 9/2 binary64))

    1. Initial program 79.6%

      \[\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 \]
    2. Add Preprocessing
    3. Taylor expanded in w around inf

      \[\leadsto \color{blue}{{w}^{2} \cdot \left(\frac{2}{{r}^{2} \cdot {w}^{2}} - \left(\frac{1}{8} \cdot \frac{{r}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(\frac{2}{{r}^{2} \cdot {w}^{2}} - \left(\frac{1}{8} \cdot \frac{{r}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \color{blue}{{w}^{2}} \]
      2. lower-*.f64N/A

        \[\leadsto \left(\frac{2}{{r}^{2} \cdot {w}^{2}} - \left(\frac{1}{8} \cdot \frac{{r}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \color{blue}{{w}^{2}} \]
    5. Applied rewrites73.2%

      \[\leadsto \color{blue}{\left(\frac{{\left(r \cdot r\right)}^{-1}}{w} \cdot \frac{2}{w} - \mathsf{fma}\left(\frac{\left(r \cdot r\right) \cdot \mathsf{fma}\left(-2, v, 3\right)}{1 - v}, 0.125, {\left(w \cdot w\right)}^{-1} \cdot 1.5\right)\right) \cdot \left(w \cdot w\right)} \]
    6. Taylor expanded in v around inf

      \[\leadsto \color{blue}{2 \cdot \frac{1}{{r}^{2}} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)} \]
    7. Step-by-step derivation
      1. lower--.f64N/A

        \[\leadsto 2 \cdot \frac{1}{{r}^{2}} - \color{blue}{\left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)} \]
      2. inv-powN/A

        \[\leadsto 2 \cdot {\left({r}^{2}\right)}^{-1} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
      3. pow2N/A

        \[\leadsto 2 \cdot {\left(r \cdot r\right)}^{-1} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
      4. lift-*.f64N/A

        \[\leadsto 2 \cdot {\left(r \cdot r\right)}^{-1} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
      5. lift-pow.f64N/A

        \[\leadsto 2 \cdot {\left(r \cdot r\right)}^{-1} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto 2 \cdot {\left(r \cdot r\right)}^{-1} - \left(\color{blue}{\frac{3}{2}} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
      7. lift-pow.f64N/A

        \[\leadsto 2 \cdot {\left(r \cdot r\right)}^{-1} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
      8. lift-*.f64N/A

        \[\leadsto 2 \cdot {\left(r \cdot r\right)}^{-1} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
      9. pow2N/A

        \[\leadsto 2 \cdot {\left({r}^{2}\right)}^{-1} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
      10. inv-powN/A

        \[\leadsto 2 \cdot \frac{1}{{r}^{2}} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
      11. pow-flipN/A

        \[\leadsto 2 \cdot {r}^{\left(\mathsf{neg}\left(2\right)\right)} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto 2 \cdot {r}^{-2} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
      13. lower-pow.f64N/A

        \[\leadsto 2 \cdot {r}^{-2} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
      14. lower-+.f64N/A

        \[\leadsto 2 \cdot {r}^{-2} - \left(\frac{3}{2} + \color{blue}{\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)}\right) \]
      15. lower-*.f64N/A

        \[\leadsto 2 \cdot {r}^{-2} - \left(\frac{3}{2} + \frac{1}{4} \cdot \color{blue}{\left({r}^{2} \cdot {w}^{2}\right)}\right) \]
      16. pow-prod-downN/A

        \[\leadsto 2 \cdot {r}^{-2} - \left(\frac{3}{2} + \frac{1}{4} \cdot {\left(r \cdot w\right)}^{\color{blue}{2}}\right) \]
      17. lower-pow.f64N/A

        \[\leadsto 2 \cdot {r}^{-2} - \left(\frac{3}{2} + \frac{1}{4} \cdot {\left(r \cdot w\right)}^{\color{blue}{2}}\right) \]
      18. lift-*.f6499.1

        \[\leadsto 2 \cdot {r}^{-2} - \left(1.5 + 0.25 \cdot {\left(r \cdot w\right)}^{2}\right) \]
    8. Applied rewrites99.1%

      \[\leadsto \color{blue}{2 \cdot {r}^{-2} - \left(1.5 + 0.25 \cdot {\left(r \cdot w\right)}^{2}\right)} \]

    if -inf.0 < (-.f64 (-.f64 (+.f64 #s(literal 3 binary64) (/.f64 #s(literal 2 binary64) (*.f64 r r))) (/.f64 (*.f64 (*.f64 #s(literal 1/8 binary64) (-.f64 #s(literal 3 binary64) (*.f64 #s(literal 2 binary64) v))) (*.f64 (*.f64 (*.f64 w w) r) r)) (-.f64 #s(literal 1 binary64) v))) #s(literal 9/2 binary64)) < -1

    1. Initial program 89.1%

      \[\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 \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\color{blue}{\left(\left(w \cdot w\right) \cdot r\right)} \cdot r\right)}{1 - v}\right) - \frac{9}{2} \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\color{blue}{\left(w \cdot w\right)} \cdot r\right) \cdot r\right)}{1 - v}\right) - \frac{9}{2} \]
      3. associate-*l*N/A

        \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\color{blue}{\left(w \cdot \left(w \cdot r\right)\right)} \cdot r\right)}{1 - v}\right) - \frac{9}{2} \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\color{blue}{\left(w \cdot \left(w \cdot r\right)\right)} \cdot r\right)}{1 - v}\right) - \frac{9}{2} \]
      5. lower-*.f6499.8

        \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(w \cdot \color{blue}{\left(w \cdot r\right)}\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
    4. Applied rewrites99.8%

      \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\color{blue}{\left(w \cdot \left(w \cdot r\right)\right)} \cdot r\right)}{1 - v}\right) - 4.5 \]
    5. Taylor expanded in v around inf

      \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(w \cdot \left(w \cdot r\right)\right) \cdot r\right)}{\color{blue}{v \cdot \left(\frac{1}{v} - 1\right)}}\right) - \frac{9}{2} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(w \cdot \left(w \cdot r\right)\right) \cdot r\right)}{v \cdot \color{blue}{\left(\frac{1}{v} - 1\right)}}\right) - \frac{9}{2} \]
      2. lower--.f64N/A

        \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(w \cdot \left(w \cdot r\right)\right) \cdot r\right)}{v \cdot \left(\frac{1}{v} - \color{blue}{1}\right)}\right) - \frac{9}{2} \]
      3. inv-powN/A

        \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(w \cdot \left(w \cdot r\right)\right) \cdot r\right)}{v \cdot \left({v}^{-1} - 1\right)}\right) - \frac{9}{2} \]
      4. lower-pow.f6499.7

        \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(w \cdot \left(w \cdot r\right)\right) \cdot r\right)}{v \cdot \left({v}^{-1} - 1\right)}\right) - 4.5 \]
    7. Applied rewrites99.7%

      \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(w \cdot \left(w \cdot r\right)\right) \cdot r\right)}{\color{blue}{v \cdot \left({v}^{-1} - 1\right)}}\right) - 4.5 \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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) + -1 \cdot 4.5 \leq -\infty \lor \neg \left(\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) + -1 \cdot 4.5 \leq -1\right):\\ \;\;\;\;2 \cdot {r}^{-2} - \left(1.5 + 0.25 \cdot {\left(r \cdot w\right)}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(w \cdot \left(w \cdot r\right)\right) \cdot r\right)}{v \cdot \left({v}^{-1} - 1\right)}\right) - 4.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 93.4% accurate, N/A× speedup?

\[\begin{array}{l} \\ 2 \cdot {r}^{-2} - \left(1.5 + 0.25 \cdot {\left(r \cdot w\right)}^{2}\right) \end{array} \]
(FPCore (v w r)
 :precision binary64
 (- (* 2.0 (pow r -2.0)) (+ 1.5 (* 0.25 (pow (* r w) 2.0)))))
double code(double v, double w, double r) {
	return (2.0 * pow(r, -2.0)) - (1.5 + (0.25 * pow((r * w), 2.0)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(v, w, r)
use fmin_fmax_functions
    real(8), intent (in) :: v
    real(8), intent (in) :: w
    real(8), intent (in) :: r
    code = (2.0d0 * (r ** (-2.0d0))) - (1.5d0 + (0.25d0 * ((r * w) ** 2.0d0)))
end function
public static double code(double v, double w, double r) {
	return (2.0 * Math.pow(r, -2.0)) - (1.5 + (0.25 * Math.pow((r * w), 2.0)));
}
def code(v, w, r):
	return (2.0 * math.pow(r, -2.0)) - (1.5 + (0.25 * math.pow((r * w), 2.0)))
function code(v, w, r)
	return Float64(Float64(2.0 * (r ^ -2.0)) - Float64(1.5 + Float64(0.25 * (Float64(r * w) ^ 2.0))))
end
function tmp = code(v, w, r)
	tmp = (2.0 * (r ^ -2.0)) - (1.5 + (0.25 * ((r * w) ^ 2.0)));
end
code[v_, w_, r_] := N[(N[(2.0 * N[Power[r, -2.0], $MachinePrecision]), $MachinePrecision] - N[(1.5 + N[(0.25 * N[Power[N[(r * w), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
2 \cdot {r}^{-2} - \left(1.5 + 0.25 \cdot {\left(r \cdot w\right)}^{2}\right)
\end{array}
Derivation
  1. Initial program 82.0%

    \[\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 \]
  2. Add Preprocessing
  3. Taylor expanded in w around inf

    \[\leadsto \color{blue}{{w}^{2} \cdot \left(\frac{2}{{r}^{2} \cdot {w}^{2}} - \left(\frac{1}{8} \cdot \frac{{r}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right)} \]
  4. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \left(\frac{2}{{r}^{2} \cdot {w}^{2}} - \left(\frac{1}{8} \cdot \frac{{r}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \color{blue}{{w}^{2}} \]
    2. lower-*.f64N/A

      \[\leadsto \left(\frac{2}{{r}^{2} \cdot {w}^{2}} - \left(\frac{1}{8} \cdot \frac{{r}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \color{blue}{{w}^{2}} \]
  5. Applied rewrites62.1%

    \[\leadsto \color{blue}{\left(\frac{{\left(r \cdot r\right)}^{-1}}{w} \cdot \frac{2}{w} - \mathsf{fma}\left(\frac{\left(r \cdot r\right) \cdot \mathsf{fma}\left(-2, v, 3\right)}{1 - v}, 0.125, {\left(w \cdot w\right)}^{-1} \cdot 1.5\right)\right) \cdot \left(w \cdot w\right)} \]
  6. Taylor expanded in v around inf

    \[\leadsto \color{blue}{2 \cdot \frac{1}{{r}^{2}} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)} \]
  7. Step-by-step derivation
    1. lower--.f64N/A

      \[\leadsto 2 \cdot \frac{1}{{r}^{2}} - \color{blue}{\left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)} \]
    2. inv-powN/A

      \[\leadsto 2 \cdot {\left({r}^{2}\right)}^{-1} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
    3. pow2N/A

      \[\leadsto 2 \cdot {\left(r \cdot r\right)}^{-1} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
    4. lift-*.f64N/A

      \[\leadsto 2 \cdot {\left(r \cdot r\right)}^{-1} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
    5. lift-pow.f64N/A

      \[\leadsto 2 \cdot {\left(r \cdot r\right)}^{-1} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
    6. lower-*.f64N/A

      \[\leadsto 2 \cdot {\left(r \cdot r\right)}^{-1} - \left(\color{blue}{\frac{3}{2}} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
    7. lift-pow.f64N/A

      \[\leadsto 2 \cdot {\left(r \cdot r\right)}^{-1} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
    8. lift-*.f64N/A

      \[\leadsto 2 \cdot {\left(r \cdot r\right)}^{-1} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
    9. pow2N/A

      \[\leadsto 2 \cdot {\left({r}^{2}\right)}^{-1} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
    10. inv-powN/A

      \[\leadsto 2 \cdot \frac{1}{{r}^{2}} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
    11. pow-flipN/A

      \[\leadsto 2 \cdot {r}^{\left(\mathsf{neg}\left(2\right)\right)} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
    12. metadata-evalN/A

      \[\leadsto 2 \cdot {r}^{-2} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
    13. lower-pow.f64N/A

      \[\leadsto 2 \cdot {r}^{-2} - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) \]
    14. lower-+.f64N/A

      \[\leadsto 2 \cdot {r}^{-2} - \left(\frac{3}{2} + \color{blue}{\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)}\right) \]
    15. lower-*.f64N/A

      \[\leadsto 2 \cdot {r}^{-2} - \left(\frac{3}{2} + \frac{1}{4} \cdot \color{blue}{\left({r}^{2} \cdot {w}^{2}\right)}\right) \]
    16. pow-prod-downN/A

      \[\leadsto 2 \cdot {r}^{-2} - \left(\frac{3}{2} + \frac{1}{4} \cdot {\left(r \cdot w\right)}^{\color{blue}{2}}\right) \]
    17. lower-pow.f64N/A

      \[\leadsto 2 \cdot {r}^{-2} - \left(\frac{3}{2} + \frac{1}{4} \cdot {\left(r \cdot w\right)}^{\color{blue}{2}}\right) \]
    18. lift-*.f6494.0

      \[\leadsto 2 \cdot {r}^{-2} - \left(1.5 + 0.25 \cdot {\left(r \cdot w\right)}^{2}\right) \]
  8. Applied rewrites94.0%

    \[\leadsto \color{blue}{2 \cdot {r}^{-2} - \left(1.5 + 0.25 \cdot {\left(r \cdot w\right)}^{2}\right)} \]
  9. Add Preprocessing

Alternative 6: 68.9% accurate, N/A× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;r \leq 1.5 \cdot 10^{-75}:\\ \;\;\;\;\left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \mathsf{fma}\left(0.375, r \cdot r, 1.5 \cdot {\left(w \cdot w\right)}^{-1}\right)\right) \cdot \left(w \cdot w\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{2}{{\left(r \cdot r\right)}^{2}} - \mathsf{fma}\left(\frac{\left(w \cdot w\right) \cdot \mathsf{fma}\left(-2, v, 3\right)}{1 - v}, 0.125, 1.5 \cdot {\left(r \cdot r\right)}^{-1}\right)\right) \cdot \left(r \cdot r\right)\\ \end{array} \end{array} \]
(FPCore (v w r)
 :precision binary64
 (if (<= r 1.5e-75)
   (*
    (-
     (* 2.0 (pow (pow (* r w) 2.0) -1.0))
     (fma 0.375 (* r r) (* 1.5 (pow (* w w) -1.0))))
    (* w w))
   (*
    (-
     (/ 2.0 (pow (* r r) 2.0))
     (fma
      (/ (* (* w w) (fma -2.0 v 3.0)) (- 1.0 v))
      0.125
      (* 1.5 (pow (* r r) -1.0))))
    (* r r))))
double code(double v, double w, double r) {
	double tmp;
	if (r <= 1.5e-75) {
		tmp = ((2.0 * pow(pow((r * w), 2.0), -1.0)) - fma(0.375, (r * r), (1.5 * pow((w * w), -1.0)))) * (w * w);
	} else {
		tmp = ((2.0 / pow((r * r), 2.0)) - fma((((w * w) * fma(-2.0, v, 3.0)) / (1.0 - v)), 0.125, (1.5 * pow((r * r), -1.0)))) * (r * r);
	}
	return tmp;
}
function code(v, w, r)
	tmp = 0.0
	if (r <= 1.5e-75)
		tmp = Float64(Float64(Float64(2.0 * ((Float64(r * w) ^ 2.0) ^ -1.0)) - fma(0.375, Float64(r * r), Float64(1.5 * (Float64(w * w) ^ -1.0)))) * Float64(w * w));
	else
		tmp = Float64(Float64(Float64(2.0 / (Float64(r * r) ^ 2.0)) - fma(Float64(Float64(Float64(w * w) * fma(-2.0, v, 3.0)) / Float64(1.0 - v)), 0.125, Float64(1.5 * (Float64(r * r) ^ -1.0)))) * Float64(r * r));
	end
	return tmp
end
code[v_, w_, r_] := If[LessEqual[r, 1.5e-75], N[(N[(N[(2.0 * N[Power[N[Power[N[(r * w), $MachinePrecision], 2.0], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision] - N[(0.375 * N[(r * r), $MachinePrecision] + N[(1.5 * N[Power[N[(w * w), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(w * w), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / N[Power[N[(r * r), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(w * w), $MachinePrecision] * N[(-2.0 * v + 3.0), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision] * 0.125 + N[(1.5 * N[Power[N[(r * r), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(r * r), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;r \leq 1.5 \cdot 10^{-75}:\\
\;\;\;\;\left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \mathsf{fma}\left(0.375, r \cdot r, 1.5 \cdot {\left(w \cdot w\right)}^{-1}\right)\right) \cdot \left(w \cdot w\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\frac{2}{{\left(r \cdot r\right)}^{2}} - \mathsf{fma}\left(\frac{\left(w \cdot w\right) \cdot \mathsf{fma}\left(-2, v, 3\right)}{1 - v}, 0.125, 1.5 \cdot {\left(r \cdot r\right)}^{-1}\right)\right) \cdot \left(r \cdot r\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if r < 1.4999999999999999e-75

    1. Initial program 77.6%

      \[\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 \]
    2. Add Preprocessing
    3. Taylor expanded in w around inf

      \[\leadsto \color{blue}{{w}^{2} \cdot \left(\frac{2}{{r}^{2} \cdot {w}^{2}} - \left(\frac{1}{8} \cdot \frac{{r}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(\frac{2}{{r}^{2} \cdot {w}^{2}} - \left(\frac{1}{8} \cdot \frac{{r}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \color{blue}{{w}^{2}} \]
      2. lower-*.f64N/A

        \[\leadsto \left(\frac{2}{{r}^{2} \cdot {w}^{2}} - \left(\frac{1}{8} \cdot \frac{{r}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \color{blue}{{w}^{2}} \]
    5. Applied rewrites59.9%

      \[\leadsto \color{blue}{\left(\frac{{\left(r \cdot r\right)}^{-1}}{w} \cdot \frac{2}{w} - \mathsf{fma}\left(\frac{\left(r \cdot r\right) \cdot \mathsf{fma}\left(-2, v, 3\right)}{1 - v}, 0.125, {\left(w \cdot w\right)}^{-1} \cdot 1.5\right)\right) \cdot \left(w \cdot w\right)} \]
    6. Taylor expanded in v around 0

      \[\leadsto \left(2 \cdot \frac{1}{{r}^{2} \cdot {w}^{2}} - \left(\frac{3}{8} \cdot {r}^{2} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \left(\color{blue}{w} \cdot w\right) \]
    7. Step-by-step derivation
      1. lower--.f64N/A

        \[\leadsto \left(2 \cdot \frac{1}{{r}^{2} \cdot {w}^{2}} - \left(\frac{3}{8} \cdot {r}^{2} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \left(w \cdot w\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(2 \cdot \frac{1}{{r}^{2} \cdot {w}^{2}} - \left(\frac{3}{8} \cdot {r}^{2} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \left(w \cdot w\right) \]
      3. inv-powN/A

        \[\leadsto \left(2 \cdot {\left({r}^{2} \cdot {w}^{2}\right)}^{-1} - \left(\frac{3}{8} \cdot {r}^{2} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \left(w \cdot w\right) \]
      4. lower-pow.f64N/A

        \[\leadsto \left(2 \cdot {\left({r}^{2} \cdot {w}^{2}\right)}^{-1} - \left(\frac{3}{8} \cdot {r}^{2} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \left(w \cdot w\right) \]
      5. pow-prod-downN/A

        \[\leadsto \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \left(\frac{3}{8} \cdot {r}^{2} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \left(w \cdot w\right) \]
      6. lower-pow.f64N/A

        \[\leadsto \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \left(\frac{3}{8} \cdot {r}^{2} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \left(w \cdot w\right) \]
      7. lift-*.f64N/A

        \[\leadsto \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \left(\frac{3}{8} \cdot {r}^{2} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \left(w \cdot w\right) \]
      8. lower-fma.f64N/A

        \[\leadsto \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \mathsf{fma}\left(\frac{3}{8}, {r}^{2}, \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \left(w \cdot w\right) \]
      9. pow2N/A

        \[\leadsto \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \mathsf{fma}\left(\frac{3}{8}, r \cdot r, \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \left(w \cdot w\right) \]
      10. lift-*.f64N/A

        \[\leadsto \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \mathsf{fma}\left(\frac{3}{8}, r \cdot r, \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \left(w \cdot w\right) \]
      11. lower-*.f64N/A

        \[\leadsto \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \mathsf{fma}\left(\frac{3}{8}, r \cdot r, \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \left(w \cdot w\right) \]
      12. inv-powN/A

        \[\leadsto \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \mathsf{fma}\left(\frac{3}{8}, r \cdot r, \frac{3}{2} \cdot {\left({w}^{2}\right)}^{-1}\right)\right) \cdot \left(w \cdot w\right) \]
      13. pow2N/A

        \[\leadsto \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \mathsf{fma}\left(\frac{3}{8}, r \cdot r, \frac{3}{2} \cdot {\left(w \cdot w\right)}^{-1}\right)\right) \cdot \left(w \cdot w\right) \]
      14. lift-*.f64N/A

        \[\leadsto \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \mathsf{fma}\left(\frac{3}{8}, r \cdot r, \frac{3}{2} \cdot {\left(w \cdot w\right)}^{-1}\right)\right) \cdot \left(w \cdot w\right) \]
      15. lift-pow.f6458.9

        \[\leadsto \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \mathsf{fma}\left(0.375, r \cdot r, 1.5 \cdot {\left(w \cdot w\right)}^{-1}\right)\right) \cdot \left(w \cdot w\right) \]
    8. Applied rewrites58.9%

      \[\leadsto \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \mathsf{fma}\left(0.375, r \cdot r, 1.5 \cdot {\left(w \cdot w\right)}^{-1}\right)\right) \cdot \left(\color{blue}{w} \cdot w\right) \]

    if 1.4999999999999999e-75 < r

    1. Initial program 93.1%

      \[\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 \]
    2. Add Preprocessing
    3. Taylor expanded in r around inf

      \[\leadsto \color{blue}{{r}^{2} \cdot \left(\frac{2}{{r}^{4}} - \left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(\frac{2}{{r}^{4}} - \left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right) \cdot \color{blue}{{r}^{2}} \]
      2. lower-*.f64N/A

        \[\leadsto \left(\frac{2}{{r}^{4}} - \left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right) \cdot \color{blue}{{r}^{2}} \]
    5. Applied rewrites78.5%

      \[\leadsto \color{blue}{\left(\frac{2}{{\left(r \cdot r\right)}^{2}} - \mathsf{fma}\left(\frac{\left(w \cdot w\right) \cdot \mathsf{fma}\left(-2, v, 3\right)}{1 - v}, 0.125, 1.5 \cdot {\left(r \cdot r\right)}^{-1}\right)\right) \cdot \left(r \cdot r\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 7: 63.8% accurate, N/A× speedup?

\[\begin{array}{l} \\ \left(\frac{{\left(r \cdot r\right)}^{-1}}{w} \cdot \frac{2}{w} - \mathsf{fma}\left(\frac{\left(r \cdot r\right) \cdot \mathsf{fma}\left(-2, v, 3\right)}{1 - v}, 0.125, {\left(w \cdot w\right)}^{-1} \cdot 1.5\right)\right) \cdot \left(w \cdot w\right) \end{array} \]
(FPCore (v w r)
 :precision binary64
 (*
  (-
   (* (/ (pow (* r r) -1.0) w) (/ 2.0 w))
   (fma
    (/ (* (* r r) (fma -2.0 v 3.0)) (- 1.0 v))
    0.125
    (* (pow (* w w) -1.0) 1.5)))
  (* w w)))
double code(double v, double w, double r) {
	return (((pow((r * r), -1.0) / w) * (2.0 / w)) - fma((((r * r) * fma(-2.0, v, 3.0)) / (1.0 - v)), 0.125, (pow((w * w), -1.0) * 1.5))) * (w * w);
}
function code(v, w, r)
	return Float64(Float64(Float64(Float64((Float64(r * r) ^ -1.0) / w) * Float64(2.0 / w)) - fma(Float64(Float64(Float64(r * r) * fma(-2.0, v, 3.0)) / Float64(1.0 - v)), 0.125, Float64((Float64(w * w) ^ -1.0) * 1.5))) * Float64(w * w))
end
code[v_, w_, r_] := N[(N[(N[(N[(N[Power[N[(r * r), $MachinePrecision], -1.0], $MachinePrecision] / w), $MachinePrecision] * N[(2.0 / w), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(r * r), $MachinePrecision] * N[(-2.0 * v + 3.0), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision] * 0.125 + N[(N[Power[N[(w * w), $MachinePrecision], -1.0], $MachinePrecision] * 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(w * w), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\frac{{\left(r \cdot r\right)}^{-1}}{w} \cdot \frac{2}{w} - \mathsf{fma}\left(\frac{\left(r \cdot r\right) \cdot \mathsf{fma}\left(-2, v, 3\right)}{1 - v}, 0.125, {\left(w \cdot w\right)}^{-1} \cdot 1.5\right)\right) \cdot \left(w \cdot w\right)
\end{array}
Derivation
  1. Initial program 82.0%

    \[\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 \]
  2. Add Preprocessing
  3. Taylor expanded in w around inf

    \[\leadsto \color{blue}{{w}^{2} \cdot \left(\frac{2}{{r}^{2} \cdot {w}^{2}} - \left(\frac{1}{8} \cdot \frac{{r}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right)} \]
  4. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \left(\frac{2}{{r}^{2} \cdot {w}^{2}} - \left(\frac{1}{8} \cdot \frac{{r}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \color{blue}{{w}^{2}} \]
    2. lower-*.f64N/A

      \[\leadsto \left(\frac{2}{{r}^{2} \cdot {w}^{2}} - \left(\frac{1}{8} \cdot \frac{{r}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \color{blue}{{w}^{2}} \]
  5. Applied rewrites62.1%

    \[\leadsto \color{blue}{\left(\frac{{\left(r \cdot r\right)}^{-1}}{w} \cdot \frac{2}{w} - \mathsf{fma}\left(\frac{\left(r \cdot r\right) \cdot \mathsf{fma}\left(-2, v, 3\right)}{1 - v}, 0.125, {\left(w \cdot w\right)}^{-1} \cdot 1.5\right)\right) \cdot \left(w \cdot w\right)} \]
  6. Add Preprocessing

Alternative 8: 62.5% accurate, N/A× speedup?

\[\begin{array}{l} \\ \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \mathsf{fma}\left(0.375, r \cdot r, 1.5 \cdot {\left(w \cdot w\right)}^{-1}\right)\right) \cdot \left(w \cdot w\right) \end{array} \]
(FPCore (v w r)
 :precision binary64
 (*
  (-
   (* 2.0 (pow (pow (* r w) 2.0) -1.0))
   (fma 0.375 (* r r) (* 1.5 (pow (* w w) -1.0))))
  (* w w)))
double code(double v, double w, double r) {
	return ((2.0 * pow(pow((r * w), 2.0), -1.0)) - fma(0.375, (r * r), (1.5 * pow((w * w), -1.0)))) * (w * w);
}
function code(v, w, r)
	return Float64(Float64(Float64(2.0 * ((Float64(r * w) ^ 2.0) ^ -1.0)) - fma(0.375, Float64(r * r), Float64(1.5 * (Float64(w * w) ^ -1.0)))) * Float64(w * w))
end
code[v_, w_, r_] := N[(N[(N[(2.0 * N[Power[N[Power[N[(r * w), $MachinePrecision], 2.0], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision] - N[(0.375 * N[(r * r), $MachinePrecision] + N[(1.5 * N[Power[N[(w * w), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(w * w), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \mathsf{fma}\left(0.375, r \cdot r, 1.5 \cdot {\left(w \cdot w\right)}^{-1}\right)\right) \cdot \left(w \cdot w\right)
\end{array}
Derivation
  1. Initial program 82.0%

    \[\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 \]
  2. Add Preprocessing
  3. Taylor expanded in w around inf

    \[\leadsto \color{blue}{{w}^{2} \cdot \left(\frac{2}{{r}^{2} \cdot {w}^{2}} - \left(\frac{1}{8} \cdot \frac{{r}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right)} \]
  4. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \left(\frac{2}{{r}^{2} \cdot {w}^{2}} - \left(\frac{1}{8} \cdot \frac{{r}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \color{blue}{{w}^{2}} \]
    2. lower-*.f64N/A

      \[\leadsto \left(\frac{2}{{r}^{2} \cdot {w}^{2}} - \left(\frac{1}{8} \cdot \frac{{r}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \color{blue}{{w}^{2}} \]
  5. Applied rewrites62.1%

    \[\leadsto \color{blue}{\left(\frac{{\left(r \cdot r\right)}^{-1}}{w} \cdot \frac{2}{w} - \mathsf{fma}\left(\frac{\left(r \cdot r\right) \cdot \mathsf{fma}\left(-2, v, 3\right)}{1 - v}, 0.125, {\left(w \cdot w\right)}^{-1} \cdot 1.5\right)\right) \cdot \left(w \cdot w\right)} \]
  6. Taylor expanded in v around 0

    \[\leadsto \left(2 \cdot \frac{1}{{r}^{2} \cdot {w}^{2}} - \left(\frac{3}{8} \cdot {r}^{2} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \left(\color{blue}{w} \cdot w\right) \]
  7. Step-by-step derivation
    1. lower--.f64N/A

      \[\leadsto \left(2 \cdot \frac{1}{{r}^{2} \cdot {w}^{2}} - \left(\frac{3}{8} \cdot {r}^{2} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \left(w \cdot w\right) \]
    2. lower-*.f64N/A

      \[\leadsto \left(2 \cdot \frac{1}{{r}^{2} \cdot {w}^{2}} - \left(\frac{3}{8} \cdot {r}^{2} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \left(w \cdot w\right) \]
    3. inv-powN/A

      \[\leadsto \left(2 \cdot {\left({r}^{2} \cdot {w}^{2}\right)}^{-1} - \left(\frac{3}{8} \cdot {r}^{2} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \left(w \cdot w\right) \]
    4. lower-pow.f64N/A

      \[\leadsto \left(2 \cdot {\left({r}^{2} \cdot {w}^{2}\right)}^{-1} - \left(\frac{3}{8} \cdot {r}^{2} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \left(w \cdot w\right) \]
    5. pow-prod-downN/A

      \[\leadsto \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \left(\frac{3}{8} \cdot {r}^{2} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \left(w \cdot w\right) \]
    6. lower-pow.f64N/A

      \[\leadsto \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \left(\frac{3}{8} \cdot {r}^{2} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \left(w \cdot w\right) \]
    7. lift-*.f64N/A

      \[\leadsto \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \left(\frac{3}{8} \cdot {r}^{2} + \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \left(w \cdot w\right) \]
    8. lower-fma.f64N/A

      \[\leadsto \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \mathsf{fma}\left(\frac{3}{8}, {r}^{2}, \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \left(w \cdot w\right) \]
    9. pow2N/A

      \[\leadsto \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \mathsf{fma}\left(\frac{3}{8}, r \cdot r, \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \left(w \cdot w\right) \]
    10. lift-*.f64N/A

      \[\leadsto \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \mathsf{fma}\left(\frac{3}{8}, r \cdot r, \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \left(w \cdot w\right) \]
    11. lower-*.f64N/A

      \[\leadsto \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \mathsf{fma}\left(\frac{3}{8}, r \cdot r, \frac{3}{2} \cdot \frac{1}{{w}^{2}}\right)\right) \cdot \left(w \cdot w\right) \]
    12. inv-powN/A

      \[\leadsto \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \mathsf{fma}\left(\frac{3}{8}, r \cdot r, \frac{3}{2} \cdot {\left({w}^{2}\right)}^{-1}\right)\right) \cdot \left(w \cdot w\right) \]
    13. pow2N/A

      \[\leadsto \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \mathsf{fma}\left(\frac{3}{8}, r \cdot r, \frac{3}{2} \cdot {\left(w \cdot w\right)}^{-1}\right)\right) \cdot \left(w \cdot w\right) \]
    14. lift-*.f64N/A

      \[\leadsto \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \mathsf{fma}\left(\frac{3}{8}, r \cdot r, \frac{3}{2} \cdot {\left(w \cdot w\right)}^{-1}\right)\right) \cdot \left(w \cdot w\right) \]
    15. lift-pow.f6461.1

      \[\leadsto \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \mathsf{fma}\left(0.375, r \cdot r, 1.5 \cdot {\left(w \cdot w\right)}^{-1}\right)\right) \cdot \left(w \cdot w\right) \]
  8. Applied rewrites61.1%

    \[\leadsto \left(2 \cdot {\left({\left(r \cdot w\right)}^{2}\right)}^{-1} - \mathsf{fma}\left(0.375, r \cdot r, 1.5 \cdot {\left(w \cdot w\right)}^{-1}\right)\right) \cdot \left(\color{blue}{w} \cdot w\right) \]
  9. Add Preprocessing

Reproduce

?
herbie shell --seed 2025065 
(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))