Rosa's TurbineBenchmark

Percentage Accurate: 84.9% → 99.7%
Time: 4.3s
Alternatives: 18
Speedup: 1.8×

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 18 alternatives:

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

Initial Program: 84.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \end{array} \]
(FPCore (v w r)
 :precision binary64
 (-
  (-
   (+ 3.0 (/ 2.0 (* r r)))
   (/ (* (* 0.125 (- 3.0 (* 2.0 v))) (* (* (* w w) r) r)) (- 1.0 v)))
  4.5))
double code(double v, double w, double r) {
	return ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(v, w, r)
use fmin_fmax_functions
    real(8), intent (in) :: v
    real(8), intent (in) :: w
    real(8), intent (in) :: r
    code = ((3.0d0 + (2.0d0 / (r * r))) - (((0.125d0 * (3.0d0 - (2.0d0 * v))) * (((w * w) * r) * r)) / (1.0d0 - v))) - 4.5d0
end function
public static double code(double v, double w, double r) {
	return ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5;
}
def code(v, w, r):
	return ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5
function code(v, w, r)
	return Float64(Float64(Float64(3.0 + Float64(2.0 / Float64(r * r))) - Float64(Float64(Float64(0.125 * Float64(3.0 - Float64(2.0 * v))) * Float64(Float64(Float64(w * w) * r) * r)) / Float64(1.0 - v))) - 4.5)
end
function tmp = code(v, w, r)
	tmp = ((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5;
end
code[v_, w_, r_] := N[(N[(N[(3.0 + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(0.125 * N[(3.0 - N[(2.0 * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(w * w), $MachinePrecision] * r), $MachinePrecision] * r), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5
\end{array}

Alternative 1: 99.7% accurate, 1.0× speedup?

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

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

    \[\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 rewrites99.7%

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

Alternative 2: 99.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}\\ t_1 := \frac{2}{r \cdot r} + 3\\ t_2 := t\_1 - \mathsf{fma}\left(-0.25 \cdot v, t\_0, 4.5\right)\\ \mathbf{if}\;v \leq -7800000000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;v \leq 0.045:\\ \;\;\;\;t\_1 - \mathsf{fma}\left(0.375, t\_0, 4.5\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (v w r)
 :precision binary64
 (let* ((t_0 (/ (* (* r w) (* r w)) (- 1.0 v)))
        (t_1 (+ (/ 2.0 (* r r)) 3.0))
        (t_2 (- t_1 (fma (* -0.25 v) t_0 4.5))))
   (if (<= v -7800000000.0)
     t_2
     (if (<= v 0.045) (- t_1 (fma 0.375 t_0 4.5)) t_2))))
double code(double v, double w, double r) {
	double t_0 = ((r * w) * (r * w)) / (1.0 - v);
	double t_1 = (2.0 / (r * r)) + 3.0;
	double t_2 = t_1 - fma((-0.25 * v), t_0, 4.5);
	double tmp;
	if (v <= -7800000000.0) {
		tmp = t_2;
	} else if (v <= 0.045) {
		tmp = t_1 - fma(0.375, t_0, 4.5);
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(v, w, r)
	t_0 = Float64(Float64(Float64(r * w) * Float64(r * w)) / Float64(1.0 - v))
	t_1 = Float64(Float64(2.0 / Float64(r * r)) + 3.0)
	t_2 = Float64(t_1 - fma(Float64(-0.25 * v), t_0, 4.5))
	tmp = 0.0
	if (v <= -7800000000.0)
		tmp = t_2;
	elseif (v <= 0.045)
		tmp = Float64(t_1 - fma(0.375, t_0, 4.5));
	else
		tmp = t_2;
	end
	return tmp
end
code[v_, w_, r_] := Block[{t$95$0 = N[(N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[(N[(-0.25 * v), $MachinePrecision] * t$95$0 + 4.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[v, -7800000000.0], t$95$2, If[LessEqual[v, 0.045], N[(t$95$1 - N[(0.375 * t$95$0 + 4.5), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}\\
t_1 := \frac{2}{r \cdot r} + 3\\
t_2 := t\_1 - \mathsf{fma}\left(-0.25 \cdot v, t\_0, 4.5\right)\\
\mathbf{if}\;v \leq -7800000000:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;v \leq 0.045:\\
\;\;\;\;t\_1 - \mathsf{fma}\left(0.375, t\_0, 4.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if v < -7.8e9 or 0.044999999999999998 < v

    1. Initial program 81.7%

      \[\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 rewrites99.7%

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

      \[\leadsto \left(\frac{2}{r \cdot r} + 3\right) - \mathsf{fma}\left(\color{blue}{\frac{-1}{4} \cdot v}, \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}, \frac{9}{2}\right) \]
    4. Step-by-step derivation
      1. lower-*.f6499.5

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

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

    if -7.8e9 < v < 0.044999999999999998

    1. Initial program 88.0%

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

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

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

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

    Alternative 3: 98.2% accurate, 0.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}\\ t_1 := \frac{2}{r \cdot r}\\ \mathbf{if}\;\left(\left(3 + t\_1\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 \leq -50000000000000:\\ \;\;\;\;t\_1 - \mathsf{fma}\left(\left(\frac{0.375}{v} - 0.25\right) \cdot v, t\_0, 4.5\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t\_1 + 3\right) - \mathsf{fma}\left(-0.25 \cdot v, t\_0, 4.5\right)\\ \end{array} \end{array} \]
    (FPCore (v w r)
     :precision binary64
     (let* ((t_0 (/ (* (* r w) (* r w)) (- 1.0 v))) (t_1 (/ 2.0 (* r r))))
       (if (<=
            (-
             (-
              (+ 3.0 t_1)
              (/ (* (* 0.125 (- 3.0 (* 2.0 v))) (* (* (* w w) r) r)) (- 1.0 v)))
             4.5)
            -50000000000000.0)
         (- t_1 (fma (* (- (/ 0.375 v) 0.25) v) t_0 4.5))
         (- (+ t_1 3.0) (fma (* -0.25 v) t_0 4.5)))))
    double code(double v, double w, double r) {
    	double t_0 = ((r * w) * (r * w)) / (1.0 - v);
    	double t_1 = 2.0 / (r * r);
    	double tmp;
    	if ((((3.0 + t_1) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5) <= -50000000000000.0) {
    		tmp = t_1 - fma((((0.375 / v) - 0.25) * v), t_0, 4.5);
    	} else {
    		tmp = (t_1 + 3.0) - fma((-0.25 * v), t_0, 4.5);
    	}
    	return tmp;
    }
    
    function code(v, w, r)
    	t_0 = Float64(Float64(Float64(r * w) * Float64(r * w)) / Float64(1.0 - v))
    	t_1 = Float64(2.0 / Float64(r * r))
    	tmp = 0.0
    	if (Float64(Float64(Float64(3.0 + t_1) - 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) <= -50000000000000.0)
    		tmp = Float64(t_1 - fma(Float64(Float64(Float64(0.375 / v) - 0.25) * v), t_0, 4.5));
    	else
    		tmp = Float64(Float64(t_1 + 3.0) - fma(Float64(-0.25 * v), t_0, 4.5));
    	end
    	return tmp
    end
    
    code[v_, w_, r_] := Block[{t$95$0 = N[(N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(3.0 + t$95$1), $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], -50000000000000.0], N[(t$95$1 - N[(N[(N[(N[(0.375 / v), $MachinePrecision] - 0.25), $MachinePrecision] * v), $MachinePrecision] * t$95$0 + 4.5), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + 3.0), $MachinePrecision] - N[(N[(-0.25 * v), $MachinePrecision] * t$95$0 + 4.5), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}\\
    t_1 := \frac{2}{r \cdot r}\\
    \mathbf{if}\;\left(\left(3 + t\_1\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 \leq -50000000000000:\\
    \;\;\;\;t\_1 - \mathsf{fma}\left(\left(\frac{0.375}{v} - 0.25\right) \cdot v, t\_0, 4.5\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(t\_1 + 3\right) - \mathsf{fma}\left(-0.25 \cdot v, t\_0, 4.5\right)\\
    
    
    \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)) < -5e13

      1. Initial program 85.7%

        \[\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 rewrites99.6%

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

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

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

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

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

          \[\leadsto \left(\frac{2}{r \cdot r} + 3\right) - \mathsf{fma}\left(\left(\frac{\frac{3}{8} \cdot 1}{v} - \frac{1}{4}\right) \cdot v, \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}, \frac{9}{2}\right) \]
        5. metadata-evalN/A

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

          \[\leadsto \left(\frac{2}{r \cdot r} + 3\right) - \mathsf{fma}\left(\left(\frac{0.375}{v} - 0.25\right) \cdot v, \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}, 4.5\right) \]
      5. Applied rewrites99.6%

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

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

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

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

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

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

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

      if -5e13 < (-.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 84.4%

        \[\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 rewrites99.8%

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

        \[\leadsto \left(\frac{2}{r \cdot r} + 3\right) - \mathsf{fma}\left(\color{blue}{\frac{-1}{4} \cdot v}, \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}, \frac{9}{2}\right) \]
      4. Step-by-step derivation
        1. lower-*.f6496.8

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

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

    Alternative 4: 98.2% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2}{r \cdot r}\\ t_1 := 0.125 \cdot \left(3 - 2 \cdot v\right)\\ t_2 := \left(\left(3 + t\_0\right) - \frac{t\_1 \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_0 - \mathsf{fma}\left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w, 0.25, 1.5\right)\\ \mathbf{elif}\;t\_2 \leq -1.5:\\ \;\;\;\;\left(3 - \frac{t\_1 \cdot \left(\left(\left(w \cdot r\right) \cdot w\right) \cdot r\right)}{1 - v}\right) - 4.5\\ \mathbf{else}:\\ \;\;\;\;t\_0 - 1.5\\ \end{array} \end{array} \]
    (FPCore (v w r)
     :precision binary64
     (let* ((t_0 (/ 2.0 (* r r)))
            (t_1 (* 0.125 (- 3.0 (* 2.0 v))))
            (t_2
             (- (- (+ 3.0 t_0) (/ (* t_1 (* (* (* w w) r) r)) (- 1.0 v))) 4.5)))
       (if (<= t_2 (- INFINITY))
         (- t_0 (fma (* (* (* w r) r) w) 0.25 1.5))
         (if (<= t_2 -1.5)
           (- (- 3.0 (/ (* t_1 (* (* (* w r) w) r)) (- 1.0 v))) 4.5)
           (- t_0 1.5)))))
    double code(double v, double w, double r) {
    	double t_0 = 2.0 / (r * r);
    	double t_1 = 0.125 * (3.0 - (2.0 * v));
    	double t_2 = ((3.0 + t_0) - ((t_1 * (((w * w) * r) * r)) / (1.0 - v))) - 4.5;
    	double tmp;
    	if (t_2 <= -((double) INFINITY)) {
    		tmp = t_0 - fma((((w * r) * r) * w), 0.25, 1.5);
    	} else if (t_2 <= -1.5) {
    		tmp = (3.0 - ((t_1 * (((w * r) * w) * r)) / (1.0 - v))) - 4.5;
    	} else {
    		tmp = t_0 - 1.5;
    	}
    	return tmp;
    }
    
    function code(v, w, r)
    	t_0 = Float64(2.0 / Float64(r * r))
    	t_1 = Float64(0.125 * Float64(3.0 - Float64(2.0 * v)))
    	t_2 = Float64(Float64(Float64(3.0 + t_0) - Float64(Float64(t_1 * Float64(Float64(Float64(w * w) * r) * r)) / Float64(1.0 - v))) - 4.5)
    	tmp = 0.0
    	if (t_2 <= Float64(-Inf))
    		tmp = Float64(t_0 - fma(Float64(Float64(Float64(w * r) * r) * w), 0.25, 1.5));
    	elseif (t_2 <= -1.5)
    		tmp = Float64(Float64(3.0 - Float64(Float64(t_1 * Float64(Float64(Float64(w * r) * w) * r)) / Float64(1.0 - v))) - 4.5);
    	else
    		tmp = Float64(t_0 - 1.5);
    	end
    	return tmp
    end
    
    code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.125 * N[(3.0 - N[(2.0 * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(3.0 + t$95$0), $MachinePrecision] - N[(N[(t$95$1 * N[(N[(N[(w * w), $MachinePrecision] * r), $MachinePrecision] * r), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(t$95$0 - N[(N[(N[(N[(w * r), $MachinePrecision] * r), $MachinePrecision] * w), $MachinePrecision] * 0.25 + 1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -1.5], N[(N[(3.0 - N[(N[(t$95$1 * N[(N[(N[(w * r), $MachinePrecision] * w), $MachinePrecision] * r), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision], N[(t$95$0 - 1.5), $MachinePrecision]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{2}{r \cdot r}\\
    t_1 := 0.125 \cdot \left(3 - 2 \cdot v\right)\\
    t_2 := \left(\left(3 + t\_0\right) - \frac{t\_1 \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5\\
    \mathbf{if}\;t\_2 \leq -\infty:\\
    \;\;\;\;t\_0 - \mathsf{fma}\left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w, 0.25, 1.5\right)\\
    
    \mathbf{elif}\;t\_2 \leq -1.5:\\
    \;\;\;\;\left(3 - \frac{t\_1 \cdot \left(\left(\left(w \cdot r\right) \cdot w\right) \cdot r\right)}{1 - v}\right) - 4.5\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0 - 1.5\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (-.f64 (-.f64 (+.f64 #s(literal 3 binary64) (/.f64 #s(literal 2 binary64) (*.f64 r r))) (/.f64 (*.f64 (*.f64 #s(literal 1/8 binary64) (-.f64 #s(literal 3 binary64) (*.f64 #s(literal 2 binary64) v))) (*.f64 (*.f64 (*.f64 w w) r) r)) (-.f64 #s(literal 1 binary64) v))) #s(literal 9/2 binary64)) < -inf.0

      1. Initial program 82.7%

        \[\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 v around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(\frac{1}{4} \cdot \left(r \cdot r\right), w \cdot \color{blue}{w}, \frac{3}{2}\right) \]
        14. lift-*.f6488.4

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w, \frac{1}{4}, \frac{3}{2}\right) \]
        16. lift-*.f6496.3

          \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w, 0.25, 1.5\right) \]
      6. Applied rewrites96.3%

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

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

      1. Initial program 87.8%

        \[\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 inf

        \[\leadsto \left(\color{blue}{3} - \frac{\left(\frac{1}{8} \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) - \frac{9}{2} \]
      3. Step-by-step derivation
        1. Applied rewrites87.7%

          \[\leadsto \left(\color{blue}{3} - \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. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

        if -1.5 < (-.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.2%

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

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

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

            \[\leadsto \frac{2 \cdot 1}{{r}^{2}} - \frac{3}{2} \]
          3. metadata-evalN/A

            \[\leadsto \frac{2}{{r}^{2}} - \frac{3}{2} \]
          4. pow2N/A

            \[\leadsto \frac{2}{r \cdot r} - \frac{3}{2} \]
          5. lift-/.f64N/A

            \[\leadsto \frac{2}{r \cdot r} - \frac{3}{2} \]
          6. lift-*.f6499.7

            \[\leadsto \frac{2}{r \cdot r} - 1.5 \]
        4. Applied rewrites99.7%

          \[\leadsto \color{blue}{\frac{2}{r \cdot r} - 1.5} \]
      4. Recombined 3 regimes into one program.
      5. Add Preprocessing

      Alternative 5: 98.0% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2}{r \cdot r}\\ t_1 := t\_0 - \mathsf{fma}\left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w, 0.25, 1.5\right)\\ \mathbf{if}\;v \leq -7800000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;v \leq 0.045:\\ \;\;\;\;\left(t\_0 + 3\right) - \mathsf{fma}\left(0.375, \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}, 4.5\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (v w r)
       :precision binary64
       (let* ((t_0 (/ 2.0 (* r r))) (t_1 (- t_0 (fma (* (* (* w r) r) w) 0.25 1.5))))
         (if (<= v -7800000000.0)
           t_1
           (if (<= v 0.045)
             (- (+ t_0 3.0) (fma 0.375 (/ (* (* r w) (* r w)) (- 1.0 v)) 4.5))
             t_1))))
      double code(double v, double w, double r) {
      	double t_0 = 2.0 / (r * r);
      	double t_1 = t_0 - fma((((w * r) * r) * w), 0.25, 1.5);
      	double tmp;
      	if (v <= -7800000000.0) {
      		tmp = t_1;
      	} else if (v <= 0.045) {
      		tmp = (t_0 + 3.0) - fma(0.375, (((r * w) * (r * w)) / (1.0 - v)), 4.5);
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(v, w, r)
      	t_0 = Float64(2.0 / Float64(r * r))
      	t_1 = Float64(t_0 - fma(Float64(Float64(Float64(w * r) * r) * w), 0.25, 1.5))
      	tmp = 0.0
      	if (v <= -7800000000.0)
      		tmp = t_1;
      	elseif (v <= 0.045)
      		tmp = Float64(Float64(t_0 + 3.0) - fma(0.375, Float64(Float64(Float64(r * w) * Float64(r * w)) / Float64(1.0 - v)), 4.5));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[(N[(N[(N[(w * r), $MachinePrecision] * r), $MachinePrecision] * w), $MachinePrecision] * 0.25 + 1.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[v, -7800000000.0], t$95$1, If[LessEqual[v, 0.045], N[(N[(t$95$0 + 3.0), $MachinePrecision] - N[(0.375 * N[(N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision] + 4.5), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \frac{2}{r \cdot r}\\
      t_1 := t\_0 - \mathsf{fma}\left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w, 0.25, 1.5\right)\\
      \mathbf{if}\;v \leq -7800000000:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;v \leq 0.045:\\
      \;\;\;\;\left(t\_0 + 3\right) - \mathsf{fma}\left(0.375, \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}, 4.5\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if v < -7.8e9 or 0.044999999999999998 < v

        1. Initial program 81.7%

          \[\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 v around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w, \frac{1}{4}, \frac{3}{2}\right) \]
          16. lift-*.f6497.1

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

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

        if -7.8e9 < v < 0.044999999999999998

        1. Initial program 88.0%

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

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

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

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

        Alternative 6: 96.7% accurate, 0.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2}{r \cdot r}\\ t_1 := t\_0 - \mathsf{fma}\left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w, 0.25, 1.5\right)\\ t_2 := \left(w \cdot w\right) \cdot r\\ t_3 := \left(\left(3 + t\_0\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(t\_2 \cdot r\right)}{1 - v}\right) - 4.5\\ \mathbf{if}\;t\_3 \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_3 \leq -50000000000000:\\ \;\;\;\;\left(3 - \frac{\left(\left(\mathsf{fma}\left(v, -2, 3\right) \cdot 0.125\right) \cdot t\_2\right) \cdot r}{1 - v}\right) - 4.5\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (v w r)
         :precision binary64
         (let* ((t_0 (/ 2.0 (* r r)))
                (t_1 (- t_0 (fma (* (* (* w r) r) w) 0.25 1.5)))
                (t_2 (* (* w w) r))
                (t_3
                 (-
                  (-
                   (+ 3.0 t_0)
                   (/ (* (* 0.125 (- 3.0 (* 2.0 v))) (* t_2 r)) (- 1.0 v)))
                  4.5)))
           (if (<= t_3 (- INFINITY))
             t_1
             (if (<= t_3 -50000000000000.0)
               (- (- 3.0 (/ (* (* (* (fma v -2.0 3.0) 0.125) t_2) r) (- 1.0 v))) 4.5)
               t_1))))
        double code(double v, double w, double r) {
        	double t_0 = 2.0 / (r * r);
        	double t_1 = t_0 - fma((((w * r) * r) * w), 0.25, 1.5);
        	double t_2 = (w * w) * r;
        	double t_3 = ((3.0 + t_0) - (((0.125 * (3.0 - (2.0 * v))) * (t_2 * r)) / (1.0 - v))) - 4.5;
        	double tmp;
        	if (t_3 <= -((double) INFINITY)) {
        		tmp = t_1;
        	} else if (t_3 <= -50000000000000.0) {
        		tmp = (3.0 - ((((fma(v, -2.0, 3.0) * 0.125) * t_2) * r) / (1.0 - v))) - 4.5;
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        function code(v, w, r)
        	t_0 = Float64(2.0 / Float64(r * r))
        	t_1 = Float64(t_0 - fma(Float64(Float64(Float64(w * r) * r) * w), 0.25, 1.5))
        	t_2 = Float64(Float64(w * w) * r)
        	t_3 = Float64(Float64(Float64(3.0 + t_0) - Float64(Float64(Float64(0.125 * Float64(3.0 - Float64(2.0 * v))) * Float64(t_2 * r)) / Float64(1.0 - v))) - 4.5)
        	tmp = 0.0
        	if (t_3 <= Float64(-Inf))
        		tmp = t_1;
        	elseif (t_3 <= -50000000000000.0)
        		tmp = Float64(Float64(3.0 - Float64(Float64(Float64(Float64(fma(v, -2.0, 3.0) * 0.125) * t_2) * r) / Float64(1.0 - v))) - 4.5);
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[(N[(N[(N[(w * r), $MachinePrecision] * r), $MachinePrecision] * w), $MachinePrecision] * 0.25 + 1.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(w * w), $MachinePrecision] * r), $MachinePrecision]}, Block[{t$95$3 = 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[(t$95$2 * r), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$1, If[LessEqual[t$95$3, -50000000000000.0], N[(N[(3.0 - N[(N[(N[(N[(N[(v * -2.0 + 3.0), $MachinePrecision] * 0.125), $MachinePrecision] * t$95$2), $MachinePrecision] * r), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision], t$95$1]]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \frac{2}{r \cdot r}\\
        t_1 := t\_0 - \mathsf{fma}\left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w, 0.25, 1.5\right)\\
        t_2 := \left(w \cdot w\right) \cdot r\\
        t_3 := \left(\left(3 + t\_0\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(t\_2 \cdot r\right)}{1 - v}\right) - 4.5\\
        \mathbf{if}\;t\_3 \leq -\infty:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;t\_3 \leq -50000000000000:\\
        \;\;\;\;\left(3 - \frac{\left(\left(\mathsf{fma}\left(v, -2, 3\right) \cdot 0.125\right) \cdot t\_2\right) \cdot r}{1 - v}\right) - 4.5\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (-.f64 (-.f64 (+.f64 #s(literal 3 binary64) (/.f64 #s(literal 2 binary64) (*.f64 r r))) (/.f64 (*.f64 (*.f64 #s(literal 1/8 binary64) (-.f64 #s(literal 3 binary64) (*.f64 #s(literal 2 binary64) v))) (*.f64 (*.f64 (*.f64 w w) r) r)) (-.f64 #s(literal 1 binary64) v))) #s(literal 9/2 binary64)) < -inf.0 or -5e13 < (-.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 83.7%

            \[\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 v around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(0.25 \cdot \left(r \cdot r\right), w \cdot \color{blue}{w}, 1.5\right) \]
          4. Applied rewrites81.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w, \frac{1}{4}, \frac{3}{2}\right) \]
            16. lift-*.f6496.1

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

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

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

          1. Initial program 98.6%

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

            \[\leadsto \left(\color{blue}{3} - \frac{\left(\frac{1}{8} \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) - \frac{9}{2} \]
          3. Step-by-step derivation
            1. Applied rewrites98.4%

              \[\leadsto \left(\color{blue}{3} - \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. Step-by-step derivation
              1. Applied rewrites97.3%

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

            Alternative 7: 96.2% accurate, 0.4× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2}{r \cdot r}\\ t_1 := \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\right) \cdot r\right)}{1 - v}\right) - 4.5\\ t_2 := t\_0 - \mathsf{fma}\left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w, 0.25, 1.5\right)\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq -50000000000000:\\ \;\;\;\;\frac{\left(\left(\mathsf{fma}\left(v, -2, 3\right) \cdot \left(w \cdot w\right)\right) \cdot r\right) \cdot r}{1 - v} \cdot -0.125\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
            (FPCore (v w r)
             :precision binary64
             (let* ((t_0 (/ 2.0 (* r r)))
                    (t_1
                     (-
                      (-
                       (+ 3.0 t_0)
                       (/ (* (* 0.125 (- 3.0 (* 2.0 v))) (* (* (* w w) r) r)) (- 1.0 v)))
                      4.5))
                    (t_2 (- t_0 (fma (* (* (* w r) r) w) 0.25 1.5))))
               (if (<= t_1 (- INFINITY))
                 t_2
                 (if (<= t_1 -50000000000000.0)
                   (* (/ (* (* (* (fma v -2.0 3.0) (* w w)) r) r) (- 1.0 v)) -0.125)
                   t_2))))
            double code(double v, double w, double r) {
            	double t_0 = 2.0 / (r * r);
            	double t_1 = ((3.0 + t_0) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5;
            	double t_2 = t_0 - fma((((w * r) * r) * w), 0.25, 1.5);
            	double tmp;
            	if (t_1 <= -((double) INFINITY)) {
            		tmp = t_2;
            	} else if (t_1 <= -50000000000000.0) {
            		tmp = ((((fma(v, -2.0, 3.0) * (w * w)) * r) * r) / (1.0 - v)) * -0.125;
            	} else {
            		tmp = t_2;
            	}
            	return tmp;
            }
            
            function code(v, w, r)
            	t_0 = Float64(2.0 / Float64(r * r))
            	t_1 = 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) * r)) / Float64(1.0 - v))) - 4.5)
            	t_2 = Float64(t_0 - fma(Float64(Float64(Float64(w * r) * r) * w), 0.25, 1.5))
            	tmp = 0.0
            	if (t_1 <= Float64(-Inf))
            		tmp = t_2;
            	elseif (t_1 <= -50000000000000.0)
            		tmp = Float64(Float64(Float64(Float64(Float64(fma(v, -2.0, 3.0) * Float64(w * w)) * r) * r) / Float64(1.0 - v)) * -0.125);
            	else
            		tmp = t_2;
            	end
            	return tmp
            end
            
            code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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), $MachinePrecision] * r), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 - N[(N[(N[(N[(w * r), $MachinePrecision] * r), $MachinePrecision] * w), $MachinePrecision] * 0.25 + 1.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -50000000000000.0], N[(N[(N[(N[(N[(N[(v * -2.0 + 3.0), $MachinePrecision] * N[(w * w), $MachinePrecision]), $MachinePrecision] * r), $MachinePrecision] * r), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision], t$95$2]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \frac{2}{r \cdot r}\\
            t_1 := \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\right) \cdot r\right)}{1 - v}\right) - 4.5\\
            t_2 := t\_0 - \mathsf{fma}\left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w, 0.25, 1.5\right)\\
            \mathbf{if}\;t\_1 \leq -\infty:\\
            \;\;\;\;t\_2\\
            
            \mathbf{elif}\;t\_1 \leq -50000000000000:\\
            \;\;\;\;\frac{\left(\left(\mathsf{fma}\left(v, -2, 3\right) \cdot \left(w \cdot w\right)\right) \cdot r\right) \cdot r}{1 - v} \cdot -0.125\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_2\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (-.f64 (-.f64 (+.f64 #s(literal 3 binary64) (/.f64 #s(literal 2 binary64) (*.f64 r r))) (/.f64 (*.f64 (*.f64 #s(literal 1/8 binary64) (-.f64 #s(literal 3 binary64) (*.f64 #s(literal 2 binary64) v))) (*.f64 (*.f64 (*.f64 w w) r) r)) (-.f64 #s(literal 1 binary64) v))) #s(literal 9/2 binary64)) < -inf.0 or -5e13 < (-.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 83.7%

                \[\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 v around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(0.25 \cdot \left(r \cdot r\right), w \cdot \color{blue}{w}, 1.5\right) \]
              4. Applied rewrites81.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w, \frac{1}{4}, \frac{3}{2}\right) \]
                16. lift-*.f6496.1

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

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

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

              1. Initial program 98.6%

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

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

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

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

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

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

                  \[\leadsto \left(\frac{2}{r \cdot r} + 3\right) - \mathsf{fma}\left(\left(\frac{\frac{3}{8} \cdot 1}{v} - \frac{1}{4}\right) \cdot v, \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}, \frac{9}{2}\right) \]
                5. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{\left(\left(\mathsf{fma}\left(v, -2, 3\right) \cdot \left(w \cdot w\right)\right) \cdot r\right) \cdot r}{1 - v} \cdot \frac{-1}{8} \]
                18. lift-*.f6496.6

                  \[\leadsto \frac{\left(\left(\mathsf{fma}\left(v, -2, 3\right) \cdot \left(w \cdot w\right)\right) \cdot r\right) \cdot r}{1 - v} \cdot -0.125 \]
              9. Applied rewrites96.6%

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

            Alternative 8: 96.2% accurate, 1.2× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2}{r \cdot r}\\ t_1 := \left(\left(w \cdot r\right) \cdot r\right) \cdot w\\ t_2 := t\_0 - \mathsf{fma}\left(t\_1, 0.25, 1.5\right)\\ \mathbf{if}\;v \leq -7800000000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;v \leq 0.045:\\ \;\;\;\;\left(t\_0 + 3\right) - \mathsf{fma}\left(0.375, t\_1, 4.5\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
            (FPCore (v w r)
             :precision binary64
             (let* ((t_0 (/ 2.0 (* r r)))
                    (t_1 (* (* (* w r) r) w))
                    (t_2 (- t_0 (fma t_1 0.25 1.5))))
               (if (<= v -7800000000.0)
                 t_2
                 (if (<= v 0.045) (- (+ t_0 3.0) (fma 0.375 t_1 4.5)) t_2))))
            double code(double v, double w, double r) {
            	double t_0 = 2.0 / (r * r);
            	double t_1 = ((w * r) * r) * w;
            	double t_2 = t_0 - fma(t_1, 0.25, 1.5);
            	double tmp;
            	if (v <= -7800000000.0) {
            		tmp = t_2;
            	} else if (v <= 0.045) {
            		tmp = (t_0 + 3.0) - fma(0.375, t_1, 4.5);
            	} else {
            		tmp = t_2;
            	}
            	return tmp;
            }
            
            function code(v, w, r)
            	t_0 = Float64(2.0 / Float64(r * r))
            	t_1 = Float64(Float64(Float64(w * r) * r) * w)
            	t_2 = Float64(t_0 - fma(t_1, 0.25, 1.5))
            	tmp = 0.0
            	if (v <= -7800000000.0)
            		tmp = t_2;
            	elseif (v <= 0.045)
            		tmp = Float64(Float64(t_0 + 3.0) - fma(0.375, t_1, 4.5));
            	else
            		tmp = t_2;
            	end
            	return tmp
            end
            
            code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(w * r), $MachinePrecision] * r), $MachinePrecision] * w), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 - N[(t$95$1 * 0.25 + 1.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[v, -7800000000.0], t$95$2, If[LessEqual[v, 0.045], N[(N[(t$95$0 + 3.0), $MachinePrecision] - N[(0.375 * t$95$1 + 4.5), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \frac{2}{r \cdot r}\\
            t_1 := \left(\left(w \cdot r\right) \cdot r\right) \cdot w\\
            t_2 := t\_0 - \mathsf{fma}\left(t\_1, 0.25, 1.5\right)\\
            \mathbf{if}\;v \leq -7800000000:\\
            \;\;\;\;t\_2\\
            
            \mathbf{elif}\;v \leq 0.045:\\
            \;\;\;\;\left(t\_0 + 3\right) - \mathsf{fma}\left(0.375, t\_1, 4.5\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_2\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if v < -7.8e9 or 0.044999999999999998 < v

              1. Initial program 81.7%

                \[\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 v around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w, \frac{1}{4}, \frac{3}{2}\right) \]
                16. lift-*.f6497.1

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

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

              if -7.8e9 < v < 0.044999999999999998

              1. Initial program 88.0%

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

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

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

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

                  \[\leadsto \left(\frac{2}{r \cdot r} + 3\right) - \mathsf{fma}\left(\frac{3}{8}, \color{blue}{{r}^{2} \cdot {w}^{2}}, \frac{9}{2}\right) \]
                3. Step-by-step derivation
                  1. pow-prod-downN/A

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

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

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

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

                    \[\leadsto \left(\frac{2}{r \cdot r} + 3\right) - \mathsf{fma}\left(\frac{3}{8}, \left(\left(r \cdot w\right) \cdot r\right) \cdot w, \frac{9}{2}\right) \]
                  6. *-commutativeN/A

                    \[\leadsto \left(\frac{2}{r \cdot r} + 3\right) - \mathsf{fma}\left(\frac{3}{8}, \left(\left(w \cdot r\right) \cdot r\right) \cdot w, \frac{9}{2}\right) \]
                  7. lower-*.f6496.3

                    \[\leadsto \left(\frac{2}{r \cdot r} + 3\right) - \mathsf{fma}\left(0.375, \left(\left(w \cdot r\right) \cdot r\right) \cdot w, 4.5\right) \]
                4. Applied rewrites96.3%

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

              Alternative 9: 93.5% accurate, 0.4× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\left(w \cdot w\right) \cdot r\right) \cdot r\\ t_1 := \frac{2}{r \cdot r}\\ t_2 := \left(\left(3 + t\_1\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot t\_0}{1 - v}\right) - 4.5\\ t_3 := t\_1 - \mathsf{fma}\left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w, 0.25, 1.5\right)\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq -4 \cdot 10^{+174}:\\ \;\;\;\;\left(3 - \frac{\left(0.125 \cdot 3\right) \cdot t\_0}{1}\right) - 4.5\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
              (FPCore (v w r)
               :precision binary64
               (let* ((t_0 (* (* (* w w) r) r))
                      (t_1 (/ 2.0 (* r r)))
                      (t_2
                       (-
                        (- (+ 3.0 t_1) (/ (* (* 0.125 (- 3.0 (* 2.0 v))) t_0) (- 1.0 v)))
                        4.5))
                      (t_3 (- t_1 (fma (* (* (* w r) r) w) 0.25 1.5))))
                 (if (<= t_2 (- INFINITY))
                   t_3
                   (if (<= t_2 -4e+174) (- (- 3.0 (/ (* (* 0.125 3.0) t_0) 1.0)) 4.5) t_3))))
              double code(double v, double w, double r) {
              	double t_0 = ((w * w) * r) * r;
              	double t_1 = 2.0 / (r * r);
              	double t_2 = ((3.0 + t_1) - (((0.125 * (3.0 - (2.0 * v))) * t_0) / (1.0 - v))) - 4.5;
              	double t_3 = t_1 - fma((((w * r) * r) * w), 0.25, 1.5);
              	double tmp;
              	if (t_2 <= -((double) INFINITY)) {
              		tmp = t_3;
              	} else if (t_2 <= -4e+174) {
              		tmp = (3.0 - (((0.125 * 3.0) * t_0) / 1.0)) - 4.5;
              	} else {
              		tmp = t_3;
              	}
              	return tmp;
              }
              
              function code(v, w, r)
              	t_0 = Float64(Float64(Float64(w * w) * r) * r)
              	t_1 = Float64(2.0 / Float64(r * r))
              	t_2 = Float64(Float64(Float64(3.0 + t_1) - Float64(Float64(Float64(0.125 * Float64(3.0 - Float64(2.0 * v))) * t_0) / Float64(1.0 - v))) - 4.5)
              	t_3 = Float64(t_1 - fma(Float64(Float64(Float64(w * r) * r) * w), 0.25, 1.5))
              	tmp = 0.0
              	if (t_2 <= Float64(-Inf))
              		tmp = t_3;
              	elseif (t_2 <= -4e+174)
              		tmp = Float64(Float64(3.0 - Float64(Float64(Float64(0.125 * 3.0) * t_0) / 1.0)) - 4.5);
              	else
              		tmp = t_3;
              	end
              	return tmp
              end
              
              code[v_, w_, r_] := Block[{t$95$0 = N[(N[(N[(w * w), $MachinePrecision] * r), $MachinePrecision] * r), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(3.0 + t$95$1), $MachinePrecision] - N[(N[(N[(0.125 * N[(3.0 - N[(2.0 * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 - N[(N[(N[(N[(w * r), $MachinePrecision] * r), $MachinePrecision] * w), $MachinePrecision] * 0.25 + 1.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, -4e+174], N[(N[(3.0 - N[(N[(N[(0.125 * 3.0), $MachinePrecision] * t$95$0), $MachinePrecision] / 1.0), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision], t$95$3]]]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \left(\left(w \cdot w\right) \cdot r\right) \cdot r\\
              t_1 := \frac{2}{r \cdot r}\\
              t_2 := \left(\left(3 + t\_1\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot t\_0}{1 - v}\right) - 4.5\\
              t_3 := t\_1 - \mathsf{fma}\left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w, 0.25, 1.5\right)\\
              \mathbf{if}\;t\_2 \leq -\infty:\\
              \;\;\;\;t\_3\\
              
              \mathbf{elif}\;t\_2 \leq -4 \cdot 10^{+174}:\\
              \;\;\;\;\left(3 - \frac{\left(0.125 \cdot 3\right) \cdot t\_0}{1}\right) - 4.5\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_3\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (-.f64 (-.f64 (+.f64 #s(literal 3 binary64) (/.f64 #s(literal 2 binary64) (*.f64 r r))) (/.f64 (*.f64 (*.f64 #s(literal 1/8 binary64) (-.f64 #s(literal 3 binary64) (*.f64 #s(literal 2 binary64) v))) (*.f64 (*.f64 (*.f64 w w) r) r)) (-.f64 #s(literal 1 binary64) v))) #s(literal 9/2 binary64)) < -inf.0 or -4.00000000000000028e174 < (-.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 84.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 v around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w, \frac{1}{4}, \frac{3}{2}\right) \]
                  16. lift-*.f6493.7

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

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

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

                1. Initial program 99.0%

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

                  \[\leadsto \left(\color{blue}{3} - \frac{\left(\frac{1}{8} \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) - \frac{9}{2} \]
                3. Step-by-step derivation
                  1. Applied rewrites99.0%

                    \[\leadsto \left(\color{blue}{3} - \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 v around 0

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

                      \[\leadsto \left(3 - \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)}{\color{blue}{1}}\right) - 4.5 \]
                    2. Taylor expanded in v around 0

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

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

                    Alternative 10: 91.6% accurate, 1.3× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2}{r \cdot r}\\ \mathbf{if}\;r \leq 8 \cdot 10^{-71}:\\ \;\;\;\;t\_0 - \left(\left(\left(r \cdot r\right) \cdot 0.25\right) \cdot w\right) \cdot w\\ \mathbf{elif}\;r \leq 1.28 \cdot 10^{+39}:\\ \;\;\;\;t\_0 - \mathsf{fma}\left(0.375 \cdot \left(r \cdot r\right), w \cdot w, 1.5\right)\\ \mathbf{else}:\\ \;\;\;\;\left(3 - \left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w\right) \cdot 0.25\right) - 4.5\\ \end{array} \end{array} \]
                    (FPCore (v w r)
                     :precision binary64
                     (let* ((t_0 (/ 2.0 (* r r))))
                       (if (<= r 8e-71)
                         (- t_0 (* (* (* (* r r) 0.25) w) w))
                         (if (<= r 1.28e+39)
                           (- t_0 (fma (* 0.375 (* r r)) (* w w) 1.5))
                           (- (- 3.0 (* (* (* (* w r) r) w) 0.25)) 4.5)))))
                    double code(double v, double w, double r) {
                    	double t_0 = 2.0 / (r * r);
                    	double tmp;
                    	if (r <= 8e-71) {
                    		tmp = t_0 - ((((r * r) * 0.25) * w) * w);
                    	} else if (r <= 1.28e+39) {
                    		tmp = t_0 - fma((0.375 * (r * r)), (w * w), 1.5);
                    	} else {
                    		tmp = (3.0 - ((((w * r) * r) * w) * 0.25)) - 4.5;
                    	}
                    	return tmp;
                    }
                    
                    function code(v, w, r)
                    	t_0 = Float64(2.0 / Float64(r * r))
                    	tmp = 0.0
                    	if (r <= 8e-71)
                    		tmp = Float64(t_0 - Float64(Float64(Float64(Float64(r * r) * 0.25) * w) * w));
                    	elseif (r <= 1.28e+39)
                    		tmp = Float64(t_0 - fma(Float64(0.375 * Float64(r * r)), Float64(w * w), 1.5));
                    	else
                    		tmp = Float64(Float64(3.0 - Float64(Float64(Float64(Float64(w * r) * r) * w) * 0.25)) - 4.5);
                    	end
                    	return tmp
                    end
                    
                    code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[r, 8e-71], N[(t$95$0 - N[(N[(N[(N[(r * r), $MachinePrecision] * 0.25), $MachinePrecision] * w), $MachinePrecision] * w), $MachinePrecision]), $MachinePrecision], If[LessEqual[r, 1.28e+39], N[(t$95$0 - N[(N[(0.375 * N[(r * r), $MachinePrecision]), $MachinePrecision] * N[(w * w), $MachinePrecision] + 1.5), $MachinePrecision]), $MachinePrecision], N[(N[(3.0 - N[(N[(N[(N[(w * r), $MachinePrecision] * r), $MachinePrecision] * w), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := \frac{2}{r \cdot r}\\
                    \mathbf{if}\;r \leq 8 \cdot 10^{-71}:\\
                    \;\;\;\;t\_0 - \left(\left(\left(r \cdot r\right) \cdot 0.25\right) \cdot w\right) \cdot w\\
                    
                    \mathbf{elif}\;r \leq 1.28 \cdot 10^{+39}:\\
                    \;\;\;\;t\_0 - \mathsf{fma}\left(0.375 \cdot \left(r \cdot r\right), w \cdot w, 1.5\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left(3 - \left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w\right) \cdot 0.25\right) - 4.5\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if r < 7.9999999999999993e-71

                      1. Initial program 83.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(\frac{1}{4} \cdot \left(r \cdot r\right), w \cdot \color{blue}{w}, \frac{3}{2}\right) \]
                        14. lift-*.f6478.3

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

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

                        \[\leadsto \frac{2}{r \cdot r} - \frac{1}{4} \cdot \color{blue}{\left({r}^{2} \cdot {w}^{2}\right)} \]
                      6. Step-by-step derivation
                        1. associate-*r*N/A

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

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

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

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

                          \[\leadsto \frac{2}{r \cdot r} - \left(\frac{1}{4} \cdot \left(r \cdot r\right)\right) \cdot \left(w \cdot w\right) \]
                        6. associate-*r*N/A

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

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

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

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

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

                          \[\leadsto \frac{2}{r \cdot r} - \left(\left(\frac{1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w \]
                        12. *-commutativeN/A

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

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

                          \[\leadsto \frac{2}{r \cdot r} - \left(\left(\left(r \cdot r\right) \cdot \frac{1}{4}\right) \cdot w\right) \cdot w \]
                        15. lift-*.f6483.7

                          \[\leadsto \frac{2}{r \cdot r} - \left(\left(\left(r \cdot r\right) \cdot 0.25\right) \cdot w\right) \cdot w \]
                      7. Applied rewrites83.7%

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

                      if 7.9999999999999993e-71 < r < 1.27999999999999994e39

                      1. Initial program 91.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(\frac{3}{8} \cdot \left(r \cdot r\right), w \cdot \color{blue}{w}, \frac{3}{2}\right) \]
                        14. lift-*.f6488.7

                          \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(0.375 \cdot \left(r \cdot r\right), w \cdot \color{blue}{w}, 1.5\right) \]
                      4. Applied rewrites88.7%

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

                      if 1.27999999999999994e39 < r

                      1. Initial program 87.7%

                        \[\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 inf

                        \[\leadsto \left(\color{blue}{3} - \frac{\left(\frac{1}{8} \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) - \frac{9}{2} \]
                      3. Step-by-step derivation
                        1. Applied rewrites87.7%

                          \[\leadsto \left(\color{blue}{3} - \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 v around inf

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

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

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

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

                            \[\leadsto \left(3 - \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) - \frac{9}{2} \]
                        4. Applied rewrites73.4%

                          \[\leadsto \left(3 - \color{blue}{\left(\left(\left(r \cdot r\right) \cdot 0.25\right) \cdot w\right) \cdot w}\right) - 4.5 \]
                        5. Step-by-step derivation
                          1. Applied rewrites84.0%

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

                        Alternative 11: 87.6% accurate, 1.6× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;r \leq 1.1 \cdot 10^{-30}:\\ \;\;\;\;\frac{2}{r \cdot r} - \left(\left(\left(r \cdot r\right) \cdot 0.25\right) \cdot w\right) \cdot w\\ \mathbf{elif}\;r \leq 1.28 \cdot 10^{+39}:\\ \;\;\;\;\left(3 - \left(0.375 \cdot \left(r \cdot r\right)\right) \cdot \left(w \cdot w\right)\right) - 4.5\\ \mathbf{else}:\\ \;\;\;\;\left(3 - \left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w\right) \cdot 0.25\right) - 4.5\\ \end{array} \end{array} \]
                        (FPCore (v w r)
                         :precision binary64
                         (if (<= r 1.1e-30)
                           (- (/ 2.0 (* r r)) (* (* (* (* r r) 0.25) w) w))
                           (if (<= r 1.28e+39)
                             (- (- 3.0 (* (* 0.375 (* r r)) (* w w))) 4.5)
                             (- (- 3.0 (* (* (* (* w r) r) w) 0.25)) 4.5))))
                        double code(double v, double w, double r) {
                        	double tmp;
                        	if (r <= 1.1e-30) {
                        		tmp = (2.0 / (r * r)) - ((((r * r) * 0.25) * w) * w);
                        	} else if (r <= 1.28e+39) {
                        		tmp = (3.0 - ((0.375 * (r * r)) * (w * w))) - 4.5;
                        	} else {
                        		tmp = (3.0 - ((((w * r) * r) * w) * 0.25)) - 4.5;
                        	}
                        	return tmp;
                        }
                        
                        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
                            real(8) :: tmp
                            if (r <= 1.1d-30) then
                                tmp = (2.0d0 / (r * r)) - ((((r * r) * 0.25d0) * w) * w)
                            else if (r <= 1.28d+39) then
                                tmp = (3.0d0 - ((0.375d0 * (r * r)) * (w * w))) - 4.5d0
                            else
                                tmp = (3.0d0 - ((((w * r) * r) * w) * 0.25d0)) - 4.5d0
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double v, double w, double r) {
                        	double tmp;
                        	if (r <= 1.1e-30) {
                        		tmp = (2.0 / (r * r)) - ((((r * r) * 0.25) * w) * w);
                        	} else if (r <= 1.28e+39) {
                        		tmp = (3.0 - ((0.375 * (r * r)) * (w * w))) - 4.5;
                        	} else {
                        		tmp = (3.0 - ((((w * r) * r) * w) * 0.25)) - 4.5;
                        	}
                        	return tmp;
                        }
                        
                        def code(v, w, r):
                        	tmp = 0
                        	if r <= 1.1e-30:
                        		tmp = (2.0 / (r * r)) - ((((r * r) * 0.25) * w) * w)
                        	elif r <= 1.28e+39:
                        		tmp = (3.0 - ((0.375 * (r * r)) * (w * w))) - 4.5
                        	else:
                        		tmp = (3.0 - ((((w * r) * r) * w) * 0.25)) - 4.5
                        	return tmp
                        
                        function code(v, w, r)
                        	tmp = 0.0
                        	if (r <= 1.1e-30)
                        		tmp = Float64(Float64(2.0 / Float64(r * r)) - Float64(Float64(Float64(Float64(r * r) * 0.25) * w) * w));
                        	elseif (r <= 1.28e+39)
                        		tmp = Float64(Float64(3.0 - Float64(Float64(0.375 * Float64(r * r)) * Float64(w * w))) - 4.5);
                        	else
                        		tmp = Float64(Float64(3.0 - Float64(Float64(Float64(Float64(w * r) * r) * w) * 0.25)) - 4.5);
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(v, w, r)
                        	tmp = 0.0;
                        	if (r <= 1.1e-30)
                        		tmp = (2.0 / (r * r)) - ((((r * r) * 0.25) * w) * w);
                        	elseif (r <= 1.28e+39)
                        		tmp = (3.0 - ((0.375 * (r * r)) * (w * w))) - 4.5;
                        	else
                        		tmp = (3.0 - ((((w * r) * r) * w) * 0.25)) - 4.5;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[v_, w_, r_] := If[LessEqual[r, 1.1e-30], N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(r * r), $MachinePrecision] * 0.25), $MachinePrecision] * w), $MachinePrecision] * w), $MachinePrecision]), $MachinePrecision], If[LessEqual[r, 1.28e+39], N[(N[(3.0 - N[(N[(0.375 * N[(r * r), $MachinePrecision]), $MachinePrecision] * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision], N[(N[(3.0 - N[(N[(N[(N[(w * r), $MachinePrecision] * r), $MachinePrecision] * w), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;r \leq 1.1 \cdot 10^{-30}:\\
                        \;\;\;\;\frac{2}{r \cdot r} - \left(\left(\left(r \cdot r\right) \cdot 0.25\right) \cdot w\right) \cdot w\\
                        
                        \mathbf{elif}\;r \leq 1.28 \cdot 10^{+39}:\\
                        \;\;\;\;\left(3 - \left(0.375 \cdot \left(r \cdot r\right)\right) \cdot \left(w \cdot w\right)\right) - 4.5\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\left(3 - \left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w\right) \cdot 0.25\right) - 4.5\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 3 regimes
                        2. if r < 1.09999999999999992e-30

                          1. Initial program 83.4%

                            \[\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 v around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(\frac{1}{4} \cdot \left(r \cdot r\right), w \cdot \color{blue}{w}, \frac{3}{2}\right) \]
                            14. lift-*.f6478.6

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

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

                            \[\leadsto \frac{2}{r \cdot r} - \frac{1}{4} \cdot \color{blue}{\left({r}^{2} \cdot {w}^{2}\right)} \]
                          6. Step-by-step derivation
                            1. associate-*r*N/A

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

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

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

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

                              \[\leadsto \frac{2}{r \cdot r} - \left(\frac{1}{4} \cdot \left(r \cdot r\right)\right) \cdot \left(w \cdot w\right) \]
                            6. associate-*r*N/A

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

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

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

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

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

                              \[\leadsto \frac{2}{r \cdot r} - \left(\left(\frac{1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w \]
                            12. *-commutativeN/A

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

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

                              \[\leadsto \frac{2}{r \cdot r} - \left(\left(\left(r \cdot r\right) \cdot \frac{1}{4}\right) \cdot w\right) \cdot w \]
                            15. lift-*.f6484.0

                              \[\leadsto \frac{2}{r \cdot r} - \left(\left(\left(r \cdot r\right) \cdot 0.25\right) \cdot w\right) \cdot w \]
                          7. Applied rewrites84.0%

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

                          if 1.09999999999999992e-30 < r < 1.27999999999999994e39

                          1. Initial program 92.8%

                            \[\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 inf

                            \[\leadsto \left(\color{blue}{3} - \frac{\left(\frac{1}{8} \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) - \frac{9}{2} \]
                          3. Step-by-step derivation
                            1. Applied rewrites64.8%

                              \[\leadsto \left(\color{blue}{3} - \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 v around 0

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

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

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

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

                                \[\leadsto \left(3 - \frac{3}{8} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) - \frac{9}{2} \]
                            4. Applied rewrites62.3%

                              \[\leadsto \left(3 - \color{blue}{\left(0.375 \cdot \left(r \cdot r\right)\right) \cdot \left(w \cdot w\right)}\right) - 4.5 \]

                            if 1.27999999999999994e39 < r

                            1. Initial program 87.7%

                              \[\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 inf

                              \[\leadsto \left(\color{blue}{3} - \frac{\left(\frac{1}{8} \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) - \frac{9}{2} \]
                            3. Step-by-step derivation
                              1. Applied rewrites87.7%

                                \[\leadsto \left(\color{blue}{3} - \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 v around inf

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

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

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

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

                                  \[\leadsto \left(3 - \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) - \frac{9}{2} \]
                              4. Applied rewrites73.4%

                                \[\leadsto \left(3 - \color{blue}{\left(\left(\left(r \cdot r\right) \cdot 0.25\right) \cdot w\right) \cdot w}\right) - 4.5 \]
                              5. Step-by-step derivation
                                1. Applied rewrites84.0%

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

                              Alternative 12: 87.4% accurate, 1.8× speedup?

                              \[\begin{array}{l} \\ \frac{2}{r \cdot r} - \mathsf{fma}\left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w, 0.25, 1.5\right) \end{array} \]
                              (FPCore (v w r)
                               :precision binary64
                               (- (/ 2.0 (* r r)) (fma (* (* (* w r) r) w) 0.25 1.5)))
                              double code(double v, double w, double r) {
                              	return (2.0 / (r * r)) - fma((((w * r) * r) * w), 0.25, 1.5);
                              }
                              
                              function code(v, w, r)
                              	return Float64(Float64(2.0 / Float64(r * r)) - fma(Float64(Float64(Float64(w * r) * r) * w), 0.25, 1.5))
                              end
                              
                              code[v_, w_, r_] := N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(w * r), $MachinePrecision] * r), $MachinePrecision] * w), $MachinePrecision] * 0.25 + 1.5), $MachinePrecision]), $MachinePrecision]
                              
                              \begin{array}{l}
                              
                              \\
                              \frac{2}{r \cdot r} - \mathsf{fma}\left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w, 0.25, 1.5\right)
                              \end{array}
                              
                              Derivation
                              1. Initial program 84.9%

                                \[\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 v around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(\frac{1}{4} \cdot \left(r \cdot r\right), w \cdot \color{blue}{w}, \frac{3}{2}\right) \]
                                14. lift-*.f6478.0

                                  \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(0.25 \cdot \left(r \cdot r\right), w \cdot \color{blue}{w}, 1.5\right) \]
                              4. Applied rewrites78.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w, \frac{1}{4}, \frac{3}{2}\right) \]
                                16. lift-*.f6491.6

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

                                \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w, \color{blue}{0.25}, 1.5\right) \]
                              7. Add Preprocessing

                              Alternative 13: 86.7% accurate, 1.6× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;r \leq 7.8 \cdot 10^{-31}:\\ \;\;\;\;\frac{\frac{2}{r}}{r}\\ \mathbf{elif}\;r \leq 1.28 \cdot 10^{+39}:\\ \;\;\;\;\left(3 - \left(0.375 \cdot \left(r \cdot r\right)\right) \cdot \left(w \cdot w\right)\right) - 4.5\\ \mathbf{else}:\\ \;\;\;\;\left(3 - \left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w\right) \cdot 0.25\right) - 4.5\\ \end{array} \end{array} \]
                              (FPCore (v w r)
                               :precision binary64
                               (if (<= r 7.8e-31)
                                 (/ (/ 2.0 r) r)
                                 (if (<= r 1.28e+39)
                                   (- (- 3.0 (* (* 0.375 (* r r)) (* w w))) 4.5)
                                   (- (- 3.0 (* (* (* (* w r) r) w) 0.25)) 4.5))))
                              double code(double v, double w, double r) {
                              	double tmp;
                              	if (r <= 7.8e-31) {
                              		tmp = (2.0 / r) / r;
                              	} else if (r <= 1.28e+39) {
                              		tmp = (3.0 - ((0.375 * (r * r)) * (w * w))) - 4.5;
                              	} else {
                              		tmp = (3.0 - ((((w * r) * r) * w) * 0.25)) - 4.5;
                              	}
                              	return tmp;
                              }
                              
                              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
                                  real(8) :: tmp
                                  if (r <= 7.8d-31) then
                                      tmp = (2.0d0 / r) / r
                                  else if (r <= 1.28d+39) then
                                      tmp = (3.0d0 - ((0.375d0 * (r * r)) * (w * w))) - 4.5d0
                                  else
                                      tmp = (3.0d0 - ((((w * r) * r) * w) * 0.25d0)) - 4.5d0
                                  end if
                                  code = tmp
                              end function
                              
                              public static double code(double v, double w, double r) {
                              	double tmp;
                              	if (r <= 7.8e-31) {
                              		tmp = (2.0 / r) / r;
                              	} else if (r <= 1.28e+39) {
                              		tmp = (3.0 - ((0.375 * (r * r)) * (w * w))) - 4.5;
                              	} else {
                              		tmp = (3.0 - ((((w * r) * r) * w) * 0.25)) - 4.5;
                              	}
                              	return tmp;
                              }
                              
                              def code(v, w, r):
                              	tmp = 0
                              	if r <= 7.8e-31:
                              		tmp = (2.0 / r) / r
                              	elif r <= 1.28e+39:
                              		tmp = (3.0 - ((0.375 * (r * r)) * (w * w))) - 4.5
                              	else:
                              		tmp = (3.0 - ((((w * r) * r) * w) * 0.25)) - 4.5
                              	return tmp
                              
                              function code(v, w, r)
                              	tmp = 0.0
                              	if (r <= 7.8e-31)
                              		tmp = Float64(Float64(2.0 / r) / r);
                              	elseif (r <= 1.28e+39)
                              		tmp = Float64(Float64(3.0 - Float64(Float64(0.375 * Float64(r * r)) * Float64(w * w))) - 4.5);
                              	else
                              		tmp = Float64(Float64(3.0 - Float64(Float64(Float64(Float64(w * r) * r) * w) * 0.25)) - 4.5);
                              	end
                              	return tmp
                              end
                              
                              function tmp_2 = code(v, w, r)
                              	tmp = 0.0;
                              	if (r <= 7.8e-31)
                              		tmp = (2.0 / r) / r;
                              	elseif (r <= 1.28e+39)
                              		tmp = (3.0 - ((0.375 * (r * r)) * (w * w))) - 4.5;
                              	else
                              		tmp = (3.0 - ((((w * r) * r) * w) * 0.25)) - 4.5;
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              code[v_, w_, r_] := If[LessEqual[r, 7.8e-31], N[(N[(2.0 / r), $MachinePrecision] / r), $MachinePrecision], If[LessEqual[r, 1.28e+39], N[(N[(3.0 - N[(N[(0.375 * N[(r * r), $MachinePrecision]), $MachinePrecision] * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision], N[(N[(3.0 - N[(N[(N[(N[(w * r), $MachinePrecision] * r), $MachinePrecision] * w), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;r \leq 7.8 \cdot 10^{-31}:\\
                              \;\;\;\;\frac{\frac{2}{r}}{r}\\
                              
                              \mathbf{elif}\;r \leq 1.28 \cdot 10^{+39}:\\
                              \;\;\;\;\left(3 - \left(0.375 \cdot \left(r \cdot r\right)\right) \cdot \left(w \cdot w\right)\right) - 4.5\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\left(3 - \left(\left(\left(w \cdot r\right) \cdot r\right) \cdot w\right) \cdot 0.25\right) - 4.5\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 3 regimes
                              2. if r < 7.8000000000000003e-31

                                1. Initial program 83.4%

                                  \[\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. pow2N/A

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

                                    \[\leadsto \frac{2}{\color{blue}{r \cdot r}} \]
                                  3. lift-*.f6457.9

                                    \[\leadsto \frac{2}{r \cdot \color{blue}{r}} \]
                                4. Applied rewrites57.9%

                                  \[\leadsto \color{blue}{\frac{2}{r \cdot r}} \]
                                5. 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-/.f6457.9

                                    \[\leadsto \frac{\frac{2}{r}}{r} \]
                                6. Applied rewrites57.9%

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

                                if 7.8000000000000003e-31 < r < 1.27999999999999994e39

                                1. Initial program 92.8%

                                  \[\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 inf

                                  \[\leadsto \left(\color{blue}{3} - \frac{\left(\frac{1}{8} \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) - \frac{9}{2} \]
                                3. Step-by-step derivation
                                  1. Applied rewrites64.9%

                                    \[\leadsto \left(\color{blue}{3} - \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 v around 0

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

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

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

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

                                      \[\leadsto \left(3 - \frac{3}{8} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) - \frac{9}{2} \]
                                  4. Applied rewrites62.3%

                                    \[\leadsto \left(3 - \color{blue}{\left(0.375 \cdot \left(r \cdot r\right)\right) \cdot \left(w \cdot w\right)}\right) - 4.5 \]

                                  if 1.27999999999999994e39 < r

                                  1. Initial program 87.7%

                                    \[\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 inf

                                    \[\leadsto \left(\color{blue}{3} - \frac{\left(\frac{1}{8} \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) - \frac{9}{2} \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites87.7%

                                      \[\leadsto \left(\color{blue}{3} - \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 v around inf

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

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

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

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

                                        \[\leadsto \left(3 - \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) - \frac{9}{2} \]
                                    4. Applied rewrites73.4%

                                      \[\leadsto \left(3 - \color{blue}{\left(\left(\left(r \cdot r\right) \cdot 0.25\right) \cdot w\right) \cdot w}\right) - 4.5 \]
                                    5. Step-by-step derivation
                                      1. Applied rewrites84.0%

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

                                    Alternative 14: 84.2% accurate, 0.4× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2}{r \cdot r}\\ t_1 := \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\right) \cdot r\right)}{1 - v}\right) - 4.5\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+168}:\\ \;\;\;\;\left(-0.375 \cdot \left(r \cdot r\right)\right) \cdot \left(w \cdot w\right)\\ \mathbf{elif}\;t\_1 \leq -500000000000:\\ \;\;\;\;\left(-0.25 \cdot \left(r \cdot r\right)\right) \cdot \left(w \cdot w\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 - 1.5\\ \end{array} \end{array} \]
                                    (FPCore (v w r)
                                     :precision binary64
                                     (let* ((t_0 (/ 2.0 (* r r)))
                                            (t_1
                                             (-
                                              (-
                                               (+ 3.0 t_0)
                                               (/ (* (* 0.125 (- 3.0 (* 2.0 v))) (* (* (* w w) r) r)) (- 1.0 v)))
                                              4.5)))
                                       (if (<= t_1 -5e+168)
                                         (* (* -0.375 (* r r)) (* w w))
                                         (if (<= t_1 -500000000000.0) (* (* -0.25 (* r r)) (* w w)) (- t_0 1.5)))))
                                    double code(double v, double w, double r) {
                                    	double t_0 = 2.0 / (r * r);
                                    	double t_1 = ((3.0 + t_0) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5;
                                    	double tmp;
                                    	if (t_1 <= -5e+168) {
                                    		tmp = (-0.375 * (r * r)) * (w * w);
                                    	} else if (t_1 <= -500000000000.0) {
                                    		tmp = (-0.25 * (r * r)) * (w * w);
                                    	} else {
                                    		tmp = t_0 - 1.5;
                                    	}
                                    	return tmp;
                                    }
                                    
                                    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
                                        real(8) :: t_0
                                        real(8) :: t_1
                                        real(8) :: tmp
                                        t_0 = 2.0d0 / (r * r)
                                        t_1 = ((3.0d0 + t_0) - (((0.125d0 * (3.0d0 - (2.0d0 * v))) * (((w * w) * r) * r)) / (1.0d0 - v))) - 4.5d0
                                        if (t_1 <= (-5d+168)) then
                                            tmp = ((-0.375d0) * (r * r)) * (w * w)
                                        else if (t_1 <= (-500000000000.0d0)) then
                                            tmp = ((-0.25d0) * (r * r)) * (w * w)
                                        else
                                            tmp = t_0 - 1.5d0
                                        end if
                                        code = tmp
                                    end function
                                    
                                    public static double code(double v, double w, double r) {
                                    	double t_0 = 2.0 / (r * r);
                                    	double t_1 = ((3.0 + t_0) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5;
                                    	double tmp;
                                    	if (t_1 <= -5e+168) {
                                    		tmp = (-0.375 * (r * r)) * (w * w);
                                    	} else if (t_1 <= -500000000000.0) {
                                    		tmp = (-0.25 * (r * r)) * (w * w);
                                    	} else {
                                    		tmp = t_0 - 1.5;
                                    	}
                                    	return tmp;
                                    }
                                    
                                    def code(v, w, r):
                                    	t_0 = 2.0 / (r * r)
                                    	t_1 = ((3.0 + t_0) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5
                                    	tmp = 0
                                    	if t_1 <= -5e+168:
                                    		tmp = (-0.375 * (r * r)) * (w * w)
                                    	elif t_1 <= -500000000000.0:
                                    		tmp = (-0.25 * (r * r)) * (w * w)
                                    	else:
                                    		tmp = t_0 - 1.5
                                    	return tmp
                                    
                                    function code(v, w, r)
                                    	t_0 = Float64(2.0 / Float64(r * r))
                                    	t_1 = 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) * r)) / Float64(1.0 - v))) - 4.5)
                                    	tmp = 0.0
                                    	if (t_1 <= -5e+168)
                                    		tmp = Float64(Float64(-0.375 * Float64(r * r)) * Float64(w * w));
                                    	elseif (t_1 <= -500000000000.0)
                                    		tmp = Float64(Float64(-0.25 * Float64(r * r)) * Float64(w * w));
                                    	else
                                    		tmp = Float64(t_0 - 1.5);
                                    	end
                                    	return tmp
                                    end
                                    
                                    function tmp_2 = code(v, w, r)
                                    	t_0 = 2.0 / (r * r);
                                    	t_1 = ((3.0 + t_0) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5;
                                    	tmp = 0.0;
                                    	if (t_1 <= -5e+168)
                                    		tmp = (-0.375 * (r * r)) * (w * w);
                                    	elseif (t_1 <= -500000000000.0)
                                    		tmp = (-0.25 * (r * r)) * (w * w);
                                    	else
                                    		tmp = t_0 - 1.5;
                                    	end
                                    	tmp_2 = tmp;
                                    end
                                    
                                    code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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), $MachinePrecision] * r), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+168], N[(N[(-0.375 * N[(r * r), $MachinePrecision]), $MachinePrecision] * N[(w * w), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -500000000000.0], N[(N[(-0.25 * N[(r * r), $MachinePrecision]), $MachinePrecision] * N[(w * w), $MachinePrecision]), $MachinePrecision], N[(t$95$0 - 1.5), $MachinePrecision]]]]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    t_0 := \frac{2}{r \cdot r}\\
                                    t_1 := \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\right) \cdot r\right)}{1 - v}\right) - 4.5\\
                                    \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+168}:\\
                                    \;\;\;\;\left(-0.375 \cdot \left(r \cdot r\right)\right) \cdot \left(w \cdot w\right)\\
                                    
                                    \mathbf{elif}\;t\_1 \leq -500000000000:\\
                                    \;\;\;\;\left(-0.25 \cdot \left(r \cdot r\right)\right) \cdot \left(w \cdot w\right)\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;t\_0 - 1.5\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 3 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)) < -4.99999999999999967e168

                                      1. Initial program 84.0%

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

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

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

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

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

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

                                          \[\leadsto \left(\frac{2}{r \cdot r} + 3\right) - \mathsf{fma}\left(\left(\frac{\frac{3}{8} \cdot 1}{v} - \frac{1}{4}\right) \cdot v, \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}, \frac{9}{2}\right) \]
                                        5. metadata-evalN/A

                                          \[\leadsto \left(\frac{2}{r \cdot r} + 3\right) - \mathsf{fma}\left(\left(\frac{\frac{3}{8}}{v} - \frac{1}{4}\right) \cdot v, \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}, \frac{9}{2}\right) \]
                                        6. lower-/.f6499.7

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \left(\frac{-3}{8} \cdot \left(r \cdot r\right)\right) \cdot \left(w \cdot w\right) \]
                                        7. lift-*.f6480.8

                                          \[\leadsto \left(-0.375 \cdot \left(r \cdot r\right)\right) \cdot \left(w \cdot w\right) \]
                                      10. Applied rewrites80.8%

                                        \[\leadsto \left(-0.375 \cdot \left(r \cdot r\right)\right) \cdot \color{blue}{\left(w \cdot w\right)} \]

                                      if -4.99999999999999967e168 < (-.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)) < -5e11

                                      1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \frac{2}{r \cdot r} - \mathsf{fma}\left(\frac{1}{4} \cdot \left(r \cdot r\right), w \cdot \color{blue}{w}, \frac{3}{2}\right) \]
                                        14. lift-*.f6440.2

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

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

                                        \[\leadsto \frac{-1}{4} \cdot \color{blue}{\left({r}^{2} \cdot {w}^{2}\right)} \]
                                      6. Step-by-step derivation
                                        1. associate-*r*N/A

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

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

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

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

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

                                          \[\leadsto \left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot \left(w \cdot w\right) \]
                                        7. lift-*.f6439.7

                                          \[\leadsto \left(-0.25 \cdot \left(r \cdot r\right)\right) \cdot \left(w \cdot w\right) \]
                                      7. Applied rewrites39.7%

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

                                      if -5e11 < (-.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 84.4%

                                        \[\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 w around 0

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

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

                                          \[\leadsto \frac{2 \cdot 1}{{r}^{2}} - \frac{3}{2} \]
                                        3. metadata-evalN/A

                                          \[\leadsto \frac{2}{{r}^{2}} - \frac{3}{2} \]
                                        4. pow2N/A

                                          \[\leadsto \frac{2}{r \cdot r} - \frac{3}{2} \]
                                        5. lift-/.f64N/A

                                          \[\leadsto \frac{2}{r \cdot r} - \frac{3}{2} \]
                                        6. lift-*.f6494.5

                                          \[\leadsto \frac{2}{r \cdot r} - 1.5 \]
                                      4. Applied rewrites94.5%

                                        \[\leadsto \color{blue}{\frac{2}{r \cdot r} - 1.5} \]
                                    3. Recombined 3 regimes into one program.
                                    4. Add Preprocessing

                                    Alternative 15: 82.7% accurate, 0.7× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2}{r \cdot r}\\ \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\right) \cdot r\right)}{1 - v}\right) - 4.5 \leq -1.5000000000024976:\\ \;\;\;\;\left(3 - \left(0.375 \cdot \left(r \cdot r\right)\right) \cdot \left(w \cdot w\right)\right) - 4.5\\ \mathbf{else}:\\ \;\;\;\;t\_0 - 1.5\\ \end{array} \end{array} \]
                                    (FPCore (v w r)
                                     :precision binary64
                                     (let* ((t_0 (/ 2.0 (* r r))))
                                       (if (<=
                                            (-
                                             (-
                                              (+ 3.0 t_0)
                                              (/ (* (* 0.125 (- 3.0 (* 2.0 v))) (* (* (* w w) r) r)) (- 1.0 v)))
                                             4.5)
                                            -1.5000000000024976)
                                         (- (- 3.0 (* (* 0.375 (* r r)) (* w w))) 4.5)
                                         (- t_0 1.5))))
                                    double code(double v, double w, double r) {
                                    	double t_0 = 2.0 / (r * r);
                                    	double tmp;
                                    	if ((((3.0 + t_0) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5) <= -1.5000000000024976) {
                                    		tmp = (3.0 - ((0.375 * (r * r)) * (w * w))) - 4.5;
                                    	} else {
                                    		tmp = t_0 - 1.5;
                                    	}
                                    	return tmp;
                                    }
                                    
                                    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
                                        real(8) :: t_0
                                        real(8) :: tmp
                                        t_0 = 2.0d0 / (r * r)
                                        if ((((3.0d0 + t_0) - (((0.125d0 * (3.0d0 - (2.0d0 * v))) * (((w * w) * r) * r)) / (1.0d0 - v))) - 4.5d0) <= (-1.5000000000024976d0)) then
                                            tmp = (3.0d0 - ((0.375d0 * (r * r)) * (w * w))) - 4.5d0
                                        else
                                            tmp = t_0 - 1.5d0
                                        end if
                                        code = tmp
                                    end function
                                    
                                    public static double code(double v, double w, double r) {
                                    	double t_0 = 2.0 / (r * r);
                                    	double tmp;
                                    	if ((((3.0 + t_0) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5) <= -1.5000000000024976) {
                                    		tmp = (3.0 - ((0.375 * (r * r)) * (w * w))) - 4.5;
                                    	} else {
                                    		tmp = t_0 - 1.5;
                                    	}
                                    	return tmp;
                                    }
                                    
                                    def code(v, w, r):
                                    	t_0 = 2.0 / (r * r)
                                    	tmp = 0
                                    	if (((3.0 + t_0) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5) <= -1.5000000000024976:
                                    		tmp = (3.0 - ((0.375 * (r * r)) * (w * w))) - 4.5
                                    	else:
                                    		tmp = t_0 - 1.5
                                    	return tmp
                                    
                                    function code(v, w, r)
                                    	t_0 = Float64(2.0 / Float64(r * r))
                                    	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) * r)) / Float64(1.0 - v))) - 4.5) <= -1.5000000000024976)
                                    		tmp = Float64(Float64(3.0 - Float64(Float64(0.375 * Float64(r * r)) * Float64(w * w))) - 4.5);
                                    	else
                                    		tmp = Float64(t_0 - 1.5);
                                    	end
                                    	return tmp
                                    end
                                    
                                    function tmp_2 = code(v, w, r)
                                    	t_0 = 2.0 / (r * r);
                                    	tmp = 0.0;
                                    	if ((((3.0 + t_0) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5) <= -1.5000000000024976)
                                    		tmp = (3.0 - ((0.375 * (r * r)) * (w * w))) - 4.5;
                                    	else
                                    		tmp = t_0 - 1.5;
                                    	end
                                    	tmp_2 = tmp;
                                    end
                                    
                                    code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $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), $MachinePrecision] * r), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision], -1.5000000000024976], N[(N[(3.0 - N[(N[(0.375 * N[(r * r), $MachinePrecision]), $MachinePrecision] * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision], N[(t$95$0 - 1.5), $MachinePrecision]]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    t_0 := \frac{2}{r \cdot r}\\
                                    \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\right) \cdot r\right)}{1 - v}\right) - 4.5 \leq -1.5000000000024976:\\
                                    \;\;\;\;\left(3 - \left(0.375 \cdot \left(r \cdot r\right)\right) \cdot \left(w \cdot w\right)\right) - 4.5\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;t\_0 - 1.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)) < -1.5000000000024976

                                      1. Initial program 85.8%

                                        \[\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 inf

                                        \[\leadsto \left(\color{blue}{3} - \frac{\left(\frac{1}{8} \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) - \frac{9}{2} \]
                                      3. Step-by-step derivation
                                        1. Applied rewrites85.7%

                                          \[\leadsto \left(\color{blue}{3} - \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 v around 0

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

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

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

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

                                            \[\leadsto \left(3 - \frac{3}{8} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) - \frac{9}{2} \]
                                        4. Applied rewrites77.8%

                                          \[\leadsto \left(3 - \color{blue}{\left(0.375 \cdot \left(r \cdot r\right)\right) \cdot \left(w \cdot w\right)}\right) - 4.5 \]

                                        if -1.5000000000024976 < (-.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 84.3%

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

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

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

                                            \[\leadsto \frac{2 \cdot 1}{{r}^{2}} - \frac{3}{2} \]
                                          3. metadata-evalN/A

                                            \[\leadsto \frac{2}{{r}^{2}} - \frac{3}{2} \]
                                          4. pow2N/A

                                            \[\leadsto \frac{2}{r \cdot r} - \frac{3}{2} \]
                                          5. lift-/.f64N/A

                                            \[\leadsto \frac{2}{r \cdot r} - \frac{3}{2} \]
                                          6. lift-*.f6495.0

                                            \[\leadsto \frac{2}{r \cdot r} - 1.5 \]
                                        4. Applied rewrites95.0%

                                          \[\leadsto \color{blue}{\frac{2}{r \cdot r} - 1.5} \]
                                      4. Recombined 2 regimes into one program.
                                      5. Add Preprocessing

                                      Alternative 16: 63.8% accurate, 0.7× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2}{r \cdot r}\\ \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\right) \cdot r\right)}{1 - v}\right) - 4.5 \leq -500000000000:\\ \;\;\;\;\left(-0.375 \cdot \left(r \cdot r\right)\right) \cdot \left(w \cdot w\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 - 1.5\\ \end{array} \end{array} \]
                                      (FPCore (v w r)
                                       :precision binary64
                                       (let* ((t_0 (/ 2.0 (* r r))))
                                         (if (<=
                                              (-
                                               (-
                                                (+ 3.0 t_0)
                                                (/ (* (* 0.125 (- 3.0 (* 2.0 v))) (* (* (* w w) r) r)) (- 1.0 v)))
                                               4.5)
                                              -500000000000.0)
                                           (* (* -0.375 (* r r)) (* w w))
                                           (- t_0 1.5))))
                                      double code(double v, double w, double r) {
                                      	double t_0 = 2.0 / (r * r);
                                      	double tmp;
                                      	if ((((3.0 + t_0) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5) <= -500000000000.0) {
                                      		tmp = (-0.375 * (r * r)) * (w * w);
                                      	} else {
                                      		tmp = t_0 - 1.5;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      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
                                          real(8) :: t_0
                                          real(8) :: tmp
                                          t_0 = 2.0d0 / (r * r)
                                          if ((((3.0d0 + t_0) - (((0.125d0 * (3.0d0 - (2.0d0 * v))) * (((w * w) * r) * r)) / (1.0d0 - v))) - 4.5d0) <= (-500000000000.0d0)) then
                                              tmp = ((-0.375d0) * (r * r)) * (w * w)
                                          else
                                              tmp = t_0 - 1.5d0
                                          end if
                                          code = tmp
                                      end function
                                      
                                      public static double code(double v, double w, double r) {
                                      	double t_0 = 2.0 / (r * r);
                                      	double tmp;
                                      	if ((((3.0 + t_0) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5) <= -500000000000.0) {
                                      		tmp = (-0.375 * (r * r)) * (w * w);
                                      	} else {
                                      		tmp = t_0 - 1.5;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      def code(v, w, r):
                                      	t_0 = 2.0 / (r * r)
                                      	tmp = 0
                                      	if (((3.0 + t_0) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5) <= -500000000000.0:
                                      		tmp = (-0.375 * (r * r)) * (w * w)
                                      	else:
                                      		tmp = t_0 - 1.5
                                      	return tmp
                                      
                                      function code(v, w, r)
                                      	t_0 = Float64(2.0 / Float64(r * r))
                                      	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) * r)) / Float64(1.0 - v))) - 4.5) <= -500000000000.0)
                                      		tmp = Float64(Float64(-0.375 * Float64(r * r)) * Float64(w * w));
                                      	else
                                      		tmp = Float64(t_0 - 1.5);
                                      	end
                                      	return tmp
                                      end
                                      
                                      function tmp_2 = code(v, w, r)
                                      	t_0 = 2.0 / (r * r);
                                      	tmp = 0.0;
                                      	if ((((3.0 + t_0) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5) <= -500000000000.0)
                                      		tmp = (-0.375 * (r * r)) * (w * w);
                                      	else
                                      		tmp = t_0 - 1.5;
                                      	end
                                      	tmp_2 = tmp;
                                      end
                                      
                                      code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $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), $MachinePrecision] * r), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision], -500000000000.0], N[(N[(-0.375 * N[(r * r), $MachinePrecision]), $MachinePrecision] * N[(w * w), $MachinePrecision]), $MachinePrecision], N[(t$95$0 - 1.5), $MachinePrecision]]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      t_0 := \frac{2}{r \cdot r}\\
                                      \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\right) \cdot r\right)}{1 - v}\right) - 4.5 \leq -500000000000:\\
                                      \;\;\;\;\left(-0.375 \cdot \left(r \cdot r\right)\right) \cdot \left(w \cdot w\right)\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;t\_0 - 1.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)) < -5e11

                                        1. Initial program 85.7%

                                          \[\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 rewrites99.6%

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

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

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

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

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

                                            \[\leadsto \left(\frac{2}{r \cdot r} + 3\right) - \mathsf{fma}\left(\left(\frac{\frac{3}{8} \cdot 1}{v} - \frac{1}{4}\right) \cdot v, \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}, \frac{9}{2}\right) \]
                                          5. metadata-evalN/A

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

                                            \[\leadsto \left(\frac{2}{r \cdot r} + 3\right) - \mathsf{fma}\left(\left(\frac{0.375}{v} - 0.25\right) \cdot v, \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}, 4.5\right) \]
                                        5. Applied rewrites99.6%

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \left(\frac{-3}{8} \cdot \left(r \cdot r\right)\right) \cdot \left(w \cdot w\right) \]
                                          7. lift-*.f6477.8

                                            \[\leadsto \left(-0.375 \cdot \left(r \cdot r\right)\right) \cdot \left(w \cdot w\right) \]
                                        10. Applied rewrites77.8%

                                          \[\leadsto \left(-0.375 \cdot \left(r \cdot r\right)\right) \cdot \color{blue}{\left(w \cdot w\right)} \]

                                        if -5e11 < (-.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 84.4%

                                          \[\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 w around 0

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

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

                                            \[\leadsto \frac{2 \cdot 1}{{r}^{2}} - \frac{3}{2} \]
                                          3. metadata-evalN/A

                                            \[\leadsto \frac{2}{{r}^{2}} - \frac{3}{2} \]
                                          4. pow2N/A

                                            \[\leadsto \frac{2}{r \cdot r} - \frac{3}{2} \]
                                          5. lift-/.f64N/A

                                            \[\leadsto \frac{2}{r \cdot r} - \frac{3}{2} \]
                                          6. lift-*.f6494.5

                                            \[\leadsto \frac{2}{r \cdot r} - 1.5 \]
                                        4. Applied rewrites94.5%

                                          \[\leadsto \color{blue}{\frac{2}{r \cdot r} - 1.5} \]
                                      3. Recombined 2 regimes into one program.
                                      4. Add Preprocessing

                                      Alternative 17: 57.0% accurate, 4.2× speedup?

                                      \[\begin{array}{l} \\ \frac{2}{r \cdot r} - 1.5 \end{array} \]
                                      (FPCore (v w r) :precision binary64 (- (/ 2.0 (* r r)) 1.5))
                                      double code(double v, double w, double r) {
                                      	return (2.0 / (r * r)) - 1.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 = (2.0d0 / (r * r)) - 1.5d0
                                      end function
                                      
                                      public static double code(double v, double w, double r) {
                                      	return (2.0 / (r * r)) - 1.5;
                                      }
                                      
                                      def code(v, w, r):
                                      	return (2.0 / (r * r)) - 1.5
                                      
                                      function code(v, w, r)
                                      	return Float64(Float64(2.0 / Float64(r * r)) - 1.5)
                                      end
                                      
                                      function tmp = code(v, w, r)
                                      	tmp = (2.0 / (r * r)) - 1.5;
                                      end
                                      
                                      code[v_, w_, r_] := N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] - 1.5), $MachinePrecision]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \frac{2}{r \cdot r} - 1.5
                                      \end{array}
                                      
                                      Derivation
                                      1. Initial program 84.9%

                                        \[\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 w around 0

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

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

                                          \[\leadsto \frac{2 \cdot 1}{{r}^{2}} - \frac{3}{2} \]
                                        3. metadata-evalN/A

                                          \[\leadsto \frac{2}{{r}^{2}} - \frac{3}{2} \]
                                        4. pow2N/A

                                          \[\leadsto \frac{2}{r \cdot r} - \frac{3}{2} \]
                                        5. lift-/.f64N/A

                                          \[\leadsto \frac{2}{r \cdot r} - \frac{3}{2} \]
                                        6. lift-*.f6457.0

                                          \[\leadsto \frac{2}{r \cdot r} - 1.5 \]
                                      4. Applied rewrites57.0%

                                        \[\leadsto \color{blue}{\frac{2}{r \cdot r} - 1.5} \]
                                      5. Add Preprocessing

                                      Alternative 18: 43.7% accurate, 5.7× speedup?

                                      \[\begin{array}{l} \\ \frac{2}{r \cdot r} \end{array} \]
                                      (FPCore (v w r) :precision binary64 (/ 2.0 (* r r)))
                                      double code(double v, double w, double r) {
                                      	return 2.0 / (r * r);
                                      }
                                      
                                      module fmin_fmax_functions
                                          implicit none
                                          private
                                          public fmax
                                          public fmin
                                      
                                          interface fmax
                                              module procedure fmax88
                                              module procedure fmax44
                                              module procedure fmax84
                                              module procedure fmax48
                                          end interface
                                          interface fmin
                                              module procedure fmin88
                                              module procedure fmin44
                                              module procedure fmin84
                                              module procedure fmin48
                                          end interface
                                      contains
                                          real(8) function fmax88(x, y) result (res)
                                              real(8), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                          end function
                                          real(4) function fmax44(x, y) result (res)
                                              real(4), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                          end function
                                          real(8) function fmax84(x, y) result(res)
                                              real(8), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                          end function
                                          real(8) function fmax48(x, y) result(res)
                                              real(4), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                          end function
                                          real(8) function fmin88(x, y) result (res)
                                              real(8), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                          end function
                                          real(4) function fmin44(x, y) result (res)
                                              real(4), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                          end function
                                          real(8) function fmin84(x, y) result(res)
                                              real(8), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                          end function
                                          real(8) function fmin48(x, y) result(res)
                                              real(4), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                          end function
                                      end module
                                      
                                      real(8) function code(v, w, r)
                                      use fmin_fmax_functions
                                          real(8), intent (in) :: v
                                          real(8), intent (in) :: w
                                          real(8), intent (in) :: r
                                          code = 2.0d0 / (r * r)
                                      end function
                                      
                                      public static double code(double v, double w, double r) {
                                      	return 2.0 / (r * r);
                                      }
                                      
                                      def code(v, w, r):
                                      	return 2.0 / (r * r)
                                      
                                      function code(v, w, r)
                                      	return Float64(2.0 / Float64(r * r))
                                      end
                                      
                                      function tmp = code(v, w, r)
                                      	tmp = 2.0 / (r * r);
                                      end
                                      
                                      code[v_, w_, r_] := N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \frac{2}{r \cdot r}
                                      \end{array}
                                      
                                      Derivation
                                      1. Initial program 84.9%

                                        \[\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. pow2N/A

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

                                          \[\leadsto \frac{2}{\color{blue}{r \cdot r}} \]
                                        3. lift-*.f6443.7

                                          \[\leadsto \frac{2}{r \cdot \color{blue}{r}} \]
                                      4. Applied rewrites43.7%

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

                                      Reproduce

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