Rosa's TurbineBenchmark

Percentage Accurate: 85.5% → 99.1%
Time: 4.9s
Alternatives: 11
Speedup: 1.3×

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}

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 11 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: 85.5% 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.1% accurate, 1.1× speedup?

\[\begin{array}{l} r_m = \left|r\right| \\ \begin{array}{l} t_0 := \frac{2}{r\_m \cdot r\_m}\\ \mathbf{if}\;r\_m \leq 1.32 \cdot 10^{+194}:\\ \;\;\;\;\left(t\_0 - \mathsf{fma}\left(-0.25, v, 0.375\right) \cdot \left(\left(r\_m \cdot \left(w \cdot r\_m\right)\right) \cdot \frac{w}{1 - v}\right)\right) - 1.5\\ \mathbf{else}:\\ \;\;\;\;\left(t\_0 - r\_m \cdot \frac{\left(\mathsf{fma}\left(v, -0.25, 0.375\right) \cdot w\right) \cdot \left(w \cdot r\_m\right)}{1 - v}\right) - 1.5\\ \end{array} \end{array} \]
r_m = (fabs.f64 r)
(FPCore (v w r_m)
 :precision binary64
 (let* ((t_0 (/ 2.0 (* r_m r_m))))
   (if (<= r_m 1.32e+194)
     (-
      (- t_0 (* (fma -0.25 v 0.375) (* (* r_m (* w r_m)) (/ w (- 1.0 v)))))
      1.5)
     (-
      (- t_0 (* r_m (/ (* (* (fma v -0.25 0.375) w) (* w r_m)) (- 1.0 v))))
      1.5))))
r_m = fabs(r);
double code(double v, double w, double r_m) {
	double t_0 = 2.0 / (r_m * r_m);
	double tmp;
	if (r_m <= 1.32e+194) {
		tmp = (t_0 - (fma(-0.25, v, 0.375) * ((r_m * (w * r_m)) * (w / (1.0 - v))))) - 1.5;
	} else {
		tmp = (t_0 - (r_m * (((fma(v, -0.25, 0.375) * w) * (w * r_m)) / (1.0 - v)))) - 1.5;
	}
	return tmp;
}
r_m = abs(r)
function code(v, w, r_m)
	t_0 = Float64(2.0 / Float64(r_m * r_m))
	tmp = 0.0
	if (r_m <= 1.32e+194)
		tmp = Float64(Float64(t_0 - Float64(fma(-0.25, v, 0.375) * Float64(Float64(r_m * Float64(w * r_m)) * Float64(w / Float64(1.0 - v))))) - 1.5);
	else
		tmp = Float64(Float64(t_0 - Float64(r_m * Float64(Float64(Float64(fma(v, -0.25, 0.375) * w) * Float64(w * r_m)) / Float64(1.0 - v)))) - 1.5);
	end
	return tmp
end
r_m = N[Abs[r], $MachinePrecision]
code[v_, w_, r$95$m_] := Block[{t$95$0 = N[(2.0 / N[(r$95$m * r$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r$95$m, 1.32e+194], N[(N[(t$95$0 - N[(N[(-0.25 * v + 0.375), $MachinePrecision] * N[(N[(r$95$m * N[(w * r$95$m), $MachinePrecision]), $MachinePrecision] * N[(w / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.5), $MachinePrecision], N[(N[(t$95$0 - N[(r$95$m * N[(N[(N[(N[(v * -0.25 + 0.375), $MachinePrecision] * w), $MachinePrecision] * N[(w * r$95$m), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.5), $MachinePrecision]]]
\begin{array}{l}
r_m = \left|r\right|

\\
\begin{array}{l}
t_0 := \frac{2}{r\_m \cdot r\_m}\\
\mathbf{if}\;r\_m \leq 1.32 \cdot 10^{+194}:\\
\;\;\;\;\left(t\_0 - \mathsf{fma}\left(-0.25, v, 0.375\right) \cdot \left(\left(r\_m \cdot \left(w \cdot r\_m\right)\right) \cdot \frac{w}{1 - v}\right)\right) - 1.5\\

\mathbf{else}:\\
\;\;\;\;\left(t\_0 - r\_m \cdot \frac{\left(\mathsf{fma}\left(v, -0.25, 0.375\right) \cdot w\right) \cdot \left(w \cdot r\_m\right)}{1 - v}\right) - 1.5\\


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

    1. Initial program 85.5%

      \[\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. Applied rewrites92.3%

      \[\leadsto \color{blue}{\left(\frac{2}{r \cdot r} - r \cdot \frac{\left(\mathsf{fma}\left(v, -0.25, 0.375\right) \cdot w\right) \cdot \left(w \cdot r\right)}{1 - v}\right) - 1.5} \]
    3. Applied rewrites95.8%

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

    if 1.32e194 < r

    1. Initial program 85.5%

      \[\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. Applied rewrites92.3%

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

Alternative 2: 98.4% accurate, 1.1× speedup?

\[\begin{array}{l} r_m = \left|r\right| \\ \begin{array}{l} t_0 := \frac{2}{r\_m \cdot r\_m}\\ \mathbf{if}\;r\_m \leq 5.3 \cdot 10^{+241}:\\ \;\;\;\;\left(t\_0 - \mathsf{fma}\left(-0.25, v, 0.375\right) \cdot \left(w \cdot \left(r\_m \cdot \left(\frac{w}{1 - v} \cdot r\_m\right)\right)\right)\right) - 1.5\\ \mathbf{else}:\\ \;\;\;\;\left(t\_0 - r\_m \cdot \frac{\left(\mathsf{fma}\left(v, -0.25, 0.375\right) \cdot w\right) \cdot \left(w \cdot r\_m\right)}{1 - v}\right) - 1.5\\ \end{array} \end{array} \]
r_m = (fabs.f64 r)
(FPCore (v w r_m)
 :precision binary64
 (let* ((t_0 (/ 2.0 (* r_m r_m))))
   (if (<= r_m 5.3e+241)
     (-
      (- t_0 (* (fma -0.25 v 0.375) (* w (* r_m (* (/ w (- 1.0 v)) r_m)))))
      1.5)
     (-
      (- t_0 (* r_m (/ (* (* (fma v -0.25 0.375) w) (* w r_m)) (- 1.0 v))))
      1.5))))
r_m = fabs(r);
double code(double v, double w, double r_m) {
	double t_0 = 2.0 / (r_m * r_m);
	double tmp;
	if (r_m <= 5.3e+241) {
		tmp = (t_0 - (fma(-0.25, v, 0.375) * (w * (r_m * ((w / (1.0 - v)) * r_m))))) - 1.5;
	} else {
		tmp = (t_0 - (r_m * (((fma(v, -0.25, 0.375) * w) * (w * r_m)) / (1.0 - v)))) - 1.5;
	}
	return tmp;
}
r_m = abs(r)
function code(v, w, r_m)
	t_0 = Float64(2.0 / Float64(r_m * r_m))
	tmp = 0.0
	if (r_m <= 5.3e+241)
		tmp = Float64(Float64(t_0 - Float64(fma(-0.25, v, 0.375) * Float64(w * Float64(r_m * Float64(Float64(w / Float64(1.0 - v)) * r_m))))) - 1.5);
	else
		tmp = Float64(Float64(t_0 - Float64(r_m * Float64(Float64(Float64(fma(v, -0.25, 0.375) * w) * Float64(w * r_m)) / Float64(1.0 - v)))) - 1.5);
	end
	return tmp
end
r_m = N[Abs[r], $MachinePrecision]
code[v_, w_, r$95$m_] := Block[{t$95$0 = N[(2.0 / N[(r$95$m * r$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r$95$m, 5.3e+241], N[(N[(t$95$0 - N[(N[(-0.25 * v + 0.375), $MachinePrecision] * N[(w * N[(r$95$m * N[(N[(w / N[(1.0 - v), $MachinePrecision]), $MachinePrecision] * r$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.5), $MachinePrecision], N[(N[(t$95$0 - N[(r$95$m * N[(N[(N[(N[(v * -0.25 + 0.375), $MachinePrecision] * w), $MachinePrecision] * N[(w * r$95$m), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.5), $MachinePrecision]]]
\begin{array}{l}
r_m = \left|r\right|

\\
\begin{array}{l}
t_0 := \frac{2}{r\_m \cdot r\_m}\\
\mathbf{if}\;r\_m \leq 5.3 \cdot 10^{+241}:\\
\;\;\;\;\left(t\_0 - \mathsf{fma}\left(-0.25, v, 0.375\right) \cdot \left(w \cdot \left(r\_m \cdot \left(\frac{w}{1 - v} \cdot r\_m\right)\right)\right)\right) - 1.5\\

\mathbf{else}:\\
\;\;\;\;\left(t\_0 - r\_m \cdot \frac{\left(\mathsf{fma}\left(v, -0.25, 0.375\right) \cdot w\right) \cdot \left(w \cdot r\_m\right)}{1 - v}\right) - 1.5\\


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

    1. Initial program 85.5%

      \[\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. Applied rewrites92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{2}{r \cdot r} - \mathsf{fma}\left(\frac{-1}{4}, v, \frac{3}{8}\right) \cdot \left(w \cdot \left(r \cdot \frac{\color{blue}{w \cdot r}}{1 - v}\right)\right)\right) - \frac{3}{2} \]
    4. Applied rewrites96.4%

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

    if 5.3000000000000001e241 < r

    1. Initial program 85.5%

      \[\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. Applied rewrites92.3%

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

Alternative 3: 97.8% accurate, 1.0× speedup?

\[\begin{array}{l} r_m = \left|r\right| \\ \begin{array}{l} t_0 := \frac{w}{1 - v} \cdot r\_m\\ t_1 := \frac{2}{r\_m \cdot r\_m}\\ \mathbf{if}\;r\_m \leq 4 \cdot 10^{-116}:\\ \;\;\;\;\left(t\_1 - \left(v \cdot -0.25\right) \cdot \left(w \cdot \left(r\_m \cdot t\_0\right)\right)\right) - 1.5\\ \mathbf{elif}\;r\_m \leq 6 \cdot 10^{+165}:\\ \;\;\;\;t\_1 - \mathsf{fma}\left(w \cdot \mathsf{fma}\left(v, -0.25, 0.375\right), t\_0 \cdot r\_m, 1.5\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t\_1 - r\_m \cdot \frac{\left(\mathsf{fma}\left(v, -0.25, 0.375\right) \cdot w\right) \cdot \left(w \cdot r\_m\right)}{1 - v}\right) - 1.5\\ \end{array} \end{array} \]
r_m = (fabs.f64 r)
(FPCore (v w r_m)
 :precision binary64
 (let* ((t_0 (* (/ w (- 1.0 v)) r_m)) (t_1 (/ 2.0 (* r_m r_m))))
   (if (<= r_m 4e-116)
     (- (- t_1 (* (* v -0.25) (* w (* r_m t_0)))) 1.5)
     (if (<= r_m 6e+165)
       (- t_1 (fma (* w (fma v -0.25 0.375)) (* t_0 r_m) 1.5))
       (-
        (- t_1 (* r_m (/ (* (* (fma v -0.25 0.375) w) (* w r_m)) (- 1.0 v))))
        1.5)))))
r_m = fabs(r);
double code(double v, double w, double r_m) {
	double t_0 = (w / (1.0 - v)) * r_m;
	double t_1 = 2.0 / (r_m * r_m);
	double tmp;
	if (r_m <= 4e-116) {
		tmp = (t_1 - ((v * -0.25) * (w * (r_m * t_0)))) - 1.5;
	} else if (r_m <= 6e+165) {
		tmp = t_1 - fma((w * fma(v, -0.25, 0.375)), (t_0 * r_m), 1.5);
	} else {
		tmp = (t_1 - (r_m * (((fma(v, -0.25, 0.375) * w) * (w * r_m)) / (1.0 - v)))) - 1.5;
	}
	return tmp;
}
r_m = abs(r)
function code(v, w, r_m)
	t_0 = Float64(Float64(w / Float64(1.0 - v)) * r_m)
	t_1 = Float64(2.0 / Float64(r_m * r_m))
	tmp = 0.0
	if (r_m <= 4e-116)
		tmp = Float64(Float64(t_1 - Float64(Float64(v * -0.25) * Float64(w * Float64(r_m * t_0)))) - 1.5);
	elseif (r_m <= 6e+165)
		tmp = Float64(t_1 - fma(Float64(w * fma(v, -0.25, 0.375)), Float64(t_0 * r_m), 1.5));
	else
		tmp = Float64(Float64(t_1 - Float64(r_m * Float64(Float64(Float64(fma(v, -0.25, 0.375) * w) * Float64(w * r_m)) / Float64(1.0 - v)))) - 1.5);
	end
	return tmp
end
r_m = N[Abs[r], $MachinePrecision]
code[v_, w_, r$95$m_] := Block[{t$95$0 = N[(N[(w / N[(1.0 - v), $MachinePrecision]), $MachinePrecision] * r$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 / N[(r$95$m * r$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r$95$m, 4e-116], N[(N[(t$95$1 - N[(N[(v * -0.25), $MachinePrecision] * N[(w * N[(r$95$m * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.5), $MachinePrecision], If[LessEqual[r$95$m, 6e+165], N[(t$95$1 - N[(N[(w * N[(v * -0.25 + 0.375), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * r$95$m), $MachinePrecision] + 1.5), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[(r$95$m * N[(N[(N[(N[(v * -0.25 + 0.375), $MachinePrecision] * w), $MachinePrecision] * N[(w * r$95$m), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.5), $MachinePrecision]]]]]
\begin{array}{l}
r_m = \left|r\right|

\\
\begin{array}{l}
t_0 := \frac{w}{1 - v} \cdot r\_m\\
t_1 := \frac{2}{r\_m \cdot r\_m}\\
\mathbf{if}\;r\_m \leq 4 \cdot 10^{-116}:\\
\;\;\;\;\left(t\_1 - \left(v \cdot -0.25\right) \cdot \left(w \cdot \left(r\_m \cdot t\_0\right)\right)\right) - 1.5\\

\mathbf{elif}\;r\_m \leq 6 \cdot 10^{+165}:\\
\;\;\;\;t\_1 - \mathsf{fma}\left(w \cdot \mathsf{fma}\left(v, -0.25, 0.375\right), t\_0 \cdot r\_m, 1.5\right)\\

\mathbf{else}:\\
\;\;\;\;\left(t\_1 - r\_m \cdot \frac{\left(\mathsf{fma}\left(v, -0.25, 0.375\right) \cdot w\right) \cdot \left(w \cdot r\_m\right)}{1 - v}\right) - 1.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if r < 4e-116

    1. Initial program 85.5%

      \[\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. Applied rewrites92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{2}{r \cdot r} - \mathsf{fma}\left(\frac{-1}{4}, v, \frac{3}{8}\right) \cdot \left(w \cdot \left(r \cdot \frac{\color{blue}{w \cdot r}}{1 - v}\right)\right)\right) - \frac{3}{2} \]
    4. Applied rewrites96.4%

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

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

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

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

        \[\leadsto \left(\frac{2}{r \cdot r} - \left(v \cdot \left(\frac{3}{8} \cdot \frac{1}{v} - \frac{1}{4}\right)\right) \cdot \left(w \cdot \left(r \cdot \left(\frac{w}{1 - v} \cdot r\right)\right)\right)\right) - \frac{3}{2} \]
      4. lower-/.f6496.4

        \[\leadsto \left(\frac{2}{r \cdot r} - \left(v \cdot \left(0.375 \cdot \frac{1}{v} - 0.25\right)\right) \cdot \left(w \cdot \left(r \cdot \left(\frac{w}{1 - v} \cdot r\right)\right)\right)\right) - 1.5 \]
    7. Applied rewrites96.4%

      \[\leadsto \left(\frac{2}{r \cdot r} - \color{blue}{\left(v \cdot \left(0.375 \cdot \frac{1}{v} - 0.25\right)\right)} \cdot \left(w \cdot \left(r \cdot \left(\frac{w}{1 - v} \cdot r\right)\right)\right)\right) - 1.5 \]
    8. Taylor expanded in v around inf

      \[\leadsto \left(\frac{2}{r \cdot r} - \left(v \cdot \frac{-1}{4}\right) \cdot \left(w \cdot \left(r \cdot \left(\frac{w}{1 - v} \cdot r\right)\right)\right)\right) - \frac{3}{2} \]
    9. Step-by-step derivation
      1. Applied rewrites83.4%

        \[\leadsto \left(\frac{2}{r \cdot r} - \left(v \cdot -0.25\right) \cdot \left(w \cdot \left(r \cdot \left(\frac{w}{1 - v} \cdot r\right)\right)\right)\right) - 1.5 \]

      if 4e-116 < r < 5.99999999999999981e165

      1. Initial program 85.5%

        \[\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. Applied rewrites92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\frac{2}{r \cdot r} - \mathsf{fma}\left(\frac{-1}{4}, v, \frac{3}{8}\right) \cdot \left(w \cdot \left(r \cdot \frac{\color{blue}{w \cdot r}}{1 - v}\right)\right)\right) - \frac{3}{2} \]
      4. Applied rewrites96.4%

        \[\leadsto \left(\frac{2}{r \cdot r} - \color{blue}{\mathsf{fma}\left(-0.25, v, 0.375\right) \cdot \left(w \cdot \left(r \cdot \left(\frac{w}{1 - v} \cdot r\right)\right)\right)}\right) - 1.5 \]
      5. Step-by-step derivation
        1. lift--.f64N/A

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

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(\color{blue}{w \cdot \mathsf{fma}\left(\frac{-1}{4}, v, \frac{3}{8}\right)}, r \cdot \left(\frac{w}{1 - v} \cdot r\right), \frac{3}{2}\right) \]
        10. lower-*.f6491.4

          \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(\color{blue}{w \cdot \mathsf{fma}\left(-0.25, v, 0.375\right)}, r \cdot \left(\frac{w}{1 - v} \cdot r\right), 1.5\right) \]
        11. lift-fma.f64N/A

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

          \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(w \cdot \left(\color{blue}{v \cdot \frac{-1}{4}} + \frac{3}{8}\right), r \cdot \left(\frac{w}{1 - v} \cdot r\right), \frac{3}{2}\right) \]
        13. lower-fma.f6491.4

          \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(w \cdot \color{blue}{\mathsf{fma}\left(v, -0.25, 0.375\right)}, r \cdot \left(\frac{w}{1 - v} \cdot r\right), 1.5\right) \]
        14. lift-*.f64N/A

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

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

          \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(w \cdot \mathsf{fma}\left(v, -0.25, 0.375\right), \color{blue}{\left(\frac{w}{1 - v} \cdot r\right) \cdot r}, 1.5\right) \]
      6. Applied rewrites91.4%

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

      if 5.99999999999999981e165 < r

      1. Initial program 85.5%

        \[\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. Applied rewrites92.3%

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

    Alternative 4: 97.3% accurate, 1.0× speedup?

    \[\begin{array}{l} r_m = \left|r\right| \\ \begin{array}{l} t_0 := \frac{w}{1 - v} \cdot r\_m\\ t_1 := \frac{2}{r\_m \cdot r\_m}\\ \mathbf{if}\;r\_m \leq 4 \cdot 10^{-116}:\\ \;\;\;\;\left(t\_1 - \left(v \cdot -0.25\right) \cdot \left(w \cdot \left(r\_m \cdot t\_0\right)\right)\right) - 1.5\\ \mathbf{elif}\;r\_m \leq 7 \cdot 10^{+155}:\\ \;\;\;\;t\_1 - \mathsf{fma}\left(w \cdot \mathsf{fma}\left(v, -0.25, 0.375\right), t\_0 \cdot r\_m, 1.5\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 - \mathsf{fma}\left(\frac{\left(\left(w \cdot \mathsf{fma}\left(-0.25, v, 0.375\right)\right) \cdot r\_m\right) \cdot w}{1 - v}, r\_m, 1.5\right)\\ \end{array} \end{array} \]
    r_m = (fabs.f64 r)
    (FPCore (v w r_m)
     :precision binary64
     (let* ((t_0 (* (/ w (- 1.0 v)) r_m)) (t_1 (/ 2.0 (* r_m r_m))))
       (if (<= r_m 4e-116)
         (- (- t_1 (* (* v -0.25) (* w (* r_m t_0)))) 1.5)
         (if (<= r_m 7e+155)
           (- t_1 (fma (* w (fma v -0.25 0.375)) (* t_0 r_m) 1.5))
           (-
            t_1
            (fma
             (/ (* (* (* w (fma -0.25 v 0.375)) r_m) w) (- 1.0 v))
             r_m
             1.5))))))
    r_m = fabs(r);
    double code(double v, double w, double r_m) {
    	double t_0 = (w / (1.0 - v)) * r_m;
    	double t_1 = 2.0 / (r_m * r_m);
    	double tmp;
    	if (r_m <= 4e-116) {
    		tmp = (t_1 - ((v * -0.25) * (w * (r_m * t_0)))) - 1.5;
    	} else if (r_m <= 7e+155) {
    		tmp = t_1 - fma((w * fma(v, -0.25, 0.375)), (t_0 * r_m), 1.5);
    	} else {
    		tmp = t_1 - fma(((((w * fma(-0.25, v, 0.375)) * r_m) * w) / (1.0 - v)), r_m, 1.5);
    	}
    	return tmp;
    }
    
    r_m = abs(r)
    function code(v, w, r_m)
    	t_0 = Float64(Float64(w / Float64(1.0 - v)) * r_m)
    	t_1 = Float64(2.0 / Float64(r_m * r_m))
    	tmp = 0.0
    	if (r_m <= 4e-116)
    		tmp = Float64(Float64(t_1 - Float64(Float64(v * -0.25) * Float64(w * Float64(r_m * t_0)))) - 1.5);
    	elseif (r_m <= 7e+155)
    		tmp = Float64(t_1 - fma(Float64(w * fma(v, -0.25, 0.375)), Float64(t_0 * r_m), 1.5));
    	else
    		tmp = Float64(t_1 - fma(Float64(Float64(Float64(Float64(w * fma(-0.25, v, 0.375)) * r_m) * w) / Float64(1.0 - v)), r_m, 1.5));
    	end
    	return tmp
    end
    
    r_m = N[Abs[r], $MachinePrecision]
    code[v_, w_, r$95$m_] := Block[{t$95$0 = N[(N[(w / N[(1.0 - v), $MachinePrecision]), $MachinePrecision] * r$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 / N[(r$95$m * r$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r$95$m, 4e-116], N[(N[(t$95$1 - N[(N[(v * -0.25), $MachinePrecision] * N[(w * N[(r$95$m * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.5), $MachinePrecision], If[LessEqual[r$95$m, 7e+155], N[(t$95$1 - N[(N[(w * N[(v * -0.25 + 0.375), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * r$95$m), $MachinePrecision] + 1.5), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[(N[(N[(N[(N[(w * N[(-0.25 * v + 0.375), $MachinePrecision]), $MachinePrecision] * r$95$m), $MachinePrecision] * w), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision] * r$95$m + 1.5), $MachinePrecision]), $MachinePrecision]]]]]
    
    \begin{array}{l}
    r_m = \left|r\right|
    
    \\
    \begin{array}{l}
    t_0 := \frac{w}{1 - v} \cdot r\_m\\
    t_1 := \frac{2}{r\_m \cdot r\_m}\\
    \mathbf{if}\;r\_m \leq 4 \cdot 10^{-116}:\\
    \;\;\;\;\left(t\_1 - \left(v \cdot -0.25\right) \cdot \left(w \cdot \left(r\_m \cdot t\_0\right)\right)\right) - 1.5\\
    
    \mathbf{elif}\;r\_m \leq 7 \cdot 10^{+155}:\\
    \;\;\;\;t\_1 - \mathsf{fma}\left(w \cdot \mathsf{fma}\left(v, -0.25, 0.375\right), t\_0 \cdot r\_m, 1.5\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1 - \mathsf{fma}\left(\frac{\left(\left(w \cdot \mathsf{fma}\left(-0.25, v, 0.375\right)\right) \cdot r\_m\right) \cdot w}{1 - v}, r\_m, 1.5\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if r < 4e-116

      1. Initial program 85.5%

        \[\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. Applied rewrites92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\frac{2}{r \cdot r} - \mathsf{fma}\left(\frac{-1}{4}, v, \frac{3}{8}\right) \cdot \left(w \cdot \left(r \cdot \frac{\color{blue}{w \cdot r}}{1 - v}\right)\right)\right) - \frac{3}{2} \]
      4. Applied rewrites96.4%

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

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

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

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

          \[\leadsto \left(\frac{2}{r \cdot r} - \left(v \cdot \left(\frac{3}{8} \cdot \frac{1}{v} - \frac{1}{4}\right)\right) \cdot \left(w \cdot \left(r \cdot \left(\frac{w}{1 - v} \cdot r\right)\right)\right)\right) - \frac{3}{2} \]
        4. lower-/.f6496.4

          \[\leadsto \left(\frac{2}{r \cdot r} - \left(v \cdot \left(0.375 \cdot \frac{1}{v} - 0.25\right)\right) \cdot \left(w \cdot \left(r \cdot \left(\frac{w}{1 - v} \cdot r\right)\right)\right)\right) - 1.5 \]
      7. Applied rewrites96.4%

        \[\leadsto \left(\frac{2}{r \cdot r} - \color{blue}{\left(v \cdot \left(0.375 \cdot \frac{1}{v} - 0.25\right)\right)} \cdot \left(w \cdot \left(r \cdot \left(\frac{w}{1 - v} \cdot r\right)\right)\right)\right) - 1.5 \]
      8. Taylor expanded in v around inf

        \[\leadsto \left(\frac{2}{r \cdot r} - \left(v \cdot \frac{-1}{4}\right) \cdot \left(w \cdot \left(r \cdot \left(\frac{w}{1 - v} \cdot r\right)\right)\right)\right) - \frac{3}{2} \]
      9. Step-by-step derivation
        1. Applied rewrites83.4%

          \[\leadsto \left(\frac{2}{r \cdot r} - \left(v \cdot -0.25\right) \cdot \left(w \cdot \left(r \cdot \left(\frac{w}{1 - v} \cdot r\right)\right)\right)\right) - 1.5 \]

        if 4e-116 < r < 6.99999999999999969e155

        1. Initial program 85.5%

          \[\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. Applied rewrites92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\frac{2}{r \cdot r} - \mathsf{fma}\left(\frac{-1}{4}, v, \frac{3}{8}\right) \cdot \left(w \cdot \left(r \cdot \frac{\color{blue}{w \cdot r}}{1 - v}\right)\right)\right) - \frac{3}{2} \]
        4. Applied rewrites96.4%

          \[\leadsto \left(\frac{2}{r \cdot r} - \color{blue}{\mathsf{fma}\left(-0.25, v, 0.375\right) \cdot \left(w \cdot \left(r \cdot \left(\frac{w}{1 - v} \cdot r\right)\right)\right)}\right) - 1.5 \]
        5. Step-by-step derivation
          1. lift--.f64N/A

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

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

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

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

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

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

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

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

            \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(\color{blue}{w \cdot \mathsf{fma}\left(\frac{-1}{4}, v, \frac{3}{8}\right)}, r \cdot \left(\frac{w}{1 - v} \cdot r\right), \frac{3}{2}\right) \]
          10. lower-*.f6491.4

            \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(\color{blue}{w \cdot \mathsf{fma}\left(-0.25, v, 0.375\right)}, r \cdot \left(\frac{w}{1 - v} \cdot r\right), 1.5\right) \]
          11. lift-fma.f64N/A

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

            \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(w \cdot \left(\color{blue}{v \cdot \frac{-1}{4}} + \frac{3}{8}\right), r \cdot \left(\frac{w}{1 - v} \cdot r\right), \frac{3}{2}\right) \]
          13. lower-fma.f6491.4

            \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(w \cdot \color{blue}{\mathsf{fma}\left(v, -0.25, 0.375\right)}, r \cdot \left(\frac{w}{1 - v} \cdot r\right), 1.5\right) \]
          14. lift-*.f64N/A

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

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

            \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(w \cdot \mathsf{fma}\left(v, -0.25, 0.375\right), \color{blue}{\left(\frac{w}{1 - v} \cdot r\right) \cdot r}, 1.5\right) \]
        6. Applied rewrites91.4%

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

        if 6.99999999999999969e155 < r

        1. Initial program 85.5%

          \[\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. Applied rewrites92.9%

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

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

      Alternative 5: 94.8% accurate, 1.0× speedup?

      \[\begin{array}{l} r_m = \left|r\right| \\ \begin{array}{l} t_0 := \frac{w}{1 - v} \cdot r\_m\\ t_1 := \frac{2}{r\_m \cdot r\_m}\\ \mathbf{if}\;v \leq -2.25 \cdot 10^{+48}:\\ \;\;\;\;\left(t\_1 - \left(v \cdot -0.25\right) \cdot \left(w \cdot \left(r\_m \cdot t\_0\right)\right)\right) - 1.5\\ \mathbf{elif}\;v \leq 1.12 \cdot 10^{-12}:\\ \;\;\;\;\left(t\_1 - \left(\mathsf{fma}\left(v, -0.25, 0.375\right) \cdot \left(\left(w \cdot r\_m\right) \cdot r\_m\right)\right) \cdot w\right) - 1.5\\ \mathbf{else}:\\ \;\;\;\;t\_1 - \mathsf{fma}\left(\left(v \cdot -0.25\right) \cdot \left(w \cdot t\_0\right), r\_m, 1.5\right)\\ \end{array} \end{array} \]
      r_m = (fabs.f64 r)
      (FPCore (v w r_m)
       :precision binary64
       (let* ((t_0 (* (/ w (- 1.0 v)) r_m)) (t_1 (/ 2.0 (* r_m r_m))))
         (if (<= v -2.25e+48)
           (- (- t_1 (* (* v -0.25) (* w (* r_m t_0)))) 1.5)
           (if (<= v 1.12e-12)
             (- (- t_1 (* (* (fma v -0.25 0.375) (* (* w r_m) r_m)) w)) 1.5)
             (- t_1 (fma (* (* v -0.25) (* w t_0)) r_m 1.5))))))
      r_m = fabs(r);
      double code(double v, double w, double r_m) {
      	double t_0 = (w / (1.0 - v)) * r_m;
      	double t_1 = 2.0 / (r_m * r_m);
      	double tmp;
      	if (v <= -2.25e+48) {
      		tmp = (t_1 - ((v * -0.25) * (w * (r_m * t_0)))) - 1.5;
      	} else if (v <= 1.12e-12) {
      		tmp = (t_1 - ((fma(v, -0.25, 0.375) * ((w * r_m) * r_m)) * w)) - 1.5;
      	} else {
      		tmp = t_1 - fma(((v * -0.25) * (w * t_0)), r_m, 1.5);
      	}
      	return tmp;
      }
      
      r_m = abs(r)
      function code(v, w, r_m)
      	t_0 = Float64(Float64(w / Float64(1.0 - v)) * r_m)
      	t_1 = Float64(2.0 / Float64(r_m * r_m))
      	tmp = 0.0
      	if (v <= -2.25e+48)
      		tmp = Float64(Float64(t_1 - Float64(Float64(v * -0.25) * Float64(w * Float64(r_m * t_0)))) - 1.5);
      	elseif (v <= 1.12e-12)
      		tmp = Float64(Float64(t_1 - Float64(Float64(fma(v, -0.25, 0.375) * Float64(Float64(w * r_m) * r_m)) * w)) - 1.5);
      	else
      		tmp = Float64(t_1 - fma(Float64(Float64(v * -0.25) * Float64(w * t_0)), r_m, 1.5));
      	end
      	return tmp
      end
      
      r_m = N[Abs[r], $MachinePrecision]
      code[v_, w_, r$95$m_] := Block[{t$95$0 = N[(N[(w / N[(1.0 - v), $MachinePrecision]), $MachinePrecision] * r$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 / N[(r$95$m * r$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[v, -2.25e+48], N[(N[(t$95$1 - N[(N[(v * -0.25), $MachinePrecision] * N[(w * N[(r$95$m * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.5), $MachinePrecision], If[LessEqual[v, 1.12e-12], N[(N[(t$95$1 - N[(N[(N[(v * -0.25 + 0.375), $MachinePrecision] * N[(N[(w * r$95$m), $MachinePrecision] * r$95$m), $MachinePrecision]), $MachinePrecision] * w), $MachinePrecision]), $MachinePrecision] - 1.5), $MachinePrecision], N[(t$95$1 - N[(N[(N[(v * -0.25), $MachinePrecision] * N[(w * t$95$0), $MachinePrecision]), $MachinePrecision] * r$95$m + 1.5), $MachinePrecision]), $MachinePrecision]]]]]
      
      \begin{array}{l}
      r_m = \left|r\right|
      
      \\
      \begin{array}{l}
      t_0 := \frac{w}{1 - v} \cdot r\_m\\
      t_1 := \frac{2}{r\_m \cdot r\_m}\\
      \mathbf{if}\;v \leq -2.25 \cdot 10^{+48}:\\
      \;\;\;\;\left(t\_1 - \left(v \cdot -0.25\right) \cdot \left(w \cdot \left(r\_m \cdot t\_0\right)\right)\right) - 1.5\\
      
      \mathbf{elif}\;v \leq 1.12 \cdot 10^{-12}:\\
      \;\;\;\;\left(t\_1 - \left(\mathsf{fma}\left(v, -0.25, 0.375\right) \cdot \left(\left(w \cdot r\_m\right) \cdot r\_m\right)\right) \cdot w\right) - 1.5\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1 - \mathsf{fma}\left(\left(v \cdot -0.25\right) \cdot \left(w \cdot t\_0\right), r\_m, 1.5\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if v < -2.24999999999999998e48

        1. Initial program 85.5%

          \[\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. Applied rewrites92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\frac{2}{r \cdot r} - \mathsf{fma}\left(\frac{-1}{4}, v, \frac{3}{8}\right) \cdot \left(w \cdot \left(r \cdot \frac{\color{blue}{w \cdot r}}{1 - v}\right)\right)\right) - \frac{3}{2} \]
        4. Applied rewrites96.4%

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

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

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

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

            \[\leadsto \left(\frac{2}{r \cdot r} - \left(v \cdot \left(\frac{3}{8} \cdot \frac{1}{v} - \frac{1}{4}\right)\right) \cdot \left(w \cdot \left(r \cdot \left(\frac{w}{1 - v} \cdot r\right)\right)\right)\right) - \frac{3}{2} \]
          4. lower-/.f6496.4

            \[\leadsto \left(\frac{2}{r \cdot r} - \left(v \cdot \left(0.375 \cdot \frac{1}{v} - 0.25\right)\right) \cdot \left(w \cdot \left(r \cdot \left(\frac{w}{1 - v} \cdot r\right)\right)\right)\right) - 1.5 \]
        7. Applied rewrites96.4%

          \[\leadsto \left(\frac{2}{r \cdot r} - \color{blue}{\left(v \cdot \left(0.375 \cdot \frac{1}{v} - 0.25\right)\right)} \cdot \left(w \cdot \left(r \cdot \left(\frac{w}{1 - v} \cdot r\right)\right)\right)\right) - 1.5 \]
        8. Taylor expanded in v around inf

          \[\leadsto \left(\frac{2}{r \cdot r} - \left(v \cdot \frac{-1}{4}\right) \cdot \left(w \cdot \left(r \cdot \left(\frac{w}{1 - v} \cdot r\right)\right)\right)\right) - \frac{3}{2} \]
        9. Step-by-step derivation
          1. Applied rewrites83.4%

            \[\leadsto \left(\frac{2}{r \cdot r} - \left(v \cdot -0.25\right) \cdot \left(w \cdot \left(r \cdot \left(\frac{w}{1 - v} \cdot r\right)\right)\right)\right) - 1.5 \]

          if -2.24999999999999998e48 < v < 1.1200000000000001e-12

          1. Initial program 85.5%

            \[\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. Applied rewrites92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(\frac{2}{r \cdot r} - \mathsf{fma}\left(\frac{-1}{4}, v, \frac{3}{8}\right) \cdot \left(w \cdot \left(r \cdot \frac{\color{blue}{w \cdot r}}{1 - v}\right)\right)\right) - \frac{3}{2} \]
          4. Applied rewrites96.4%

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

            \[\leadsto \left(\frac{2}{r \cdot r} - \mathsf{fma}\left(\frac{-1}{4}, v, \frac{3}{8}\right) \cdot \left(w \cdot \left(r \cdot \left(\color{blue}{w} \cdot r\right)\right)\right)\right) - \frac{3}{2} \]
          6. Step-by-step derivation
            1. Applied rewrites79.5%

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

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

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

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

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

                \[\leadsto \left(\frac{2}{r \cdot r} - \color{blue}{\left(\mathsf{fma}\left(\frac{-1}{4}, v, \frac{3}{8}\right) \cdot \left(r \cdot \left(w \cdot r\right)\right)\right) \cdot w}\right) - \frac{3}{2} \]
              6. lower-*.f6479.5

                \[\leadsto \left(\frac{2}{r \cdot r} - \color{blue}{\left(\mathsf{fma}\left(-0.25, v, 0.375\right) \cdot \left(r \cdot \left(w \cdot r\right)\right)\right)} \cdot w\right) - 1.5 \]
              7. lift-fma.f64N/A

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

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

                \[\leadsto \left(\frac{2}{r \cdot r} - \left(\color{blue}{\mathsf{fma}\left(v, -0.25, 0.375\right)} \cdot \left(r \cdot \left(w \cdot r\right)\right)\right) \cdot w\right) - 1.5 \]
              10. lift-*.f64N/A

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

                \[\leadsto \left(\frac{2}{r \cdot r} - \left(\mathsf{fma}\left(v, \frac{-1}{4}, \frac{3}{8}\right) \cdot \color{blue}{\left(\left(w \cdot r\right) \cdot r\right)}\right) \cdot w\right) - \frac{3}{2} \]
              12. lower-*.f6479.5

                \[\leadsto \left(\frac{2}{r \cdot r} - \left(\mathsf{fma}\left(v, -0.25, 0.375\right) \cdot \color{blue}{\left(\left(w \cdot r\right) \cdot r\right)}\right) \cdot w\right) - 1.5 \]
            3. Applied rewrites79.5%

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

            if 1.1200000000000001e-12 < v

            1. Initial program 85.5%

              \[\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. Applied rewrites92.3%

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

              \[\leadsto \left(\frac{2}{r \cdot r} - r \cdot \frac{\left(\color{blue}{\left(\frac{-1}{4} \cdot v\right)} \cdot w\right) \cdot \left(w \cdot r\right)}{1 - v}\right) - \frac{3}{2} \]
            4. Step-by-step derivation
              1. lower-*.f6477.3

                \[\leadsto \left(\frac{2}{r \cdot r} - r \cdot \frac{\left(\left(-0.25 \cdot \color{blue}{v}\right) \cdot w\right) \cdot \left(w \cdot r\right)}{1 - v}\right) - 1.5 \]
            5. Applied rewrites77.3%

              \[\leadsto \left(\frac{2}{r \cdot r} - r \cdot \frac{\left(\color{blue}{\left(-0.25 \cdot v\right)} \cdot w\right) \cdot \left(w \cdot r\right)}{1 - v}\right) - 1.5 \]
            6. Step-by-step derivation
              1. lift--.f64N/A

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

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

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

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

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

                \[\leadsto \frac{2}{r \cdot r} - \left(\color{blue}{\frac{\left(\left(\frac{-1}{4} \cdot v\right) \cdot w\right) \cdot \left(w \cdot r\right)}{1 - v} \cdot r} + \frac{3}{2}\right) \]
              7. lower-fma.f6477.3

                \[\leadsto \frac{2}{r \cdot r} - \color{blue}{\mathsf{fma}\left(\frac{\left(\left(-0.25 \cdot v\right) \cdot w\right) \cdot \left(w \cdot r\right)}{1 - v}, r, 1.5\right)} \]
            7. Applied rewrites80.6%

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

          Alternative 6: 94.7% accurate, 1.1× speedup?

          \[\begin{array}{l} r_m = \left|r\right| \\ \begin{array}{l} t_0 := \frac{w}{1 - v} \cdot r\_m\\ t_1 := \frac{2}{r\_m \cdot r\_m}\\ \mathbf{if}\;r\_m \leq 4 \cdot 10^{-116}:\\ \;\;\;\;\left(t\_1 - \left(v \cdot -0.25\right) \cdot \left(w \cdot \left(r\_m \cdot t\_0\right)\right)\right) - 1.5\\ \mathbf{else}:\\ \;\;\;\;t\_1 - \mathsf{fma}\left(w \cdot \mathsf{fma}\left(v, -0.25, 0.375\right), t\_0 \cdot r\_m, 1.5\right)\\ \end{array} \end{array} \]
          r_m = (fabs.f64 r)
          (FPCore (v w r_m)
           :precision binary64
           (let* ((t_0 (* (/ w (- 1.0 v)) r_m)) (t_1 (/ 2.0 (* r_m r_m))))
             (if (<= r_m 4e-116)
               (- (- t_1 (* (* v -0.25) (* w (* r_m t_0)))) 1.5)
               (- t_1 (fma (* w (fma v -0.25 0.375)) (* t_0 r_m) 1.5)))))
          r_m = fabs(r);
          double code(double v, double w, double r_m) {
          	double t_0 = (w / (1.0 - v)) * r_m;
          	double t_1 = 2.0 / (r_m * r_m);
          	double tmp;
          	if (r_m <= 4e-116) {
          		tmp = (t_1 - ((v * -0.25) * (w * (r_m * t_0)))) - 1.5;
          	} else {
          		tmp = t_1 - fma((w * fma(v, -0.25, 0.375)), (t_0 * r_m), 1.5);
          	}
          	return tmp;
          }
          
          r_m = abs(r)
          function code(v, w, r_m)
          	t_0 = Float64(Float64(w / Float64(1.0 - v)) * r_m)
          	t_1 = Float64(2.0 / Float64(r_m * r_m))
          	tmp = 0.0
          	if (r_m <= 4e-116)
          		tmp = Float64(Float64(t_1 - Float64(Float64(v * -0.25) * Float64(w * Float64(r_m * t_0)))) - 1.5);
          	else
          		tmp = Float64(t_1 - fma(Float64(w * fma(v, -0.25, 0.375)), Float64(t_0 * r_m), 1.5));
          	end
          	return tmp
          end
          
          r_m = N[Abs[r], $MachinePrecision]
          code[v_, w_, r$95$m_] := Block[{t$95$0 = N[(N[(w / N[(1.0 - v), $MachinePrecision]), $MachinePrecision] * r$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 / N[(r$95$m * r$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r$95$m, 4e-116], N[(N[(t$95$1 - N[(N[(v * -0.25), $MachinePrecision] * N[(w * N[(r$95$m * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.5), $MachinePrecision], N[(t$95$1 - N[(N[(w * N[(v * -0.25 + 0.375), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * r$95$m), $MachinePrecision] + 1.5), $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          r_m = \left|r\right|
          
          \\
          \begin{array}{l}
          t_0 := \frac{w}{1 - v} \cdot r\_m\\
          t_1 := \frac{2}{r\_m \cdot r\_m}\\
          \mathbf{if}\;r\_m \leq 4 \cdot 10^{-116}:\\
          \;\;\;\;\left(t\_1 - \left(v \cdot -0.25\right) \cdot \left(w \cdot \left(r\_m \cdot t\_0\right)\right)\right) - 1.5\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1 - \mathsf{fma}\left(w \cdot \mathsf{fma}\left(v, -0.25, 0.375\right), t\_0 \cdot r\_m, 1.5\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if r < 4e-116

            1. Initial program 85.5%

              \[\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. Applied rewrites92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(\frac{2}{r \cdot r} - \mathsf{fma}\left(\frac{-1}{4}, v, \frac{3}{8}\right) \cdot \left(w \cdot \left(r \cdot \frac{\color{blue}{w \cdot r}}{1 - v}\right)\right)\right) - \frac{3}{2} \]
            4. Applied rewrites96.4%

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

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

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

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

                \[\leadsto \left(\frac{2}{r \cdot r} - \left(v \cdot \left(\frac{3}{8} \cdot \frac{1}{v} - \frac{1}{4}\right)\right) \cdot \left(w \cdot \left(r \cdot \left(\frac{w}{1 - v} \cdot r\right)\right)\right)\right) - \frac{3}{2} \]
              4. lower-/.f6496.4

                \[\leadsto \left(\frac{2}{r \cdot r} - \left(v \cdot \left(0.375 \cdot \frac{1}{v} - 0.25\right)\right) \cdot \left(w \cdot \left(r \cdot \left(\frac{w}{1 - v} \cdot r\right)\right)\right)\right) - 1.5 \]
            7. Applied rewrites96.4%

              \[\leadsto \left(\frac{2}{r \cdot r} - \color{blue}{\left(v \cdot \left(0.375 \cdot \frac{1}{v} - 0.25\right)\right)} \cdot \left(w \cdot \left(r \cdot \left(\frac{w}{1 - v} \cdot r\right)\right)\right)\right) - 1.5 \]
            8. Taylor expanded in v around inf

              \[\leadsto \left(\frac{2}{r \cdot r} - \left(v \cdot \frac{-1}{4}\right) \cdot \left(w \cdot \left(r \cdot \left(\frac{w}{1 - v} \cdot r\right)\right)\right)\right) - \frac{3}{2} \]
            9. Step-by-step derivation
              1. Applied rewrites83.4%

                \[\leadsto \left(\frac{2}{r \cdot r} - \left(v \cdot -0.25\right) \cdot \left(w \cdot \left(r \cdot \left(\frac{w}{1 - v} \cdot r\right)\right)\right)\right) - 1.5 \]

              if 4e-116 < r

              1. Initial program 85.5%

                \[\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. Applied rewrites92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\frac{2}{r \cdot r} - \mathsf{fma}\left(\frac{-1}{4}, v, \frac{3}{8}\right) \cdot \left(w \cdot \left(r \cdot \frac{\color{blue}{w \cdot r}}{1 - v}\right)\right)\right) - \frac{3}{2} \]
              4. Applied rewrites96.4%

                \[\leadsto \left(\frac{2}{r \cdot r} - \color{blue}{\mathsf{fma}\left(-0.25, v, 0.375\right) \cdot \left(w \cdot \left(r \cdot \left(\frac{w}{1 - v} \cdot r\right)\right)\right)}\right) - 1.5 \]
              5. Step-by-step derivation
                1. lift--.f64N/A

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(\color{blue}{w \cdot \mathsf{fma}\left(\frac{-1}{4}, v, \frac{3}{8}\right)}, r \cdot \left(\frac{w}{1 - v} \cdot r\right), \frac{3}{2}\right) \]
                10. lower-*.f6491.4

                  \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(\color{blue}{w \cdot \mathsf{fma}\left(-0.25, v, 0.375\right)}, r \cdot \left(\frac{w}{1 - v} \cdot r\right), 1.5\right) \]
                11. lift-fma.f64N/A

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

                  \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(w \cdot \left(\color{blue}{v \cdot \frac{-1}{4}} + \frac{3}{8}\right), r \cdot \left(\frac{w}{1 - v} \cdot r\right), \frac{3}{2}\right) \]
                13. lower-fma.f6491.4

                  \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(w \cdot \color{blue}{\mathsf{fma}\left(v, -0.25, 0.375\right)}, r \cdot \left(\frac{w}{1 - v} \cdot r\right), 1.5\right) \]
                14. lift-*.f64N/A

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

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

                  \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(w \cdot \mathsf{fma}\left(v, -0.25, 0.375\right), \color{blue}{\left(\frac{w}{1 - v} \cdot r\right) \cdot r}, 1.5\right) \]
              6. Applied rewrites91.4%

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

            Alternative 7: 94.2% accurate, 1.0× speedup?

            \[\begin{array}{l} r_m = \left|r\right| \\ \begin{array}{l} t_0 := \frac{2}{r\_m \cdot r\_m}\\ t_1 := t\_0 - \mathsf{fma}\left(\left(v \cdot -0.25\right) \cdot \left(w \cdot \left(\frac{w}{1 - v} \cdot r\_m\right)\right), r\_m, 1.5\right)\\ \mathbf{if}\;v \leq -2.7 \cdot 10^{+48}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;v \leq 1.12 \cdot 10^{-12}:\\ \;\;\;\;\left(t\_0 - \left(\mathsf{fma}\left(v, -0.25, 0.375\right) \cdot \left(\left(w \cdot r\_m\right) \cdot r\_m\right)\right) \cdot w\right) - 1.5\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
            r_m = (fabs.f64 r)
            (FPCore (v w r_m)
             :precision binary64
             (let* ((t_0 (/ 2.0 (* r_m r_m)))
                    (t_1
                     (- t_0 (fma (* (* v -0.25) (* w (* (/ w (- 1.0 v)) r_m))) r_m 1.5))))
               (if (<= v -2.7e+48)
                 t_1
                 (if (<= v 1.12e-12)
                   (- (- t_0 (* (* (fma v -0.25 0.375) (* (* w r_m) r_m)) w)) 1.5)
                   t_1))))
            r_m = fabs(r);
            double code(double v, double w, double r_m) {
            	double t_0 = 2.0 / (r_m * r_m);
            	double t_1 = t_0 - fma(((v * -0.25) * (w * ((w / (1.0 - v)) * r_m))), r_m, 1.5);
            	double tmp;
            	if (v <= -2.7e+48) {
            		tmp = t_1;
            	} else if (v <= 1.12e-12) {
            		tmp = (t_0 - ((fma(v, -0.25, 0.375) * ((w * r_m) * r_m)) * w)) - 1.5;
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            r_m = abs(r)
            function code(v, w, r_m)
            	t_0 = Float64(2.0 / Float64(r_m * r_m))
            	t_1 = Float64(t_0 - fma(Float64(Float64(v * -0.25) * Float64(w * Float64(Float64(w / Float64(1.0 - v)) * r_m))), r_m, 1.5))
            	tmp = 0.0
            	if (v <= -2.7e+48)
            		tmp = t_1;
            	elseif (v <= 1.12e-12)
            		tmp = Float64(Float64(t_0 - Float64(Float64(fma(v, -0.25, 0.375) * Float64(Float64(w * r_m) * r_m)) * w)) - 1.5);
            	else
            		tmp = t_1;
            	end
            	return tmp
            end
            
            r_m = N[Abs[r], $MachinePrecision]
            code[v_, w_, r$95$m_] := Block[{t$95$0 = N[(2.0 / N[(r$95$m * r$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[(N[(N[(v * -0.25), $MachinePrecision] * N[(w * N[(N[(w / N[(1.0 - v), $MachinePrecision]), $MachinePrecision] * r$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * r$95$m + 1.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[v, -2.7e+48], t$95$1, If[LessEqual[v, 1.12e-12], N[(N[(t$95$0 - N[(N[(N[(v * -0.25 + 0.375), $MachinePrecision] * N[(N[(w * r$95$m), $MachinePrecision] * r$95$m), $MachinePrecision]), $MachinePrecision] * w), $MachinePrecision]), $MachinePrecision] - 1.5), $MachinePrecision], t$95$1]]]]
            
            \begin{array}{l}
            r_m = \left|r\right|
            
            \\
            \begin{array}{l}
            t_0 := \frac{2}{r\_m \cdot r\_m}\\
            t_1 := t\_0 - \mathsf{fma}\left(\left(v \cdot -0.25\right) \cdot \left(w \cdot \left(\frac{w}{1 - v} \cdot r\_m\right)\right), r\_m, 1.5\right)\\
            \mathbf{if}\;v \leq -2.7 \cdot 10^{+48}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;v \leq 1.12 \cdot 10^{-12}:\\
            \;\;\;\;\left(t\_0 - \left(\mathsf{fma}\left(v, -0.25, 0.375\right) \cdot \left(\left(w \cdot r\_m\right) \cdot r\_m\right)\right) \cdot w\right) - 1.5\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if v < -2.70000000000000004e48 or 1.1200000000000001e-12 < v

              1. Initial program 85.5%

                \[\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. Applied rewrites92.3%

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

                \[\leadsto \left(\frac{2}{r \cdot r} - r \cdot \frac{\left(\color{blue}{\left(\frac{-1}{4} \cdot v\right)} \cdot w\right) \cdot \left(w \cdot r\right)}{1 - v}\right) - \frac{3}{2} \]
              4. Step-by-step derivation
                1. lower-*.f6477.3

                  \[\leadsto \left(\frac{2}{r \cdot r} - r \cdot \frac{\left(\left(-0.25 \cdot \color{blue}{v}\right) \cdot w\right) \cdot \left(w \cdot r\right)}{1 - v}\right) - 1.5 \]
              5. Applied rewrites77.3%

                \[\leadsto \left(\frac{2}{r \cdot r} - r \cdot \frac{\left(\color{blue}{\left(-0.25 \cdot v\right)} \cdot w\right) \cdot \left(w \cdot r\right)}{1 - v}\right) - 1.5 \]
              6. Step-by-step derivation
                1. lift--.f64N/A

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

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

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

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

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

                  \[\leadsto \frac{2}{r \cdot r} - \left(\color{blue}{\frac{\left(\left(\frac{-1}{4} \cdot v\right) \cdot w\right) \cdot \left(w \cdot r\right)}{1 - v} \cdot r} + \frac{3}{2}\right) \]
                7. lower-fma.f6477.3

                  \[\leadsto \frac{2}{r \cdot r} - \color{blue}{\mathsf{fma}\left(\frac{\left(\left(-0.25 \cdot v\right) \cdot w\right) \cdot \left(w \cdot r\right)}{1 - v}, r, 1.5\right)} \]
              7. Applied rewrites80.6%

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

              if -2.70000000000000004e48 < v < 1.1200000000000001e-12

              1. Initial program 85.5%

                \[\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. Applied rewrites92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\frac{2}{r \cdot r} - \mathsf{fma}\left(\frac{-1}{4}, v, \frac{3}{8}\right) \cdot \left(w \cdot \left(r \cdot \frac{\color{blue}{w \cdot r}}{1 - v}\right)\right)\right) - \frac{3}{2} \]
              4. Applied rewrites96.4%

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

                \[\leadsto \left(\frac{2}{r \cdot r} - \mathsf{fma}\left(\frac{-1}{4}, v, \frac{3}{8}\right) \cdot \left(w \cdot \left(r \cdot \left(\color{blue}{w} \cdot r\right)\right)\right)\right) - \frac{3}{2} \]
              6. Step-by-step derivation
                1. Applied rewrites79.5%

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

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

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

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

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

                    \[\leadsto \left(\frac{2}{r \cdot r} - \color{blue}{\left(\mathsf{fma}\left(\frac{-1}{4}, v, \frac{3}{8}\right) \cdot \left(r \cdot \left(w \cdot r\right)\right)\right) \cdot w}\right) - \frac{3}{2} \]
                  6. lower-*.f6479.5

                    \[\leadsto \left(\frac{2}{r \cdot r} - \color{blue}{\left(\mathsf{fma}\left(-0.25, v, 0.375\right) \cdot \left(r \cdot \left(w \cdot r\right)\right)\right)} \cdot w\right) - 1.5 \]
                  7. lift-fma.f64N/A

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

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

                    \[\leadsto \left(\frac{2}{r \cdot r} - \left(\color{blue}{\mathsf{fma}\left(v, -0.25, 0.375\right)} \cdot \left(r \cdot \left(w \cdot r\right)\right)\right) \cdot w\right) - 1.5 \]
                  10. lift-*.f64N/A

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

                    \[\leadsto \left(\frac{2}{r \cdot r} - \left(\mathsf{fma}\left(v, \frac{-1}{4}, \frac{3}{8}\right) \cdot \color{blue}{\left(\left(w \cdot r\right) \cdot r\right)}\right) \cdot w\right) - \frac{3}{2} \]
                  12. lower-*.f6479.5

                    \[\leadsto \left(\frac{2}{r \cdot r} - \left(\mathsf{fma}\left(v, -0.25, 0.375\right) \cdot \color{blue}{\left(\left(w \cdot r\right) \cdot r\right)}\right) \cdot w\right) - 1.5 \]
                3. Applied rewrites79.5%

                  \[\leadsto \left(\frac{2}{r \cdot r} - \color{blue}{\left(\mathsf{fma}\left(v, -0.25, 0.375\right) \cdot \left(\left(w \cdot r\right) \cdot r\right)\right) \cdot w}\right) - 1.5 \]
              7. Recombined 2 regimes into one program.
              8. Add Preprocessing

              Alternative 8: 92.8% accurate, 1.3× speedup?

              \[\begin{array}{l} r_m = \left|r\right| \\ \begin{array}{l} \mathbf{if}\;r\_m \leq 4.6 \cdot 10^{-101}:\\ \;\;\;\;\frac{\frac{2}{r\_m}}{r\_m}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{2}{r\_m \cdot r\_m} - r\_m \cdot \frac{\left(0.375 \cdot w\right) \cdot \left(w \cdot r\_m\right)}{1}\right) - 1.5\\ \end{array} \end{array} \]
              r_m = (fabs.f64 r)
              (FPCore (v w r_m)
               :precision binary64
               (if (<= r_m 4.6e-101)
                 (/ (/ 2.0 r_m) r_m)
                 (- (- (/ 2.0 (* r_m r_m)) (* r_m (/ (* (* 0.375 w) (* w r_m)) 1.0))) 1.5)))
              r_m = fabs(r);
              double code(double v, double w, double r_m) {
              	double tmp;
              	if (r_m <= 4.6e-101) {
              		tmp = (2.0 / r_m) / r_m;
              	} else {
              		tmp = ((2.0 / (r_m * r_m)) - (r_m * (((0.375 * w) * (w * r_m)) / 1.0))) - 1.5;
              	}
              	return tmp;
              }
              
              r_m =     private
              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_m)
              use fmin_fmax_functions
                  real(8), intent (in) :: v
                  real(8), intent (in) :: w
                  real(8), intent (in) :: r_m
                  real(8) :: tmp
                  if (r_m <= 4.6d-101) then
                      tmp = (2.0d0 / r_m) / r_m
                  else
                      tmp = ((2.0d0 / (r_m * r_m)) - (r_m * (((0.375d0 * w) * (w * r_m)) / 1.0d0))) - 1.5d0
                  end if
                  code = tmp
              end function
              
              r_m = Math.abs(r);
              public static double code(double v, double w, double r_m) {
              	double tmp;
              	if (r_m <= 4.6e-101) {
              		tmp = (2.0 / r_m) / r_m;
              	} else {
              		tmp = ((2.0 / (r_m * r_m)) - (r_m * (((0.375 * w) * (w * r_m)) / 1.0))) - 1.5;
              	}
              	return tmp;
              }
              
              r_m = math.fabs(r)
              def code(v, w, r_m):
              	tmp = 0
              	if r_m <= 4.6e-101:
              		tmp = (2.0 / r_m) / r_m
              	else:
              		tmp = ((2.0 / (r_m * r_m)) - (r_m * (((0.375 * w) * (w * r_m)) / 1.0))) - 1.5
              	return tmp
              
              r_m = abs(r)
              function code(v, w, r_m)
              	tmp = 0.0
              	if (r_m <= 4.6e-101)
              		tmp = Float64(Float64(2.0 / r_m) / r_m);
              	else
              		tmp = Float64(Float64(Float64(2.0 / Float64(r_m * r_m)) - Float64(r_m * Float64(Float64(Float64(0.375 * w) * Float64(w * r_m)) / 1.0))) - 1.5);
              	end
              	return tmp
              end
              
              r_m = abs(r);
              function tmp_2 = code(v, w, r_m)
              	tmp = 0.0;
              	if (r_m <= 4.6e-101)
              		tmp = (2.0 / r_m) / r_m;
              	else
              		tmp = ((2.0 / (r_m * r_m)) - (r_m * (((0.375 * w) * (w * r_m)) / 1.0))) - 1.5;
              	end
              	tmp_2 = tmp;
              end
              
              r_m = N[Abs[r], $MachinePrecision]
              code[v_, w_, r$95$m_] := If[LessEqual[r$95$m, 4.6e-101], N[(N[(2.0 / r$95$m), $MachinePrecision] / r$95$m), $MachinePrecision], N[(N[(N[(2.0 / N[(r$95$m * r$95$m), $MachinePrecision]), $MachinePrecision] - N[(r$95$m * N[(N[(N[(0.375 * w), $MachinePrecision] * N[(w * r$95$m), $MachinePrecision]), $MachinePrecision] / 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.5), $MachinePrecision]]
              
              \begin{array}{l}
              r_m = \left|r\right|
              
              \\
              \begin{array}{l}
              \mathbf{if}\;r\_m \leq 4.6 \cdot 10^{-101}:\\
              \;\;\;\;\frac{\frac{2}{r\_m}}{r\_m}\\
              
              \mathbf{else}:\\
              \;\;\;\;\left(\frac{2}{r\_m \cdot r\_m} - r\_m \cdot \frac{\left(0.375 \cdot w\right) \cdot \left(w \cdot r\_m\right)}{1}\right) - 1.5\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if r < 4.5999999999999999e-101

                1. Initial program 85.5%

                  \[\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. Taylor expanded in r around 0

                  \[\leadsto \color{blue}{\frac{2}{{r}^{2}}} \]
                3. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto \frac{2}{\color{blue}{{r}^{2}}} \]
                  2. lower-pow.f6444.1

                    \[\leadsto \frac{2}{{r}^{\color{blue}{2}}} \]
                4. Applied rewrites44.1%

                  \[\leadsto \color{blue}{\frac{2}{{r}^{2}}} \]
                5. Step-by-step derivation
                  1. lift-/.f64N/A

                    \[\leadsto \frac{2}{\color{blue}{{r}^{2}}} \]
                  2. lift-pow.f64N/A

                    \[\leadsto \frac{2}{{r}^{\color{blue}{2}}} \]
                  3. pow2N/A

                    \[\leadsto \frac{2}{r \cdot \color{blue}{r}} \]
                  4. lift-*.f64N/A

                    \[\leadsto \frac{2}{r \cdot \color{blue}{r}} \]
                  5. lift-/.f6444.1

                    \[\leadsto \frac{2}{\color{blue}{r \cdot r}} \]
                6. Applied rewrites44.1%

                  \[\leadsto \color{blue}{\frac{2}{r \cdot r}} \]
                7. Step-by-step derivation
                  1. lift-/.f64N/A

                    \[\leadsto \frac{2}{\color{blue}{r \cdot r}} \]
                  2. lift-*.f64N/A

                    \[\leadsto \frac{2}{r \cdot \color{blue}{r}} \]
                  3. associate-/r*N/A

                    \[\leadsto \frac{\frac{2}{r}}{\color{blue}{r}} \]
                  4. lower-/.f64N/A

                    \[\leadsto \frac{\frac{2}{r}}{\color{blue}{r}} \]
                  5. lower-/.f6444.1

                    \[\leadsto \frac{\frac{2}{r}}{r} \]
                8. Applied rewrites44.1%

                  \[\leadsto \frac{\frac{2}{r}}{\color{blue}{r}} \]

                if 4.5999999999999999e-101 < r

                1. Initial program 85.5%

                  \[\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. Applied rewrites92.3%

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

                  \[\leadsto \left(\frac{2}{r \cdot r} - r \cdot \frac{\left(\color{blue}{\frac{3}{8}} \cdot w\right) \cdot \left(w \cdot r\right)}{1 - v}\right) - \frac{3}{2} \]
                4. Step-by-step derivation
                  1. Applied rewrites82.7%

                    \[\leadsto \left(\frac{2}{r \cdot r} - r \cdot \frac{\left(\color{blue}{0.375} \cdot w\right) \cdot \left(w \cdot r\right)}{1 - v}\right) - 1.5 \]
                  2. Taylor expanded in v around 0

                    \[\leadsto \left(\frac{2}{r \cdot r} - r \cdot \frac{\left(\frac{3}{8} \cdot w\right) \cdot \left(w \cdot r\right)}{\color{blue}{1}}\right) - \frac{3}{2} \]
                  3. Step-by-step derivation
                    1. Applied rewrites91.4%

                      \[\leadsto \left(\frac{2}{r \cdot r} - r \cdot \frac{\left(0.375 \cdot w\right) \cdot \left(w \cdot r\right)}{\color{blue}{1}}\right) - 1.5 \]
                  4. Recombined 2 regimes into one program.
                  5. Add Preprocessing

                  Alternative 9: 91.3% accurate, 0.6× speedup?

                  \[\begin{array}{l} r_m = \left|r\right| \\ \begin{array}{l} t_0 := \frac{2}{r\_m \cdot r\_m}\\ \mathbf{if}\;\left(\left(3 + t\_0\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\_m\right) \cdot r\_m\right)}{1 - v}\right) - 4.5 \leq -4000000000000:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.25, v, 0.375\right), \left(\frac{r\_m}{v - 1} \cdot r\_m\right) \cdot \left(w \cdot w\right), -1.5\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t\_0 - -3\right) - 4.5\\ \end{array} \end{array} \]
                  r_m = (fabs.f64 r)
                  (FPCore (v w r_m)
                   :precision binary64
                   (let* ((t_0 (/ 2.0 (* r_m r_m))))
                     (if (<=
                          (-
                           (-
                            (+ 3.0 t_0)
                            (/
                             (* (* 0.125 (- 3.0 (* 2.0 v))) (* (* (* w w) r_m) r_m))
                             (- 1.0 v)))
                           4.5)
                          -4000000000000.0)
                       (fma (fma -0.25 v 0.375) (* (* (/ r_m (- v 1.0)) r_m) (* w w)) -1.5)
                       (- (- t_0 -3.0) 4.5))))
                  r_m = fabs(r);
                  double code(double v, double w, double r_m) {
                  	double t_0 = 2.0 / (r_m * r_m);
                  	double tmp;
                  	if ((((3.0 + t_0) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r_m) * r_m)) / (1.0 - v))) - 4.5) <= -4000000000000.0) {
                  		tmp = fma(fma(-0.25, v, 0.375), (((r_m / (v - 1.0)) * r_m) * (w * w)), -1.5);
                  	} else {
                  		tmp = (t_0 - -3.0) - 4.5;
                  	}
                  	return tmp;
                  }
                  
                  r_m = abs(r)
                  function code(v, w, r_m)
                  	t_0 = Float64(2.0 / Float64(r_m * r_m))
                  	tmp = 0.0
                  	if (Float64(Float64(Float64(3.0 + t_0) - Float64(Float64(Float64(0.125 * Float64(3.0 - Float64(2.0 * v))) * Float64(Float64(Float64(w * w) * r_m) * r_m)) / Float64(1.0 - v))) - 4.5) <= -4000000000000.0)
                  		tmp = fma(fma(-0.25, v, 0.375), Float64(Float64(Float64(r_m / Float64(v - 1.0)) * r_m) * Float64(w * w)), -1.5);
                  	else
                  		tmp = Float64(Float64(t_0 - -3.0) - 4.5);
                  	end
                  	return tmp
                  end
                  
                  r_m = N[Abs[r], $MachinePrecision]
                  code[v_, w_, r$95$m_] := Block[{t$95$0 = N[(2.0 / N[(r$95$m * r$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(3.0 + t$95$0), $MachinePrecision] - N[(N[(N[(0.125 * N[(3.0 - N[(2.0 * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(w * w), $MachinePrecision] * r$95$m), $MachinePrecision] * r$95$m), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision], -4000000000000.0], N[(N[(-0.25 * v + 0.375), $MachinePrecision] * N[(N[(N[(r$95$m / N[(v - 1.0), $MachinePrecision]), $MachinePrecision] * r$95$m), $MachinePrecision] * N[(w * w), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision], N[(N[(t$95$0 - -3.0), $MachinePrecision] - 4.5), $MachinePrecision]]]
                  
                  \begin{array}{l}
                  r_m = \left|r\right|
                  
                  \\
                  \begin{array}{l}
                  t_0 := \frac{2}{r\_m \cdot r\_m}\\
                  \mathbf{if}\;\left(\left(3 + t\_0\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\_m\right) \cdot r\_m\right)}{1 - v}\right) - 4.5 \leq -4000000000000:\\
                  \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.25, v, 0.375\right), \left(\frac{r\_m}{v - 1} \cdot r\_m\right) \cdot \left(w \cdot w\right), -1.5\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\left(t\_0 - -3\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)) < -4e12

                    1. Initial program 85.5%

                      \[\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. Applied rewrites92.9%

                      \[\leadsto \color{blue}{\left(\frac{2}{r \cdot r} - \mathsf{fma}\left(\mathsf{fma}\left(v, -0.25, 0.375\right) \cdot r, \left(w \cdot r\right) \cdot \frac{w}{1 - v}, -3\right)\right)} - 4.5 \]
                    3. Applied rewrites83.8%

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

                      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{4}, v, \frac{3}{8}\right), \left(\frac{r}{v - 1} \cdot r\right) \cdot \left(w \cdot w\right), \color{blue}{\frac{-3}{2}}\right) \]
                    5. Step-by-step derivation
                      1. Applied rewrites47.5%

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

                      if -4e12 < (-.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 85.5%

                        \[\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. Applied rewrites92.9%

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

                        \[\leadsto \left(\frac{2}{r \cdot r} - \color{blue}{-3}\right) - \frac{9}{2} \]
                      4. Step-by-step derivation
                        1. Applied rewrites57.8%

                          \[\leadsto \left(\frac{2}{r \cdot r} - \color{blue}{-3}\right) - 4.5 \]
                      5. Recombined 2 regimes into one program.
                      6. Add Preprocessing

                      Alternative 10: 57.8% accurate, 3.3× speedup?

                      \[\begin{array}{l} r_m = \left|r\right| \\ \left(\frac{2}{r\_m \cdot r\_m} - -3\right) - 4.5 \end{array} \]
                      r_m = (fabs.f64 r)
                      (FPCore (v w r_m) :precision binary64 (- (- (/ 2.0 (* r_m r_m)) -3.0) 4.5))
                      r_m = fabs(r);
                      double code(double v, double w, double r_m) {
                      	return ((2.0 / (r_m * r_m)) - -3.0) - 4.5;
                      }
                      
                      r_m =     private
                      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_m)
                      use fmin_fmax_functions
                          real(8), intent (in) :: v
                          real(8), intent (in) :: w
                          real(8), intent (in) :: r_m
                          code = ((2.0d0 / (r_m * r_m)) - (-3.0d0)) - 4.5d0
                      end function
                      
                      r_m = Math.abs(r);
                      public static double code(double v, double w, double r_m) {
                      	return ((2.0 / (r_m * r_m)) - -3.0) - 4.5;
                      }
                      
                      r_m = math.fabs(r)
                      def code(v, w, r_m):
                      	return ((2.0 / (r_m * r_m)) - -3.0) - 4.5
                      
                      r_m = abs(r)
                      function code(v, w, r_m)
                      	return Float64(Float64(Float64(2.0 / Float64(r_m * r_m)) - -3.0) - 4.5)
                      end
                      
                      r_m = abs(r);
                      function tmp = code(v, w, r_m)
                      	tmp = ((2.0 / (r_m * r_m)) - -3.0) - 4.5;
                      end
                      
                      r_m = N[Abs[r], $MachinePrecision]
                      code[v_, w_, r$95$m_] := N[(N[(N[(2.0 / N[(r$95$m * r$95$m), $MachinePrecision]), $MachinePrecision] - -3.0), $MachinePrecision] - 4.5), $MachinePrecision]
                      
                      \begin{array}{l}
                      r_m = \left|r\right|
                      
                      \\
                      \left(\frac{2}{r\_m \cdot r\_m} - -3\right) - 4.5
                      \end{array}
                      
                      Derivation
                      1. Initial program 85.5%

                        \[\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. Applied rewrites92.9%

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

                        \[\leadsto \left(\frac{2}{r \cdot r} - \color{blue}{-3}\right) - \frac{9}{2} \]
                      4. Step-by-step derivation
                        1. Applied rewrites57.8%

                          \[\leadsto \left(\frac{2}{r \cdot r} - \color{blue}{-3}\right) - 4.5 \]
                        2. Add Preprocessing

                        Alternative 11: 44.1% accurate, 5.7× speedup?

                        \[\begin{array}{l} r_m = \left|r\right| \\ \frac{2}{r\_m \cdot r\_m} \end{array} \]
                        r_m = (fabs.f64 r)
                        (FPCore (v w r_m) :precision binary64 (/ 2.0 (* r_m r_m)))
                        r_m = fabs(r);
                        double code(double v, double w, double r_m) {
                        	return 2.0 / (r_m * r_m);
                        }
                        
                        r_m =     private
                        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_m)
                        use fmin_fmax_functions
                            real(8), intent (in) :: v
                            real(8), intent (in) :: w
                            real(8), intent (in) :: r_m
                            code = 2.0d0 / (r_m * r_m)
                        end function
                        
                        r_m = Math.abs(r);
                        public static double code(double v, double w, double r_m) {
                        	return 2.0 / (r_m * r_m);
                        }
                        
                        r_m = math.fabs(r)
                        def code(v, w, r_m):
                        	return 2.0 / (r_m * r_m)
                        
                        r_m = abs(r)
                        function code(v, w, r_m)
                        	return Float64(2.0 / Float64(r_m * r_m))
                        end
                        
                        r_m = abs(r);
                        function tmp = code(v, w, r_m)
                        	tmp = 2.0 / (r_m * r_m);
                        end
                        
                        r_m = N[Abs[r], $MachinePrecision]
                        code[v_, w_, r$95$m_] := N[(2.0 / N[(r$95$m * r$95$m), $MachinePrecision]), $MachinePrecision]
                        
                        \begin{array}{l}
                        r_m = \left|r\right|
                        
                        \\
                        \frac{2}{r\_m \cdot r\_m}
                        \end{array}
                        
                        Derivation
                        1. Initial program 85.5%

                          \[\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. Taylor expanded in r around 0

                          \[\leadsto \color{blue}{\frac{2}{{r}^{2}}} \]
                        3. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto \frac{2}{\color{blue}{{r}^{2}}} \]
                          2. lower-pow.f6444.1

                            \[\leadsto \frac{2}{{r}^{\color{blue}{2}}} \]
                        4. Applied rewrites44.1%

                          \[\leadsto \color{blue}{\frac{2}{{r}^{2}}} \]
                        5. Step-by-step derivation
                          1. lift-/.f64N/A

                            \[\leadsto \frac{2}{\color{blue}{{r}^{2}}} \]
                          2. lift-pow.f64N/A

                            \[\leadsto \frac{2}{{r}^{\color{blue}{2}}} \]
                          3. pow2N/A

                            \[\leadsto \frac{2}{r \cdot \color{blue}{r}} \]
                          4. lift-*.f64N/A

                            \[\leadsto \frac{2}{r \cdot \color{blue}{r}} \]
                          5. lift-/.f6444.1

                            \[\leadsto \frac{2}{\color{blue}{r \cdot r}} \]
                        6. Applied rewrites44.1%

                          \[\leadsto \color{blue}{\frac{2}{r \cdot r}} \]
                        7. Add Preprocessing

                        Reproduce

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