Rosa's TurbineBenchmark

Percentage Accurate: 84.9% → 97.5%
Time: 15.0s
Alternatives: 18
Speedup: 1.7×

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

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

Sampling outcomes in binary64 precision:

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

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

Alternative 1: 97.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2}{r \cdot r}\\ t_1 := t\_0 + -1.5\\ \mathbf{if}\;v \leq -8 \cdot 10^{-49}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, r \cdot \left(w \cdot \left(r \cdot w\right)\right), t\_1\right)\\ \mathbf{elif}\;v \leq 1.5 \cdot 10^{+15}:\\ \;\;\;\;\left(\left(t\_0 + 3\right) + \frac{\left(0.125 \cdot \left(3 - v \cdot 2\right)\right) \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)}{v + -1}\right) - 4.5\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.25 \cdot w, r \cdot \left(r \cdot w\right), t\_1\right)\\ \end{array} \end{array} \]
(FPCore (v w r)
 :precision binary64
 (let* ((t_0 (/ 2.0 (* r r))) (t_1 (+ t_0 -1.5)))
   (if (<= v -8e-49)
     (fma -0.25 (* r (* w (* r w))) t_1)
     (if (<= v 1.5e+15)
       (-
        (+
         (+ t_0 3.0)
         (/ (* (* 0.125 (- 3.0 (* v 2.0))) (* (* r w) (* r w))) (+ v -1.0)))
        4.5)
       (fma (* -0.25 w) (* r (* r w)) t_1)))))
double code(double v, double w, double r) {
	double t_0 = 2.0 / (r * r);
	double t_1 = t_0 + -1.5;
	double tmp;
	if (v <= -8e-49) {
		tmp = fma(-0.25, (r * (w * (r * w))), t_1);
	} else if (v <= 1.5e+15) {
		tmp = ((t_0 + 3.0) + (((0.125 * (3.0 - (v * 2.0))) * ((r * w) * (r * w))) / (v + -1.0))) - 4.5;
	} else {
		tmp = fma((-0.25 * w), (r * (r * w)), t_1);
	}
	return tmp;
}
function code(v, w, r)
	t_0 = Float64(2.0 / Float64(r * r))
	t_1 = Float64(t_0 + -1.5)
	tmp = 0.0
	if (v <= -8e-49)
		tmp = fma(-0.25, Float64(r * Float64(w * Float64(r * w))), t_1);
	elseif (v <= 1.5e+15)
		tmp = Float64(Float64(Float64(t_0 + 3.0) + Float64(Float64(Float64(0.125 * Float64(3.0 - Float64(v * 2.0))) * Float64(Float64(r * w) * Float64(r * w))) / Float64(v + -1.0))) - 4.5);
	else
		tmp = fma(Float64(-0.25 * w), Float64(r * Float64(r * w)), 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 + -1.5), $MachinePrecision]}, If[LessEqual[v, -8e-49], N[(-0.25 * N[(r * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[v, 1.5e+15], N[(N[(N[(t$95$0 + 3.0), $MachinePrecision] + N[(N[(N[(0.125 * N[(3.0 - N[(v * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(v + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision], N[(N[(-0.25 * w), $MachinePrecision] * N[(r * N[(r * w), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
t_1 := t\_0 + -1.5\\
\mathbf{if}\;v \leq -8 \cdot 10^{-49}:\\
\;\;\;\;\mathsf{fma}\left(-0.25, r \cdot \left(w \cdot \left(r \cdot w\right)\right), t\_1\right)\\

\mathbf{elif}\;v \leq 1.5 \cdot 10^{+15}:\\
\;\;\;\;\left(\left(t\_0 + 3\right) + \frac{\left(0.125 \cdot \left(3 - v \cdot 2\right)\right) \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)}{v + -1}\right) - 4.5\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.25 \cdot w, r \cdot \left(r \cdot w\right), t\_1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if v < -7.99999999999999949e-49

    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. Add Preprocessing
    3. 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)} \]
    4. Step-by-step derivation
      1. sub-negN/A

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

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

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

        \[\leadsto \left(\color{blue}{\frac{-3}{2}} + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
      5. distribute-lft-neg-inN/A

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

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

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

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

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

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

        \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
      12. accelerator-lowering-fma.f64N/A

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

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

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

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

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

        \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w, w, \color{blue}{\frac{2 \cdot 1}{{r}^{2}}}\right) \]
    5. Simplified91.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, r \cdot \left(w \cdot \left(r \cdot w\right)\right), \color{blue}{\frac{2}{r \cdot r}} + \frac{-3}{2}\right) \]
      17. *-lowering-*.f6498.5

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

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

    if -7.99999999999999949e-49 < v < 1.5e15

    1. Initial program 88.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l*N/A

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

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

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

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

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

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

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

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

    if 1.5e15 < v

    1. Initial program 74.3%

      \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
    2. Add Preprocessing
    3. 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)} \]
    4. Step-by-step derivation
      1. sub-negN/A

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

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

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

        \[\leadsto \left(\color{blue}{\frac{-3}{2}} + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
      5. distribute-lft-neg-inN/A

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

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

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

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

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

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

        \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
      12. accelerator-lowering-fma.f64N/A

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

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

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

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

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

        \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w, w, \color{blue}{\frac{2 \cdot 1}{{r}^{2}}}\right) \]
    5. Simplified87.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, r \cdot \left(r \cdot w\right), \color{blue}{\frac{2}{r \cdot r}} + \frac{-3}{2}\right) \]
      15. *-lowering-*.f6496.5

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(w \cdot -0.25, r \cdot \left(r \cdot w\right), \frac{2}{r \cdot r} + -1.5\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification98.7%

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

Alternative 2: 94.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2}{r \cdot r}\\ t_1 := \left(t\_0 + 3\right) + \frac{\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right) \cdot \left(0.125 \cdot \left(v \cdot 2 - 3\right)\right)}{1 - v}\\ t_2 := \mathsf{fma}\left(r \cdot w, -0.25 \cdot \left(r \cdot w\right), -1.5\right)\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq -4 \cdot 10^{+70}:\\ \;\;\;\;\mathsf{fma}\left(r \cdot \left(w \cdot \left(r \cdot w\right)\right), -0.375, 3\right) - 4.5\\ \mathbf{elif}\;t\_1 \leq 3:\\ \;\;\;\;t\_2\\ \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
         (+
          (+ t_0 3.0)
          (/ (* (* r (* r (* w w))) (* 0.125 (- (* v 2.0) 3.0))) (- 1.0 v))))
        (t_2 (fma (* r w) (* -0.25 (* r w)) -1.5)))
   (if (<= t_1 (- INFINITY))
     t_2
     (if (<= t_1 -4e+70)
       (- (fma (* r (* w (* r w))) -0.375 3.0) 4.5)
       (if (<= t_1 3.0) t_2 (+ t_0 -1.5))))))
double code(double v, double w, double r) {
	double t_0 = 2.0 / (r * r);
	double t_1 = (t_0 + 3.0) + (((r * (r * (w * w))) * (0.125 * ((v * 2.0) - 3.0))) / (1.0 - v));
	double t_2 = fma((r * w), (-0.25 * (r * w)), -1.5);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = t_2;
	} else if (t_1 <= -4e+70) {
		tmp = fma((r * (w * (r * w))), -0.375, 3.0) - 4.5;
	} else if (t_1 <= 3.0) {
		tmp = t_2;
	} 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(t_0 + 3.0) + Float64(Float64(Float64(r * Float64(r * Float64(w * w))) * Float64(0.125 * Float64(Float64(v * 2.0) - 3.0))) / Float64(1.0 - v)))
	t_2 = fma(Float64(r * w), Float64(-0.25 * Float64(r * w)), -1.5)
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = t_2;
	elseif (t_1 <= -4e+70)
		tmp = Float64(fma(Float64(r * Float64(w * Float64(r * w))), -0.375, 3.0) - 4.5);
	elseif (t_1 <= 3.0)
		tmp = t_2;
	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[(N[(t$95$0 + 3.0), $MachinePrecision] + N[(N[(N[(r * N[(r * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.125 * N[(N[(v * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(r * w), $MachinePrecision] * N[(-0.25 * N[(r * w), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -4e+70], N[(N[(N[(r * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.375 + 3.0), $MachinePrecision] - 4.5), $MachinePrecision], If[LessEqual[t$95$1, 3.0], t$95$2, N[(t$95$0 + -1.5), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{+70}:\\
\;\;\;\;\mathsf{fma}\left(r \cdot \left(w \cdot \left(r \cdot w\right)\right), -0.375, 3\right) - 4.5\\

\mathbf{elif}\;t\_1 \leq 3:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;t\_0 + -1.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.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))) < -inf.0 or -4.00000000000000029e70 < (-.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))) < 3

    1. Initial program 80.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. Add Preprocessing
    3. 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)} \]
    4. Step-by-step derivation
      1. sub-negN/A

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

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

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

        \[\leadsto \left(\color{blue}{\frac{-3}{2}} + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
      5. distribute-lft-neg-inN/A

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

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

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

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

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

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

        \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
      12. accelerator-lowering-fma.f64N/A

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

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

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

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

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

        \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w, w, \color{blue}{\frac{2 \cdot 1}{{r}^{2}}}\right) \]
    5. Simplified84.4%

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

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

        \[\leadsto {r}^{2} \cdot \color{blue}{\left(\frac{-1}{4} \cdot {w}^{2} + \left(\mathsf{neg}\left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)\right)} \]
      2. distribute-lft-inN/A

        \[\leadsto \color{blue}{{r}^{2} \cdot \left(\frac{-1}{4} \cdot {w}^{2}\right) + {r}^{2} \cdot \left(\mathsf{neg}\left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)} \]
      3. distribute-rgt-neg-inN/A

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

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

        \[\leadsto {r}^{2} \cdot \left(\frac{-1}{4} \cdot {w}^{2}\right) + \left(\mathsf{neg}\left(\color{blue}{\frac{3}{2} \cdot \left(\frac{1}{{r}^{2}} \cdot {r}^{2}\right)}\right)\right) \]
      6. lft-mult-inverseN/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(r \cdot r, -0.25 \cdot \color{blue}{\left(w \cdot w\right)}, -1.5\right) \]
    8. Simplified78.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(r \cdot r, -0.25 \cdot \left(w \cdot w\right), -1.5\right)} \]
    9. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(w \cdot r, \frac{-1}{4} \cdot \color{blue}{\left(w \cdot r\right)}, \frac{-3}{2}\right) \]
      17. *-lowering-*.f6494.5

        \[\leadsto \mathsf{fma}\left(w \cdot r, -0.25 \cdot \color{blue}{\left(w \cdot r\right)}, -1.5\right) \]
    10. Applied egg-rr94.5%

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

    if -inf.0 < (-.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))) < -4.00000000000000029e70

    1. Initial program 99.3%

      \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l*N/A

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(3 + 2 \cdot \frac{1}{{r}^{2}}\right) - \frac{3}{8} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)} - \frac{9}{2} \]
    6. Step-by-step derivation
      1. cancel-sign-sub-invN/A

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

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

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

        \[\leadsto \left(\color{blue}{\left({r}^{2} \cdot {w}^{2}\right) \cdot \frac{-3}{8}} + \left(3 + 2 \cdot \frac{1}{{r}^{2}}\right)\right) - \frac{9}{2} \]
      5. accelerator-lowering-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right), \frac{-3}{8}, 3 + \frac{2}{\color{blue}{r \cdot r}}\right) - \frac{9}{2} \]
      17. *-lowering-*.f6481.6

        \[\leadsto \mathsf{fma}\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right), -0.375, 3 + \frac{2}{\color{blue}{r \cdot r}}\right) - 4.5 \]
    7. Simplified81.6%

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

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

        \[\leadsto \mathsf{fma}\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right), -0.375, \color{blue}{3}\right) - 4.5 \]
      2. Step-by-step derivation
        1. associate-*r*N/A

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

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

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

          \[\leadsto \mathsf{fma}\left(r \cdot \left(\color{blue}{\left(r \cdot w\right)} \cdot w\right), \frac{-3}{8}, 3\right) - \frac{9}{2} \]
        5. *-lowering-*.f6482.1

          \[\leadsto \mathsf{fma}\left(r \cdot \left(\color{blue}{\left(r \cdot w\right)} \cdot w\right), -0.375, 3\right) - 4.5 \]
      3. Applied egg-rr82.1%

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

      if 3 < (-.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)))

      1. Initial program 85.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. Add Preprocessing
      3. Taylor expanded in w around 0

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

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

          \[\leadsto 2 \cdot \frac{1}{{r}^{2}} + \color{blue}{\frac{-3}{2}} \]
        3. +-commutativeN/A

          \[\leadsto \color{blue}{\frac{-3}{2} + 2 \cdot \frac{1}{{r}^{2}}} \]
        4. +-lowering-+.f64N/A

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

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

          \[\leadsto \frac{-3}{2} + \frac{\color{blue}{2}}{{r}^{2}} \]
        7. /-lowering-/.f64N/A

          \[\leadsto \frac{-3}{2} + \color{blue}{\frac{2}{{r}^{2}}} \]
        8. unpow2N/A

          \[\leadsto \frac{-3}{2} + \frac{2}{\color{blue}{r \cdot r}} \]
        9. *-lowering-*.f6499.9

          \[\leadsto -1.5 + \frac{2}{\color{blue}{r \cdot r}} \]
      5. Simplified99.9%

        \[\leadsto \color{blue}{-1.5 + \frac{2}{r \cdot r}} \]
    10. Recombined 3 regimes into one program.
    11. Final simplification96.0%

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

    Alternative 3: 94.1% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2}{r \cdot r}\\ t_1 := \left(t\_0 + 3\right) + \frac{\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right) \cdot \left(0.125 \cdot \left(v \cdot 2 - 3\right)\right)}{1 - v}\\ t_2 := \mathsf{fma}\left(r \cdot w, -0.25 \cdot \left(r \cdot w\right), -1.5\right)\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq -4 \cdot 10^{+70}:\\ \;\;\;\;\mathsf{fma}\left(r, \mathsf{fma}\left(r, \mathsf{fma}\left(w, w \cdot -0.375, 0\right), 0\right), -1.5\right)\\ \mathbf{elif}\;t\_1 \leq 3:\\ \;\;\;\;t\_2\\ \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
             (+
              (+ t_0 3.0)
              (/ (* (* r (* r (* w w))) (* 0.125 (- (* v 2.0) 3.0))) (- 1.0 v))))
            (t_2 (fma (* r w) (* -0.25 (* r w)) -1.5)))
       (if (<= t_1 (- INFINITY))
         t_2
         (if (<= t_1 -4e+70)
           (fma r (fma r (fma w (* w -0.375) 0.0) 0.0) -1.5)
           (if (<= t_1 3.0) t_2 (+ t_0 -1.5))))))
    double code(double v, double w, double r) {
    	double t_0 = 2.0 / (r * r);
    	double t_1 = (t_0 + 3.0) + (((r * (r * (w * w))) * (0.125 * ((v * 2.0) - 3.0))) / (1.0 - v));
    	double t_2 = fma((r * w), (-0.25 * (r * w)), -1.5);
    	double tmp;
    	if (t_1 <= -((double) INFINITY)) {
    		tmp = t_2;
    	} else if (t_1 <= -4e+70) {
    		tmp = fma(r, fma(r, fma(w, (w * -0.375), 0.0), 0.0), -1.5);
    	} else if (t_1 <= 3.0) {
    		tmp = t_2;
    	} 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(t_0 + 3.0) + Float64(Float64(Float64(r * Float64(r * Float64(w * w))) * Float64(0.125 * Float64(Float64(v * 2.0) - 3.0))) / Float64(1.0 - v)))
    	t_2 = fma(Float64(r * w), Float64(-0.25 * Float64(r * w)), -1.5)
    	tmp = 0.0
    	if (t_1 <= Float64(-Inf))
    		tmp = t_2;
    	elseif (t_1 <= -4e+70)
    		tmp = fma(r, fma(r, fma(w, Float64(w * -0.375), 0.0), 0.0), -1.5);
    	elseif (t_1 <= 3.0)
    		tmp = t_2;
    	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[(N[(t$95$0 + 3.0), $MachinePrecision] + N[(N[(N[(r * N[(r * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.125 * N[(N[(v * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(r * w), $MachinePrecision] * N[(-0.25 * N[(r * w), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -4e+70], N[(r * N[(r * N[(w * N[(w * -0.375), $MachinePrecision] + 0.0), $MachinePrecision] + 0.0), $MachinePrecision] + -1.5), $MachinePrecision], If[LessEqual[t$95$1, 3.0], t$95$2, N[(t$95$0 + -1.5), $MachinePrecision]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{2}{r \cdot r}\\
    t_1 := \left(t\_0 + 3\right) + \frac{\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right) \cdot \left(0.125 \cdot \left(v \cdot 2 - 3\right)\right)}{1 - v}\\
    t_2 := \mathsf{fma}\left(r \cdot w, -0.25 \cdot \left(r \cdot w\right), -1.5\right)\\
    \mathbf{if}\;t\_1 \leq -\infty:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;t\_1 \leq -4 \cdot 10^{+70}:\\
    \;\;\;\;\mathsf{fma}\left(r, \mathsf{fma}\left(r, \mathsf{fma}\left(w, w \cdot -0.375, 0\right), 0\right), -1.5\right)\\
    
    \mathbf{elif}\;t\_1 \leq 3:\\
    \;\;\;\;t\_2\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0 + -1.5\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (-.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))) < -inf.0 or -4.00000000000000029e70 < (-.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))) < 3

      1. Initial program 80.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. Add Preprocessing
      3. 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)} \]
      4. Step-by-step derivation
        1. sub-negN/A

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

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

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

          \[\leadsto \left(\color{blue}{\frac{-3}{2}} + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
        5. distribute-lft-neg-inN/A

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

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

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

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

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

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

          \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
        12. accelerator-lowering-fma.f64N/A

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

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

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

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

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

          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w, w, \color{blue}{\frac{2 \cdot 1}{{r}^{2}}}\right) \]
      5. Simplified84.4%

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

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

          \[\leadsto {r}^{2} \cdot \color{blue}{\left(\frac{-1}{4} \cdot {w}^{2} + \left(\mathsf{neg}\left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)\right)} \]
        2. distribute-lft-inN/A

          \[\leadsto \color{blue}{{r}^{2} \cdot \left(\frac{-1}{4} \cdot {w}^{2}\right) + {r}^{2} \cdot \left(\mathsf{neg}\left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)} \]
        3. distribute-rgt-neg-inN/A

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

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

          \[\leadsto {r}^{2} \cdot \left(\frac{-1}{4} \cdot {w}^{2}\right) + \left(\mathsf{neg}\left(\color{blue}{\frac{3}{2} \cdot \left(\frac{1}{{r}^{2}} \cdot {r}^{2}\right)}\right)\right) \]
        6. lft-mult-inverseN/A

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(r \cdot r, -0.25 \cdot \color{blue}{\left(w \cdot w\right)}, -1.5\right) \]
      8. Simplified78.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(r \cdot r, -0.25 \cdot \left(w \cdot w\right), -1.5\right)} \]
      9. Step-by-step derivation
        1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(w \cdot r, \frac{-1}{4} \cdot \color{blue}{\left(w \cdot r\right)}, \frac{-3}{2}\right) \]
        17. *-lowering-*.f6494.5

          \[\leadsto \mathsf{fma}\left(w \cdot r, -0.25 \cdot \color{blue}{\left(w \cdot r\right)}, -1.5\right) \]
      10. Applied egg-rr94.5%

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

      if -inf.0 < (-.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))) < -4.00000000000000029e70

      1. Initial program 99.3%

        \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
      2. Add Preprocessing
      3. 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)} \]
      4. Step-by-step derivation
        1. sub-negN/A

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

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

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

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

          \[\leadsto \color{blue}{\frac{2}{{r}^{2}}} + \left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{3}{8} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) \]
        6. unpow2N/A

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

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

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

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

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

          \[\leadsto \frac{2}{r \cdot r} + \left(\left(\mathsf{neg}\left(\color{blue}{{w}^{2} \cdot \left(\frac{3}{8} \cdot {r}^{2}\right)}\right)\right) + \left(\mathsf{neg}\left(\frac{3}{2}\right)\right)\right) \]
        12. distribute-rgt-neg-inN/A

          \[\leadsto \frac{2}{r \cdot r} + \left(\color{blue}{{w}^{2} \cdot \left(\mathsf{neg}\left(\frac{3}{8} \cdot {r}^{2}\right)\right)} + \left(\mathsf{neg}\left(\frac{3}{2}\right)\right)\right) \]
        13. distribute-lft-neg-inN/A

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

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

          \[\leadsto \frac{2}{r \cdot r} + \left({w}^{2} \cdot \left(\frac{-3}{8} \cdot {r}^{2}\right) + \color{blue}{\frac{-3}{2}}\right) \]
        16. accelerator-lowering-fma.f64N/A

          \[\leadsto \frac{2}{r \cdot r} + \color{blue}{\mathsf{fma}\left({w}^{2}, \frac{-3}{8} \cdot {r}^{2}, \frac{-3}{2}\right)} \]
      5. Simplified76.8%

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

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

          \[\leadsto {r}^{2} \cdot \color{blue}{\left(\frac{-3}{8} \cdot {w}^{2} + \left(\mathsf{neg}\left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)\right)} \]
        2. distribute-rgt-inN/A

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

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

          \[\leadsto \color{blue}{\left(\left(\frac{-3}{8} \cdot {w}^{2}\right) \cdot r\right) \cdot r} + \left(\mathsf{neg}\left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right) \cdot {r}^{2} \]
        5. distribute-lft-neg-inN/A

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

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

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

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

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

          \[\leadsto \color{blue}{r \cdot \left(\left(\frac{-3}{8} \cdot {w}^{2}\right) \cdot r\right)} + \frac{-3}{2} \]
        11. accelerator-lowering-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(r, \left(\frac{-3}{8} \cdot {w}^{2}\right) \cdot r, \frac{-3}{2}\right)} \]
      8. Simplified81.7%

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

      if 3 < (-.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)))

      1. Initial program 85.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. Add Preprocessing
      3. Taylor expanded in w around 0

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

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

          \[\leadsto 2 \cdot \frac{1}{{r}^{2}} + \color{blue}{\frac{-3}{2}} \]
        3. +-commutativeN/A

          \[\leadsto \color{blue}{\frac{-3}{2} + 2 \cdot \frac{1}{{r}^{2}}} \]
        4. +-lowering-+.f64N/A

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

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

          \[\leadsto \frac{-3}{2} + \frac{\color{blue}{2}}{{r}^{2}} \]
        7. /-lowering-/.f64N/A

          \[\leadsto \frac{-3}{2} + \color{blue}{\frac{2}{{r}^{2}}} \]
        8. unpow2N/A

          \[\leadsto \frac{-3}{2} + \frac{2}{\color{blue}{r \cdot r}} \]
        9. *-lowering-*.f6499.9

          \[\leadsto -1.5 + \frac{2}{\color{blue}{r \cdot r}} \]
      5. Simplified99.9%

        \[\leadsto \color{blue}{-1.5 + \frac{2}{r \cdot r}} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification95.9%

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

    Alternative 4: 94.1% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2}{r \cdot r}\\ t_1 := \left(t\_0 + 3\right) + \frac{\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right) \cdot \left(0.125 \cdot \left(v \cdot 2 - 3\right)\right)}{1 - v}\\ t_2 := \mathsf{fma}\left(r \cdot w, -0.25 \cdot \left(r \cdot w\right), -1.5\right)\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq -4 \cdot 10^{+70}:\\ \;\;\;\;r \cdot \left(r \cdot \left(\left(w \cdot w\right) \cdot -0.375\right)\right)\\ \mathbf{elif}\;t\_1 \leq 3:\\ \;\;\;\;t\_2\\ \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
             (+
              (+ t_0 3.0)
              (/ (* (* r (* r (* w w))) (* 0.125 (- (* v 2.0) 3.0))) (- 1.0 v))))
            (t_2 (fma (* r w) (* -0.25 (* r w)) -1.5)))
       (if (<= t_1 (- INFINITY))
         t_2
         (if (<= t_1 -4e+70)
           (* r (* r (* (* w w) -0.375)))
           (if (<= t_1 3.0) t_2 (+ t_0 -1.5))))))
    double code(double v, double w, double r) {
    	double t_0 = 2.0 / (r * r);
    	double t_1 = (t_0 + 3.0) + (((r * (r * (w * w))) * (0.125 * ((v * 2.0) - 3.0))) / (1.0 - v));
    	double t_2 = fma((r * w), (-0.25 * (r * w)), -1.5);
    	double tmp;
    	if (t_1 <= -((double) INFINITY)) {
    		tmp = t_2;
    	} else if (t_1 <= -4e+70) {
    		tmp = r * (r * ((w * w) * -0.375));
    	} else if (t_1 <= 3.0) {
    		tmp = t_2;
    	} 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(t_0 + 3.0) + Float64(Float64(Float64(r * Float64(r * Float64(w * w))) * Float64(0.125 * Float64(Float64(v * 2.0) - 3.0))) / Float64(1.0 - v)))
    	t_2 = fma(Float64(r * w), Float64(-0.25 * Float64(r * w)), -1.5)
    	tmp = 0.0
    	if (t_1 <= Float64(-Inf))
    		tmp = t_2;
    	elseif (t_1 <= -4e+70)
    		tmp = Float64(r * Float64(r * Float64(Float64(w * w) * -0.375)));
    	elseif (t_1 <= 3.0)
    		tmp = t_2;
    	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[(N[(t$95$0 + 3.0), $MachinePrecision] + N[(N[(N[(r * N[(r * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.125 * N[(N[(v * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(r * w), $MachinePrecision] * N[(-0.25 * N[(r * w), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -4e+70], N[(r * N[(r * N[(N[(w * w), $MachinePrecision] * -0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 3.0], t$95$2, N[(t$95$0 + -1.5), $MachinePrecision]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{2}{r \cdot r}\\
    t_1 := \left(t\_0 + 3\right) + \frac{\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right) \cdot \left(0.125 \cdot \left(v \cdot 2 - 3\right)\right)}{1 - v}\\
    t_2 := \mathsf{fma}\left(r \cdot w, -0.25 \cdot \left(r \cdot w\right), -1.5\right)\\
    \mathbf{if}\;t\_1 \leq -\infty:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;t\_1 \leq -4 \cdot 10^{+70}:\\
    \;\;\;\;r \cdot \left(r \cdot \left(\left(w \cdot w\right) \cdot -0.375\right)\right)\\
    
    \mathbf{elif}\;t\_1 \leq 3:\\
    \;\;\;\;t\_2\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0 + -1.5\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (-.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))) < -inf.0 or -4.00000000000000029e70 < (-.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))) < 3

      1. Initial program 80.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. Add Preprocessing
      3. 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)} \]
      4. Step-by-step derivation
        1. sub-negN/A

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

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

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

          \[\leadsto \left(\color{blue}{\frac{-3}{2}} + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
        5. distribute-lft-neg-inN/A

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

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

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

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

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

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

          \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
        12. accelerator-lowering-fma.f64N/A

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

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

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

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

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

          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w, w, \color{blue}{\frac{2 \cdot 1}{{r}^{2}}}\right) \]
      5. Simplified84.4%

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

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

          \[\leadsto {r}^{2} \cdot \color{blue}{\left(\frac{-1}{4} \cdot {w}^{2} + \left(\mathsf{neg}\left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)\right)} \]
        2. distribute-lft-inN/A

          \[\leadsto \color{blue}{{r}^{2} \cdot \left(\frac{-1}{4} \cdot {w}^{2}\right) + {r}^{2} \cdot \left(\mathsf{neg}\left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)} \]
        3. distribute-rgt-neg-inN/A

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

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

          \[\leadsto {r}^{2} \cdot \left(\frac{-1}{4} \cdot {w}^{2}\right) + \left(\mathsf{neg}\left(\color{blue}{\frac{3}{2} \cdot \left(\frac{1}{{r}^{2}} \cdot {r}^{2}\right)}\right)\right) \]
        6. lft-mult-inverseN/A

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(r \cdot r, -0.25 \cdot \color{blue}{\left(w \cdot w\right)}, -1.5\right) \]
      8. Simplified78.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(r \cdot r, -0.25 \cdot \left(w \cdot w\right), -1.5\right)} \]
      9. Step-by-step derivation
        1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(w \cdot r, \frac{-1}{4} \cdot \color{blue}{\left(w \cdot r\right)}, \frac{-3}{2}\right) \]
        17. *-lowering-*.f6494.5

          \[\leadsto \mathsf{fma}\left(w \cdot r, -0.25 \cdot \color{blue}{\left(w \cdot r\right)}, -1.5\right) \]
      10. Applied egg-rr94.5%

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

      if -inf.0 < (-.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))) < -4.00000000000000029e70

      1. Initial program 99.3%

        \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. associate-*l*N/A

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(3 + 2 \cdot \frac{1}{{r}^{2}}\right) - \frac{3}{8} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)} - \frac{9}{2} \]
      6. Step-by-step derivation
        1. cancel-sign-sub-invN/A

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

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

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

          \[\leadsto \left(\color{blue}{\left({r}^{2} \cdot {w}^{2}\right) \cdot \frac{-3}{8}} + \left(3 + 2 \cdot \frac{1}{{r}^{2}}\right)\right) - \frac{9}{2} \]
        5. accelerator-lowering-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right), \frac{-3}{8}, 3 + \frac{2}{\color{blue}{r \cdot r}}\right) - \frac{9}{2} \]
        17. *-lowering-*.f6481.6

          \[\leadsto \mathsf{fma}\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right), -0.375, 3 + \frac{2}{\color{blue}{r \cdot r}}\right) - 4.5 \]
      7. Simplified81.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto r \cdot \left(r \cdot \left(\color{blue}{\left(w \cdot w\right)} \cdot \frac{-3}{8}\right)\right) \]
          11. *-lowering-*.f6481.5

            \[\leadsto r \cdot \left(r \cdot \left(\color{blue}{\left(w \cdot w\right)} \cdot -0.375\right)\right) \]
        4. Simplified81.5%

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

        if 3 < (-.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)))

        1. Initial program 85.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. Add Preprocessing
        3. Taylor expanded in w around 0

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

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

            \[\leadsto 2 \cdot \frac{1}{{r}^{2}} + \color{blue}{\frac{-3}{2}} \]
          3. +-commutativeN/A

            \[\leadsto \color{blue}{\frac{-3}{2} + 2 \cdot \frac{1}{{r}^{2}}} \]
          4. +-lowering-+.f64N/A

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

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

            \[\leadsto \frac{-3}{2} + \frac{\color{blue}{2}}{{r}^{2}} \]
          7. /-lowering-/.f64N/A

            \[\leadsto \frac{-3}{2} + \color{blue}{\frac{2}{{r}^{2}}} \]
          8. unpow2N/A

            \[\leadsto \frac{-3}{2} + \frac{2}{\color{blue}{r \cdot r}} \]
          9. *-lowering-*.f6499.9

            \[\leadsto -1.5 + \frac{2}{\color{blue}{r \cdot r}} \]
        5. Simplified99.9%

          \[\leadsto \color{blue}{-1.5 + \frac{2}{r \cdot r}} \]
      10. Recombined 3 regimes into one program.
      11. Final simplification95.9%

        \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\frac{2}{r \cdot r} + 3\right) + \frac{\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right) \cdot \left(0.125 \cdot \left(v \cdot 2 - 3\right)\right)}{1 - v} \leq -\infty:\\ \;\;\;\;\mathsf{fma}\left(r \cdot w, -0.25 \cdot \left(r \cdot w\right), -1.5\right)\\ \mathbf{elif}\;\left(\frac{2}{r \cdot r} + 3\right) + \frac{\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right) \cdot \left(0.125 \cdot \left(v \cdot 2 - 3\right)\right)}{1 - v} \leq -4 \cdot 10^{+70}:\\ \;\;\;\;r \cdot \left(r \cdot \left(\left(w \cdot w\right) \cdot -0.375\right)\right)\\ \mathbf{elif}\;\left(\frac{2}{r \cdot r} + 3\right) + \frac{\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right) \cdot \left(0.125 \cdot \left(v \cdot 2 - 3\right)\right)}{1 - v} \leq 3:\\ \;\;\;\;\mathsf{fma}\left(r \cdot w, -0.25 \cdot \left(r \cdot w\right), -1.5\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{r \cdot r} + -1.5\\ \end{array} \]
      12. Add Preprocessing

      Alternative 5: 92.5% accurate, 0.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2}{r \cdot r}\\ t_1 := \left(t\_0 + 3\right) + \frac{\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right) \cdot \left(0.125 \cdot \left(v \cdot 2 - 3\right)\right)}{1 - v}\\ t_2 := \mathsf{fma}\left(-0.25 \cdot w, r \cdot \left(r \cdot w\right), -1.5\right)\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq -4 \cdot 10^{+70}:\\ \;\;\;\;r \cdot \left(r \cdot \left(\left(w \cdot w\right) \cdot -0.375\right)\right)\\ \mathbf{elif}\;t\_1 \leq 3:\\ \;\;\;\;t\_2\\ \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
               (+
                (+ t_0 3.0)
                (/ (* (* r (* r (* w w))) (* 0.125 (- (* v 2.0) 3.0))) (- 1.0 v))))
              (t_2 (fma (* -0.25 w) (* r (* r w)) -1.5)))
         (if (<= t_1 (- INFINITY))
           t_2
           (if (<= t_1 -4e+70)
             (* r (* r (* (* w w) -0.375)))
             (if (<= t_1 3.0) t_2 (+ t_0 -1.5))))))
      double code(double v, double w, double r) {
      	double t_0 = 2.0 / (r * r);
      	double t_1 = (t_0 + 3.0) + (((r * (r * (w * w))) * (0.125 * ((v * 2.0) - 3.0))) / (1.0 - v));
      	double t_2 = fma((-0.25 * w), (r * (r * w)), -1.5);
      	double tmp;
      	if (t_1 <= -((double) INFINITY)) {
      		tmp = t_2;
      	} else if (t_1 <= -4e+70) {
      		tmp = r * (r * ((w * w) * -0.375));
      	} else if (t_1 <= 3.0) {
      		tmp = t_2;
      	} 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(t_0 + 3.0) + Float64(Float64(Float64(r * Float64(r * Float64(w * w))) * Float64(0.125 * Float64(Float64(v * 2.0) - 3.0))) / Float64(1.0 - v)))
      	t_2 = fma(Float64(-0.25 * w), Float64(r * Float64(r * w)), -1.5)
      	tmp = 0.0
      	if (t_1 <= Float64(-Inf))
      		tmp = t_2;
      	elseif (t_1 <= -4e+70)
      		tmp = Float64(r * Float64(r * Float64(Float64(w * w) * -0.375)));
      	elseif (t_1 <= 3.0)
      		tmp = t_2;
      	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[(N[(t$95$0 + 3.0), $MachinePrecision] + N[(N[(N[(r * N[(r * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.125 * N[(N[(v * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(-0.25 * w), $MachinePrecision] * N[(r * N[(r * w), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -4e+70], N[(r * N[(r * N[(N[(w * w), $MachinePrecision] * -0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 3.0], t$95$2, N[(t$95$0 + -1.5), $MachinePrecision]]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \frac{2}{r \cdot r}\\
      t_1 := \left(t\_0 + 3\right) + \frac{\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right) \cdot \left(0.125 \cdot \left(v \cdot 2 - 3\right)\right)}{1 - v}\\
      t_2 := \mathsf{fma}\left(-0.25 \cdot w, r \cdot \left(r \cdot w\right), -1.5\right)\\
      \mathbf{if}\;t\_1 \leq -\infty:\\
      \;\;\;\;t\_2\\
      
      \mathbf{elif}\;t\_1 \leq -4 \cdot 10^{+70}:\\
      \;\;\;\;r \cdot \left(r \cdot \left(\left(w \cdot w\right) \cdot -0.375\right)\right)\\
      
      \mathbf{elif}\;t\_1 \leq 3:\\
      \;\;\;\;t\_2\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0 + -1.5\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (-.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))) < -inf.0 or -4.00000000000000029e70 < (-.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))) < 3

        1. Initial program 80.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. Add Preprocessing
        3. 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)} \]
        4. Step-by-step derivation
          1. sub-negN/A

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

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

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

            \[\leadsto \left(\color{blue}{\frac{-3}{2}} + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
          5. distribute-lft-neg-inN/A

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

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

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

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

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

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

            \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
          12. accelerator-lowering-fma.f64N/A

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

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

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

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

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

            \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w, w, \color{blue}{\frac{2 \cdot 1}{{r}^{2}}}\right) \]
        5. Simplified84.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, r \cdot \left(r \cdot w\right), \color{blue}{\frac{2}{r \cdot r}} + \frac{-3}{2}\right) \]
          15. *-lowering-*.f6495.1

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

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

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

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

          if -inf.0 < (-.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))) < -4.00000000000000029e70

          1. Initial program 99.3%

            \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. associate-*l*N/A

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\left(\left(3 + 2 \cdot \frac{1}{{r}^{2}}\right) - \frac{3}{8} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)} - \frac{9}{2} \]
          6. Step-by-step derivation
            1. cancel-sign-sub-invN/A

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

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

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

              \[\leadsto \left(\color{blue}{\left({r}^{2} \cdot {w}^{2}\right) \cdot \frac{-3}{8}} + \left(3 + 2 \cdot \frac{1}{{r}^{2}}\right)\right) - \frac{9}{2} \]
            5. accelerator-lowering-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right), \frac{-3}{8}, 3 + \frac{2}{\color{blue}{r \cdot r}}\right) - \frac{9}{2} \]
            17. *-lowering-*.f6481.6

              \[\leadsto \mathsf{fma}\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right), -0.375, 3 + \frac{2}{\color{blue}{r \cdot r}}\right) - 4.5 \]
          7. Simplified81.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto r \cdot \left(r \cdot \left(\color{blue}{\left(w \cdot w\right)} \cdot \frac{-3}{8}\right)\right) \]
              11. *-lowering-*.f6481.5

                \[\leadsto r \cdot \left(r \cdot \left(\color{blue}{\left(w \cdot w\right)} \cdot -0.375\right)\right) \]
            4. Simplified81.5%

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

            if 3 < (-.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)))

            1. Initial program 85.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. Add Preprocessing
            3. Taylor expanded in w around 0

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

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

                \[\leadsto 2 \cdot \frac{1}{{r}^{2}} + \color{blue}{\frac{-3}{2}} \]
              3. +-commutativeN/A

                \[\leadsto \color{blue}{\frac{-3}{2} + 2 \cdot \frac{1}{{r}^{2}}} \]
              4. +-lowering-+.f64N/A

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

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

                \[\leadsto \frac{-3}{2} + \frac{\color{blue}{2}}{{r}^{2}} \]
              7. /-lowering-/.f64N/A

                \[\leadsto \frac{-3}{2} + \color{blue}{\frac{2}{{r}^{2}}} \]
              8. unpow2N/A

                \[\leadsto \frac{-3}{2} + \frac{2}{\color{blue}{r \cdot r}} \]
              9. *-lowering-*.f6499.9

                \[\leadsto -1.5 + \frac{2}{\color{blue}{r \cdot r}} \]
            5. Simplified99.9%

              \[\leadsto \color{blue}{-1.5 + \frac{2}{r \cdot r}} \]
          10. Recombined 3 regimes into one program.
          11. Final simplification94.5%

            \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\frac{2}{r \cdot r} + 3\right) + \frac{\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right) \cdot \left(0.125 \cdot \left(v \cdot 2 - 3\right)\right)}{1 - v} \leq -\infty:\\ \;\;\;\;\mathsf{fma}\left(-0.25 \cdot w, r \cdot \left(r \cdot w\right), -1.5\right)\\ \mathbf{elif}\;\left(\frac{2}{r \cdot r} + 3\right) + \frac{\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right) \cdot \left(0.125 \cdot \left(v \cdot 2 - 3\right)\right)}{1 - v} \leq -4 \cdot 10^{+70}:\\ \;\;\;\;r \cdot \left(r \cdot \left(\left(w \cdot w\right) \cdot -0.375\right)\right)\\ \mathbf{elif}\;\left(\frac{2}{r \cdot r} + 3\right) + \frac{\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right) \cdot \left(0.125 \cdot \left(v \cdot 2 - 3\right)\right)}{1 - v} \leq 3:\\ \;\;\;\;\mathsf{fma}\left(-0.25 \cdot w, r \cdot \left(r \cdot w\right), -1.5\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{r \cdot r} + -1.5\\ \end{array} \]
          12. Add Preprocessing

          Alternative 6: 95.7% accurate, 0.4× speedup?

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

            1. Initial program 75.6%

              \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
            2. Add Preprocessing
            3. Taylor expanded in 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)} \]
            4. Step-by-step derivation
              1. sub-negN/A

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

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

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

                \[\leadsto \left(\color{blue}{\frac{-3}{2}} + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
              5. distribute-lft-neg-inN/A

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

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

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

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

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

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

                \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
              12. accelerator-lowering-fma.f64N/A

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

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

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

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

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

                \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w, w, \color{blue}{\frac{2 \cdot 1}{{r}^{2}}}\right) \]
            5. Simplified94.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, r \cdot \left(r \cdot w\right), \color{blue}{\frac{2}{r \cdot r}} + \frac{-3}{2}\right) \]
              15. *-lowering-*.f6495.1

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(w \cdot -0.25, r \cdot \left(r \cdot w\right), \frac{2}{\color{blue}{r \cdot r}}\right) \]
            10. Simplified95.1%

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

            if -inf.0 < (-.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))) < -4.00000000000000029e70

            1. Initial program 99.3%

              \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. associate-*l*N/A

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

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

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

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

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

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

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

              \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \color{blue}{\left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)}}{1 - v}\right) - 4.5 \]
            5. Step-by-step derivation
              1. associate-*l*N/A

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

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

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

                \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\color{blue}{\left(\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot r\right)} \cdot \left(w \cdot \left(r \cdot w\right)\right)}{1 - v}\right) - \frac{9}{2} \]
              5. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -4.00000000000000029e70 < (-.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)))

              1. Initial program 87.3%

                \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
              2. Add Preprocessing
              3. 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)} \]
              4. Step-by-step derivation
                1. sub-negN/A

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

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

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

                  \[\leadsto \left(\color{blue}{\frac{-3}{2}} + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                5. distribute-lft-neg-inN/A

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

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

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

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

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

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

                  \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                12. accelerator-lowering-fma.f64N/A

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

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

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

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

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

                  \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w, w, \color{blue}{\frac{2 \cdot 1}{{r}^{2}}}\right) \]
              5. Simplified90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, r \cdot \left(r \cdot w\right), \color{blue}{\frac{2}{r \cdot r}} + \frac{-3}{2}\right) \]
                15. *-lowering-*.f6498.6

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(w \cdot -0.25, r \cdot \left(r \cdot w\right), \frac{2}{r \cdot r} + -1.5\right)} \]
            9. Recombined 3 regimes into one program.
            10. Final simplification97.5%

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

            Alternative 7: 95.8% accurate, 0.4× speedup?

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

              1. Initial program 75.6%

                \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
              2. Add Preprocessing
              3. Taylor expanded in 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)} \]
              4. Step-by-step derivation
                1. sub-negN/A

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

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

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

                  \[\leadsto \left(\color{blue}{\frac{-3}{2}} + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                5. distribute-lft-neg-inN/A

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

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

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

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

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

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

                  \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                12. accelerator-lowering-fma.f64N/A

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

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

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

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

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

                  \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w, w, \color{blue}{\frac{2 \cdot 1}{{r}^{2}}}\right) \]
              5. Simplified94.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, r \cdot \left(r \cdot w\right), \color{blue}{\frac{2}{r \cdot r}} + \frac{-3}{2}\right) \]
                15. *-lowering-*.f6495.1

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(w \cdot -0.25, r \cdot \left(r \cdot w\right), \frac{2}{\color{blue}{r \cdot r}}\right) \]
              10. Simplified95.1%

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

              if -inf.0 < (-.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))) < -5.00000000000000005e54

              1. Initial program 99.3%

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

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

                  \[\leadsto \color{blue}{\mathsf{neg}\left({r}^{2} \cdot \left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)} \]
                2. distribute-rgt-neg-inN/A

                  \[\leadsto \color{blue}{{r}^{2} \cdot \left(\mathsf{neg}\left(\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)\right)} \]
                3. distribute-neg-inN/A

                  \[\leadsto {r}^{2} \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v}\right)\right) + \left(\mathsf{neg}\left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)\right)} \]
                4. distribute-lft-inN/A

                  \[\leadsto \color{blue}{{r}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v}\right)\right) + {r}^{2} \cdot \left(\mathsf{neg}\left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)} \]
                5. distribute-rgt-neg-inN/A

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

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

                  \[\leadsto {r}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v}\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\frac{3}{2} \cdot \left(\frac{1}{{r}^{2}} \cdot {r}^{2}\right)}\right)\right) \]
                8. lft-mult-inverseN/A

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

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

                  \[\leadsto {r}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v}\right)\right) + \color{blue}{\frac{-3}{2}} \]
                11. accelerator-lowering-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(r \cdot \frac{\left(w \cdot w\right) \cdot \left(\frac{-1}{8} \cdot \color{blue}{\mathsf{fma}\left(v, -2, 3\right)}\right)}{1 - v}, r, \frac{-3}{2}\right) \]
                12. --lowering--.f6499.3

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

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

              if -5.00000000000000005e54 < (-.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)))

              1. Initial program 87.2%

                \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
              2. Add Preprocessing
              3. 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)} \]
              4. Step-by-step derivation
                1. sub-negN/A

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

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

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

                  \[\leadsto \left(\color{blue}{\frac{-3}{2}} + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                5. distribute-lft-neg-inN/A

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

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

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

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

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

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

                  \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                12. accelerator-lowering-fma.f64N/A

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

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

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

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

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

                  \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w, w, \color{blue}{\frac{2 \cdot 1}{{r}^{2}}}\right) \]
              5. Simplified90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, r \cdot \left(r \cdot w\right), \color{blue}{\frac{2}{r \cdot r}} + \frac{-3}{2}\right) \]
                15. *-lowering-*.f6498.6

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(w \cdot -0.25, r \cdot \left(r \cdot w\right), \frac{2}{r \cdot r} + -1.5\right)} \]
            3. Recombined 3 regimes into one program.
            4. Final simplification97.4%

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

            Alternative 8: 94.2% accurate, 0.4× speedup?

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

              1. Initial program 75.6%

                \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
              2. Add Preprocessing
              3. Taylor expanded in 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)} \]
              4. Step-by-step derivation
                1. sub-negN/A

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

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

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

                  \[\leadsto \left(\color{blue}{\frac{-3}{2}} + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                5. distribute-lft-neg-inN/A

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

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

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

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

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

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

                  \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                12. accelerator-lowering-fma.f64N/A

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

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

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

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

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

                  \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w, w, \color{blue}{\frac{2 \cdot 1}{{r}^{2}}}\right) \]
              5. Simplified94.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, r \cdot \left(r \cdot w\right), \color{blue}{\frac{2}{r \cdot r}} + \frac{-3}{2}\right) \]
                15. *-lowering-*.f6495.1

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(w \cdot -0.25, r \cdot \left(r \cdot w\right), \frac{2}{\color{blue}{r \cdot r}}\right) \]
              10. Simplified95.1%

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

              if -inf.0 < (-.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))) < -4.00000000000000029e70

              1. Initial program 99.3%

                \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. associate-*l*N/A

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\left(\left(3 + 2 \cdot \frac{1}{{r}^{2}}\right) - \frac{3}{8} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)} - \frac{9}{2} \]
              6. Step-by-step derivation
                1. cancel-sign-sub-invN/A

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

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

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

                  \[\leadsto \left(\color{blue}{\left({r}^{2} \cdot {w}^{2}\right) \cdot \frac{-3}{8}} + \left(3 + 2 \cdot \frac{1}{{r}^{2}}\right)\right) - \frac{9}{2} \]
                5. accelerator-lowering-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right), \frac{-3}{8}, 3 + \frac{2}{\color{blue}{r \cdot r}}\right) - \frac{9}{2} \]
                17. *-lowering-*.f6481.6

                  \[\leadsto \mathsf{fma}\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right), -0.375, 3 + \frac{2}{\color{blue}{r \cdot r}}\right) - 4.5 \]
              7. Simplified81.6%

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

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

                  \[\leadsto \mathsf{fma}\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right), -0.375, \color{blue}{3}\right) - 4.5 \]
                2. Step-by-step derivation
                  1. associate-*r*N/A

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

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

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

                    \[\leadsto \mathsf{fma}\left(r \cdot \left(\color{blue}{\left(r \cdot w\right)} \cdot w\right), \frac{-3}{8}, 3\right) - \frac{9}{2} \]
                  5. *-lowering-*.f6482.1

                    \[\leadsto \mathsf{fma}\left(r \cdot \left(\color{blue}{\left(r \cdot w\right)} \cdot w\right), -0.375, 3\right) - 4.5 \]
                3. Applied egg-rr82.1%

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

                if -4.00000000000000029e70 < (-.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)))

                1. Initial program 87.3%

                  \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
                2. Add Preprocessing
                3. 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)} \]
                4. Step-by-step derivation
                  1. sub-negN/A

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

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

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

                    \[\leadsto \left(\color{blue}{\frac{-3}{2}} + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                  5. distribute-lft-neg-inN/A

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

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

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

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

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

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

                    \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                  12. accelerator-lowering-fma.f64N/A

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

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

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

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

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

                    \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w, w, \color{blue}{\frac{2 \cdot 1}{{r}^{2}}}\right) \]
                5. Simplified90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, r \cdot \left(r \cdot w\right), \color{blue}{\frac{2}{r \cdot r}} + \frac{-3}{2}\right) \]
                  15. *-lowering-*.f6498.6

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

                  \[\leadsto \color{blue}{\mathsf{fma}\left(w \cdot -0.25, r \cdot \left(r \cdot w\right), \frac{2}{r \cdot r} + -1.5\right)} \]
              10. Recombined 3 regimes into one program.
              11. Final simplification96.2%

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

              Alternative 9: 90.4% accurate, 0.4× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2}{r \cdot r}\\ t_1 := \left(t\_0 + 3\right) + \frac{\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right) \cdot \left(0.125 \cdot \left(v \cdot 2 - 3\right)\right)}{1 - v}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\left(r \cdot r\right) \cdot \left(-0.25 \cdot \left(w \cdot w\right)\right)\\ \mathbf{elif}\;t\_1 \leq -5:\\ \;\;\;\;r \cdot \left(r \cdot \left(\left(w \cdot w\right) \cdot -0.375\right)\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
                       (+
                        (+ t_0 3.0)
                        (/ (* (* r (* r (* w w))) (* 0.125 (- (* v 2.0) 3.0))) (- 1.0 v)))))
                 (if (<= t_1 (- INFINITY))
                   (* (* r r) (* -0.25 (* w w)))
                   (if (<= t_1 -5.0) (* r (* r (* (* w w) -0.375))) (+ t_0 -1.5)))))
              double code(double v, double w, double r) {
              	double t_0 = 2.0 / (r * r);
              	double t_1 = (t_0 + 3.0) + (((r * (r * (w * w))) * (0.125 * ((v * 2.0) - 3.0))) / (1.0 - v));
              	double tmp;
              	if (t_1 <= -((double) INFINITY)) {
              		tmp = (r * r) * (-0.25 * (w * w));
              	} else if (t_1 <= -5.0) {
              		tmp = r * (r * ((w * w) * -0.375));
              	} else {
              		tmp = t_0 + -1.5;
              	}
              	return tmp;
              }
              
              public static double code(double v, double w, double r) {
              	double t_0 = 2.0 / (r * r);
              	double t_1 = (t_0 + 3.0) + (((r * (r * (w * w))) * (0.125 * ((v * 2.0) - 3.0))) / (1.0 - v));
              	double tmp;
              	if (t_1 <= -Double.POSITIVE_INFINITY) {
              		tmp = (r * r) * (-0.25 * (w * w));
              	} else if (t_1 <= -5.0) {
              		tmp = r * (r * ((w * w) * -0.375));
              	} else {
              		tmp = t_0 + -1.5;
              	}
              	return tmp;
              }
              
              def code(v, w, r):
              	t_0 = 2.0 / (r * r)
              	t_1 = (t_0 + 3.0) + (((r * (r * (w * w))) * (0.125 * ((v * 2.0) - 3.0))) / (1.0 - v))
              	tmp = 0
              	if t_1 <= -math.inf:
              		tmp = (r * r) * (-0.25 * (w * w))
              	elif t_1 <= -5.0:
              		tmp = r * (r * ((w * w) * -0.375))
              	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(t_0 + 3.0) + Float64(Float64(Float64(r * Float64(r * Float64(w * w))) * Float64(0.125 * Float64(Float64(v * 2.0) - 3.0))) / Float64(1.0 - v)))
              	tmp = 0.0
              	if (t_1 <= Float64(-Inf))
              		tmp = Float64(Float64(r * r) * Float64(-0.25 * Float64(w * w)));
              	elseif (t_1 <= -5.0)
              		tmp = Float64(r * Float64(r * Float64(Float64(w * w) * -0.375)));
              	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 = (t_0 + 3.0) + (((r * (r * (w * w))) * (0.125 * ((v * 2.0) - 3.0))) / (1.0 - v));
              	tmp = 0.0;
              	if (t_1 <= -Inf)
              		tmp = (r * r) * (-0.25 * (w * w));
              	elseif (t_1 <= -5.0)
              		tmp = r * (r * ((w * w) * -0.375));
              	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[(t$95$0 + 3.0), $MachinePrecision] + N[(N[(N[(r * N[(r * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.125 * N[(N[(v * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(r * r), $MachinePrecision] * N[(-0.25 * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5.0], N[(r * N[(r * N[(N[(w * w), $MachinePrecision] * -0.375), $MachinePrecision]), $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(t\_0 + 3\right) + \frac{\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right) \cdot \left(0.125 \cdot \left(v \cdot 2 - 3\right)\right)}{1 - v}\\
              \mathbf{if}\;t\_1 \leq -\infty:\\
              \;\;\;\;\left(r \cdot r\right) \cdot \left(-0.25 \cdot \left(w \cdot w\right)\right)\\
              
              \mathbf{elif}\;t\_1 \leq -5:\\
              \;\;\;\;r \cdot \left(r \cdot \left(\left(w \cdot w\right) \cdot -0.375\right)\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_0 + -1.5\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if (-.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))) < -inf.0

                1. Initial program 75.6%

                  \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
                2. Add Preprocessing
                3. Taylor expanded in 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)} \]
                4. Step-by-step derivation
                  1. sub-negN/A

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

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

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

                    \[\leadsto \left(\color{blue}{\frac{-3}{2}} + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                  5. distribute-lft-neg-inN/A

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

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

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

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

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

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

                    \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                  12. accelerator-lowering-fma.f64N/A

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

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

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

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

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

                    \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w, w, \color{blue}{\frac{2 \cdot 1}{{r}^{2}}}\right) \]
                5. Simplified94.0%

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(r \cdot r\right) \cdot \left(\frac{-1}{4} \cdot \color{blue}{\left(w \cdot w\right)}\right) \]
                  9. *-lowering-*.f6486.1

                    \[\leadsto \left(r \cdot r\right) \cdot \left(-0.25 \cdot \color{blue}{\left(w \cdot w\right)}\right) \]
                8. Simplified86.1%

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

                if -inf.0 < (-.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))) < -5

                1. Initial program 99.2%

                  \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
                2. Add Preprocessing
                3. Step-by-step derivation
                  1. associate-*l*N/A

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\left(\left(3 + 2 \cdot \frac{1}{{r}^{2}}\right) - \frac{3}{8} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)} - \frac{9}{2} \]
                6. Step-by-step derivation
                  1. cancel-sign-sub-invN/A

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

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

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

                    \[\leadsto \left(\color{blue}{\left({r}^{2} \cdot {w}^{2}\right) \cdot \frac{-3}{8}} + \left(3 + 2 \cdot \frac{1}{{r}^{2}}\right)\right) - \frac{9}{2} \]
                  5. accelerator-lowering-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto r \cdot \left(r \cdot \left(\color{blue}{\left(w \cdot w\right)} \cdot \frac{-3}{8}\right)\right) \]
                    11. *-lowering-*.f6470.3

                      \[\leadsto r \cdot \left(r \cdot \left(\color{blue}{\left(w \cdot w\right)} \cdot -0.375\right)\right) \]
                  4. Simplified70.3%

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

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

                  1. Initial program 87.0%

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

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

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

                      \[\leadsto 2 \cdot \frac{1}{{r}^{2}} + \color{blue}{\frac{-3}{2}} \]
                    3. +-commutativeN/A

                      \[\leadsto \color{blue}{\frac{-3}{2} + 2 \cdot \frac{1}{{r}^{2}}} \]
                    4. +-lowering-+.f64N/A

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

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

                      \[\leadsto \frac{-3}{2} + \frac{\color{blue}{2}}{{r}^{2}} \]
                    7. /-lowering-/.f64N/A

                      \[\leadsto \frac{-3}{2} + \color{blue}{\frac{2}{{r}^{2}}} \]
                    8. unpow2N/A

                      \[\leadsto \frac{-3}{2} + \frac{2}{\color{blue}{r \cdot r}} \]
                    9. *-lowering-*.f6498.0

                      \[\leadsto -1.5 + \frac{2}{\color{blue}{r \cdot r}} \]
                  5. Simplified98.0%

                    \[\leadsto \color{blue}{-1.5 + \frac{2}{r \cdot r}} \]
                10. Recombined 3 regimes into one program.
                11. Final simplification91.5%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\frac{2}{r \cdot r} + 3\right) + \frac{\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right) \cdot \left(0.125 \cdot \left(v \cdot 2 - 3\right)\right)}{1 - v} \leq -\infty:\\ \;\;\;\;\left(r \cdot r\right) \cdot \left(-0.25 \cdot \left(w \cdot w\right)\right)\\ \mathbf{elif}\;\left(\frac{2}{r \cdot r} + 3\right) + \frac{\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right) \cdot \left(0.125 \cdot \left(v \cdot 2 - 3\right)\right)}{1 - v} \leq -5:\\ \;\;\;\;r \cdot \left(r \cdot \left(\left(w \cdot w\right) \cdot -0.375\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{r \cdot r} + -1.5\\ \end{array} \]
                12. Add Preprocessing

                Alternative 10: 89.0% accurate, 0.8× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2}{r \cdot r}\\ \mathbf{if}\;\left(t\_0 + 3\right) + \frac{\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right) \cdot \left(0.125 \cdot \left(v \cdot 2 - 3\right)\right)}{1 - v} \leq -5:\\ \;\;\;\;r \cdot \left(r \cdot \left(\left(w \cdot w\right) \cdot -0.375\right)\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 (<=
                        (+
                         (+ t_0 3.0)
                         (/ (* (* r (* r (* w w))) (* 0.125 (- (* v 2.0) 3.0))) (- 1.0 v)))
                        -5.0)
                     (* r (* r (* (* w w) -0.375)))
                     (+ t_0 -1.5))))
                double code(double v, double w, double r) {
                	double t_0 = 2.0 / (r * r);
                	double tmp;
                	if (((t_0 + 3.0) + (((r * (r * (w * w))) * (0.125 * ((v * 2.0) - 3.0))) / (1.0 - v))) <= -5.0) {
                		tmp = r * (r * ((w * w) * -0.375));
                	} else {
                		tmp = t_0 + -1.5;
                	}
                	return tmp;
                }
                
                real(8) function code(v, w, r)
                    real(8), intent (in) :: v
                    real(8), intent (in) :: w
                    real(8), intent (in) :: r
                    real(8) :: t_0
                    real(8) :: tmp
                    t_0 = 2.0d0 / (r * r)
                    if (((t_0 + 3.0d0) + (((r * (r * (w * w))) * (0.125d0 * ((v * 2.0d0) - 3.0d0))) / (1.0d0 - v))) <= (-5.0d0)) then
                        tmp = r * (r * ((w * w) * (-0.375d0)))
                    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 (((t_0 + 3.0) + (((r * (r * (w * w))) * (0.125 * ((v * 2.0) - 3.0))) / (1.0 - v))) <= -5.0) {
                		tmp = r * (r * ((w * w) * -0.375));
                	} else {
                		tmp = t_0 + -1.5;
                	}
                	return tmp;
                }
                
                def code(v, w, r):
                	t_0 = 2.0 / (r * r)
                	tmp = 0
                	if ((t_0 + 3.0) + (((r * (r * (w * w))) * (0.125 * ((v * 2.0) - 3.0))) / (1.0 - v))) <= -5.0:
                		tmp = r * (r * ((w * w) * -0.375))
                	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(t_0 + 3.0) + Float64(Float64(Float64(r * Float64(r * Float64(w * w))) * Float64(0.125 * Float64(Float64(v * 2.0) - 3.0))) / Float64(1.0 - v))) <= -5.0)
                		tmp = Float64(r * Float64(r * Float64(Float64(w * w) * -0.375)));
                	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 (((t_0 + 3.0) + (((r * (r * (w * w))) * (0.125 * ((v * 2.0) - 3.0))) / (1.0 - v))) <= -5.0)
                		tmp = r * (r * ((w * w) * -0.375));
                	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[(t$95$0 + 3.0), $MachinePrecision] + N[(N[(N[(r * N[(r * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.125 * N[(N[(v * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5.0], N[(r * N[(r * N[(N[(w * w), $MachinePrecision] * -0.375), $MachinePrecision]), $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(t\_0 + 3\right) + \frac{\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right) \cdot \left(0.125 \cdot \left(v \cdot 2 - 3\right)\right)}{1 - v} \leq -5:\\
                \;\;\;\;r \cdot \left(r \cdot \left(\left(w \cdot w\right) \cdot -0.375\right)\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_0 + -1.5\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if (-.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))) < -5

                  1. Initial program 80.3%

                    \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
                  2. Add Preprocessing
                  3. Step-by-step derivation
                    1. associate-*l*N/A

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

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

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

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

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

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

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

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

                    \[\leadsto \color{blue}{\left(\left(3 + 2 \cdot \frac{1}{{r}^{2}}\right) - \frac{3}{8} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)} - \frac{9}{2} \]
                  6. Step-by-step derivation
                    1. cancel-sign-sub-invN/A

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

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

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

                      \[\leadsto \left(\color{blue}{\left({r}^{2} \cdot {w}^{2}\right) \cdot \frac{-3}{8}} + \left(3 + 2 \cdot \frac{1}{{r}^{2}}\right)\right) - \frac{9}{2} \]
                    5. accelerator-lowering-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right), \frac{-3}{8}, 3 + \frac{2}{\color{blue}{r \cdot r}}\right) - \frac{9}{2} \]
                    17. *-lowering-*.f6476.1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto r \cdot \left(r \cdot \left(\color{blue}{\left(w \cdot w\right)} \cdot \frac{-3}{8}\right)\right) \]
                      11. *-lowering-*.f6476.1

                        \[\leadsto r \cdot \left(r \cdot \left(\color{blue}{\left(w \cdot w\right)} \cdot -0.375\right)\right) \]
                    4. Simplified76.1%

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

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

                    1. Initial program 87.0%

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

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

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

                        \[\leadsto 2 \cdot \frac{1}{{r}^{2}} + \color{blue}{\frac{-3}{2}} \]
                      3. +-commutativeN/A

                        \[\leadsto \color{blue}{\frac{-3}{2} + 2 \cdot \frac{1}{{r}^{2}}} \]
                      4. +-lowering-+.f64N/A

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

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

                        \[\leadsto \frac{-3}{2} + \frac{\color{blue}{2}}{{r}^{2}} \]
                      7. /-lowering-/.f64N/A

                        \[\leadsto \frac{-3}{2} + \color{blue}{\frac{2}{{r}^{2}}} \]
                      8. unpow2N/A

                        \[\leadsto \frac{-3}{2} + \frac{2}{\color{blue}{r \cdot r}} \]
                      9. *-lowering-*.f6498.0

                        \[\leadsto -1.5 + \frac{2}{\color{blue}{r \cdot r}} \]
                    5. Simplified98.0%

                      \[\leadsto \color{blue}{-1.5 + \frac{2}{r \cdot r}} \]
                  10. Recombined 2 regimes into one program.
                  11. Final simplification88.6%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\frac{2}{r \cdot r} + 3\right) + \frac{\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right) \cdot \left(0.125 \cdot \left(v \cdot 2 - 3\right)\right)}{1 - v} \leq -5:\\ \;\;\;\;r \cdot \left(r \cdot \left(\left(w \cdot w\right) \cdot -0.375\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{r \cdot r} + -1.5\\ \end{array} \]
                  12. Add Preprocessing

                  Alternative 11: 96.9% accurate, 1.0× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2}{r \cdot r}\\ t_1 := t\_0 + -1.5\\ \mathbf{if}\;v \leq -8 \cdot 10^{-49}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, r \cdot \left(w \cdot \left(r \cdot w\right)\right), t\_1\right)\\ \mathbf{elif}\;v \leq 1.9 \cdot 10^{-60}:\\ \;\;\;\;\left(\left(t\_0 + 3\right) + \frac{\left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right) \cdot 0.375}{v + -1}\right) - 4.5\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.25 \cdot w, r \cdot \left(r \cdot w\right), t\_1\right)\\ \end{array} \end{array} \]
                  (FPCore (v w r)
                   :precision binary64
                   (let* ((t_0 (/ 2.0 (* r r))) (t_1 (+ t_0 -1.5)))
                     (if (<= v -8e-49)
                       (fma -0.25 (* r (* w (* r w))) t_1)
                       (if (<= v 1.9e-60)
                         (- (+ (+ t_0 3.0) (/ (* (* (* r w) (* r w)) 0.375) (+ v -1.0))) 4.5)
                         (fma (* -0.25 w) (* r (* r w)) t_1)))))
                  double code(double v, double w, double r) {
                  	double t_0 = 2.0 / (r * r);
                  	double t_1 = t_0 + -1.5;
                  	double tmp;
                  	if (v <= -8e-49) {
                  		tmp = fma(-0.25, (r * (w * (r * w))), t_1);
                  	} else if (v <= 1.9e-60) {
                  		tmp = ((t_0 + 3.0) + ((((r * w) * (r * w)) * 0.375) / (v + -1.0))) - 4.5;
                  	} else {
                  		tmp = fma((-0.25 * w), (r * (r * w)), t_1);
                  	}
                  	return tmp;
                  }
                  
                  function code(v, w, r)
                  	t_0 = Float64(2.0 / Float64(r * r))
                  	t_1 = Float64(t_0 + -1.5)
                  	tmp = 0.0
                  	if (v <= -8e-49)
                  		tmp = fma(-0.25, Float64(r * Float64(w * Float64(r * w))), t_1);
                  	elseif (v <= 1.9e-60)
                  		tmp = Float64(Float64(Float64(t_0 + 3.0) + Float64(Float64(Float64(Float64(r * w) * Float64(r * w)) * 0.375) / Float64(v + -1.0))) - 4.5);
                  	else
                  		tmp = fma(Float64(-0.25 * w), Float64(r * Float64(r * w)), 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 + -1.5), $MachinePrecision]}, If[LessEqual[v, -8e-49], N[(-0.25 * N[(r * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[v, 1.9e-60], N[(N[(N[(t$95$0 + 3.0), $MachinePrecision] + N[(N[(N[(N[(r * w), $MachinePrecision] * N[(r * w), $MachinePrecision]), $MachinePrecision] * 0.375), $MachinePrecision] / N[(v + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision], N[(N[(-0.25 * w), $MachinePrecision] * N[(r * N[(r * w), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := \frac{2}{r \cdot r}\\
                  t_1 := t\_0 + -1.5\\
                  \mathbf{if}\;v \leq -8 \cdot 10^{-49}:\\
                  \;\;\;\;\mathsf{fma}\left(-0.25, r \cdot \left(w \cdot \left(r \cdot w\right)\right), t\_1\right)\\
                  
                  \mathbf{elif}\;v \leq 1.9 \cdot 10^{-60}:\\
                  \;\;\;\;\left(\left(t\_0 + 3\right) + \frac{\left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right) \cdot 0.375}{v + -1}\right) - 4.5\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\mathsf{fma}\left(-0.25 \cdot w, r \cdot \left(r \cdot w\right), t\_1\right)\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if v < -7.99999999999999949e-49

                    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. Add Preprocessing
                    3. 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)} \]
                    4. Step-by-step derivation
                      1. sub-negN/A

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

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

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

                        \[\leadsto \left(\color{blue}{\frac{-3}{2}} + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                      5. distribute-lft-neg-inN/A

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

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

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

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

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

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

                        \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                      12. accelerator-lowering-fma.f64N/A

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

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

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

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

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

                        \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w, w, \color{blue}{\frac{2 \cdot 1}{{r}^{2}}}\right) \]
                    5. Simplified91.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, r \cdot \left(w \cdot \left(r \cdot w\right)\right), \color{blue}{\frac{2}{r \cdot r}} + \frac{-3}{2}\right) \]
                      17. *-lowering-*.f6498.5

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

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

                    if -7.99999999999999949e-49 < v < 1.89999999999999997e-60

                    1. Initial program 88.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. Add Preprocessing
                    3. Step-by-step derivation
                      1. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

                      if 1.89999999999999997e-60 < v

                      1. Initial program 77.2%

                        \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
                      2. Add Preprocessing
                      3. 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)} \]
                      4. Step-by-step derivation
                        1. sub-negN/A

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

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

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

                          \[\leadsto \left(\color{blue}{\frac{-3}{2}} + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        5. distribute-lft-neg-inN/A

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

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

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

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

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

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

                          \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        12. accelerator-lowering-fma.f64N/A

                          \[\leadsto \frac{-3}{2} + \color{blue}{\mathsf{fma}\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        13. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w}, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right)} \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        15. unpow2N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \color{blue}{\left(r \cdot r\right)}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        16. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \color{blue}{\left(r \cdot r\right)}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        17. associate-*r/N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w, w, \color{blue}{\frac{2 \cdot 1}{{r}^{2}}}\right) \]
                      5. Simplified87.6%

                        \[\leadsto \color{blue}{-1.5 + \mathsf{fma}\left(\left(-0.25 \cdot \left(r \cdot r\right)\right) \cdot w, w, \frac{2}{r \cdot r}\right)} \]
                      6. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \color{blue}{\left(\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w\right) \cdot w + \frac{2}{r \cdot r}\right) + \frac{-3}{2}} \]
                        2. associate-+l+N/A

                          \[\leadsto \color{blue}{\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w\right) \cdot w + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right)} \]
                        3. *-commutativeN/A

                          \[\leadsto \color{blue}{w \cdot \left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w\right)} + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        4. associate-*l*N/A

                          \[\leadsto w \cdot \color{blue}{\left(\frac{-1}{4} \cdot \left(\left(r \cdot r\right) \cdot w\right)\right)} + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        5. *-commutativeN/A

                          \[\leadsto w \cdot \left(\frac{-1}{4} \cdot \color{blue}{\left(w \cdot \left(r \cdot r\right)\right)}\right) + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        6. associate-*r*N/A

                          \[\leadsto \color{blue}{\left(w \cdot \frac{-1}{4}\right) \cdot \left(w \cdot \left(r \cdot r\right)\right)} + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        7. accelerator-lowering-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left(w \cdot \frac{-1}{4}, w \cdot \left(r \cdot r\right), \frac{2}{r \cdot r} + \frac{-3}{2}\right)} \]
                        8. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(\color{blue}{w \cdot \frac{-1}{4}}, w \cdot \left(r \cdot r\right), \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        9. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, \color{blue}{\left(r \cdot r\right) \cdot w}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        10. associate-*l*N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, \color{blue}{r \cdot \left(r \cdot w\right)}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        11. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, \color{blue}{r \cdot \left(r \cdot w\right)}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        12. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, r \cdot \color{blue}{\left(r \cdot w\right)}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        13. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, r \cdot \left(r \cdot w\right), \color{blue}{\frac{2}{r \cdot r} + \frac{-3}{2}}\right) \]
                        14. /-lowering-/.f64N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, r \cdot \left(r \cdot w\right), \color{blue}{\frac{2}{r \cdot r}} + \frac{-3}{2}\right) \]
                        15. *-lowering-*.f6497.0

                          \[\leadsto \mathsf{fma}\left(w \cdot -0.25, r \cdot \left(r \cdot w\right), \frac{2}{\color{blue}{r \cdot r}} + -1.5\right) \]
                      7. Applied egg-rr97.0%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(w \cdot -0.25, r \cdot \left(r \cdot w\right), \frac{2}{r \cdot r} + -1.5\right)} \]
                    7. Recombined 3 regimes into one program.
                    8. Final simplification98.7%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;v \leq -8 \cdot 10^{-49}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, r \cdot \left(w \cdot \left(r \cdot w\right)\right), \frac{2}{r \cdot r} + -1.5\right)\\ \mathbf{elif}\;v \leq 1.9 \cdot 10^{-60}:\\ \;\;\;\;\left(\left(\frac{2}{r \cdot r} + 3\right) + \frac{\left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right) \cdot 0.375}{v + -1}\right) - 4.5\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.25 \cdot w, r \cdot \left(r \cdot w\right), \frac{2}{r \cdot r} + -1.5\right)\\ \end{array} \]
                    9. Add Preprocessing

                    Alternative 12: 92.8% accurate, 1.4× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2}{r \cdot r} + -1.5\\ \mathbf{if}\;v \leq -2.45 \cdot 10^{+70}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, r \cdot \left(w \cdot \left(r \cdot w\right)\right), t\_0\right)\\ \mathbf{elif}\;v \leq 1.85 \cdot 10^{-60}:\\ \;\;\;\;\mathsf{fma}\left(w \cdot \left(w \cdot \left(r \cdot r\right)\right), -0.375, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.25 \cdot w, r \cdot \left(r \cdot w\right), t\_0\right)\\ \end{array} \end{array} \]
                    (FPCore (v w r)
                     :precision binary64
                     (let* ((t_0 (+ (/ 2.0 (* r r)) -1.5)))
                       (if (<= v -2.45e+70)
                         (fma -0.25 (* r (* w (* r w))) t_0)
                         (if (<= v 1.85e-60)
                           (fma (* w (* w (* r r))) -0.375 t_0)
                           (fma (* -0.25 w) (* r (* r w)) t_0)))))
                    double code(double v, double w, double r) {
                    	double t_0 = (2.0 / (r * r)) + -1.5;
                    	double tmp;
                    	if (v <= -2.45e+70) {
                    		tmp = fma(-0.25, (r * (w * (r * w))), t_0);
                    	} else if (v <= 1.85e-60) {
                    		tmp = fma((w * (w * (r * r))), -0.375, t_0);
                    	} else {
                    		tmp = fma((-0.25 * w), (r * (r * w)), t_0);
                    	}
                    	return tmp;
                    }
                    
                    function code(v, w, r)
                    	t_0 = Float64(Float64(2.0 / Float64(r * r)) + -1.5)
                    	tmp = 0.0
                    	if (v <= -2.45e+70)
                    		tmp = fma(-0.25, Float64(r * Float64(w * Float64(r * w))), t_0);
                    	elseif (v <= 1.85e-60)
                    		tmp = fma(Float64(w * Float64(w * Float64(r * r))), -0.375, t_0);
                    	else
                    		tmp = fma(Float64(-0.25 * w), Float64(r * Float64(r * w)), t_0);
                    	end
                    	return tmp
                    end
                    
                    code[v_, w_, r_] := Block[{t$95$0 = N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision]}, If[LessEqual[v, -2.45e+70], N[(-0.25 * N[(r * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[v, 1.85e-60], N[(N[(w * N[(w * N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.375 + t$95$0), $MachinePrecision], N[(N[(-0.25 * w), $MachinePrecision] * N[(r * N[(r * w), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := \frac{2}{r \cdot r} + -1.5\\
                    \mathbf{if}\;v \leq -2.45 \cdot 10^{+70}:\\
                    \;\;\;\;\mathsf{fma}\left(-0.25, r \cdot \left(w \cdot \left(r \cdot w\right)\right), t\_0\right)\\
                    
                    \mathbf{elif}\;v \leq 1.85 \cdot 10^{-60}:\\
                    \;\;\;\;\mathsf{fma}\left(w \cdot \left(w \cdot \left(r \cdot r\right)\right), -0.375, t\_0\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\mathsf{fma}\left(-0.25 \cdot w, r \cdot \left(r \cdot w\right), t\_0\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if v < -2.45000000000000014e70

                      1. Initial program 80.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. Add Preprocessing
                      3. 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)} \]
                      4. Step-by-step derivation
                        1. sub-negN/A

                          \[\leadsto \color{blue}{2 \cdot \frac{1}{{r}^{2}} + \left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right)} \]
                        2. +-commutativeN/A

                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}}} \]
                        3. distribute-neg-inN/A

                          \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(\frac{3}{2}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right)} + 2 \cdot \frac{1}{{r}^{2}} \]
                        4. metadata-evalN/A

                          \[\leadsto \left(\color{blue}{\frac{-3}{2}} + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        5. distribute-lft-neg-inN/A

                          \[\leadsto \left(\frac{-3}{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) \cdot \left({r}^{2} \cdot {w}^{2}\right)}\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        6. metadata-evalN/A

                          \[\leadsto \left(\frac{-3}{2} + \color{blue}{\frac{-1}{4}} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        7. associate-+l+N/A

                          \[\leadsto \color{blue}{\frac{-3}{2} + \left(\frac{-1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right) + 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        8. +-lowering-+.f64N/A

                          \[\leadsto \color{blue}{\frac{-3}{2} + \left(\frac{-1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right) + 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        9. associate-*r*N/A

                          \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot {w}^{2}} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        10. unpow2N/A

                          \[\leadsto \frac{-3}{2} + \left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot \color{blue}{\left(w \cdot w\right)} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        11. associate-*r*N/A

                          \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        12. accelerator-lowering-fma.f64N/A

                          \[\leadsto \frac{-3}{2} + \color{blue}{\mathsf{fma}\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        13. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w}, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right)} \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        15. unpow2N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \color{blue}{\left(r \cdot r\right)}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        16. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \color{blue}{\left(r \cdot r\right)}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        17. associate-*r/N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w, w, \color{blue}{\frac{2 \cdot 1}{{r}^{2}}}\right) \]
                      5. Simplified88.2%

                        \[\leadsto \color{blue}{-1.5 + \mathsf{fma}\left(\left(-0.25 \cdot \left(r \cdot r\right)\right) \cdot w, w, \frac{2}{r \cdot r}\right)} \]
                      6. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \color{blue}{\left(\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w\right) \cdot w + \frac{2}{r \cdot r}\right) + \frac{-3}{2}} \]
                        2. associate-+l+N/A

                          \[\leadsto \color{blue}{\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w\right) \cdot w + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right)} \]
                        3. associate-*l*N/A

                          \[\leadsto \color{blue}{\left(\frac{-1}{4} \cdot \left(\left(r \cdot r\right) \cdot w\right)\right)} \cdot w + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        4. *-commutativeN/A

                          \[\leadsto \left(\frac{-1}{4} \cdot \color{blue}{\left(w \cdot \left(r \cdot r\right)\right)}\right) \cdot w + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        5. associate-*l*N/A

                          \[\leadsto \color{blue}{\frac{-1}{4} \cdot \left(\left(w \cdot \left(r \cdot r\right)\right) \cdot w\right)} + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        6. *-commutativeN/A

                          \[\leadsto \frac{-1}{4} \cdot \color{blue}{\left(w \cdot \left(w \cdot \left(r \cdot r\right)\right)\right)} + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        7. accelerator-lowering-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{4}, w \cdot \left(w \cdot \left(r \cdot r\right)\right), \frac{2}{r \cdot r} + \frac{-3}{2}\right)} \]
                        8. associate-*r*N/A

                          \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, w \cdot \color{blue}{\left(\left(w \cdot r\right) \cdot r\right)}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        9. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, w \cdot \left(\color{blue}{\left(r \cdot w\right)} \cdot r\right), \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        10. associate-*r*N/A

                          \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, \color{blue}{\left(w \cdot \left(r \cdot w\right)\right) \cdot r}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        11. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, \color{blue}{r \cdot \left(w \cdot \left(r \cdot w\right)\right)}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        12. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, \color{blue}{r \cdot \left(w \cdot \left(r \cdot w\right)\right)}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        13. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, r \cdot \color{blue}{\left(w \cdot \left(r \cdot w\right)\right)}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, r \cdot \left(w \cdot \color{blue}{\left(r \cdot w\right)}\right), \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        15. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, r \cdot \left(w \cdot \left(r \cdot w\right)\right), \color{blue}{\frac{2}{r \cdot r} + \frac{-3}{2}}\right) \]
                        16. /-lowering-/.f64N/A

                          \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, r \cdot \left(w \cdot \left(r \cdot w\right)\right), \color{blue}{\frac{2}{r \cdot r}} + \frac{-3}{2}\right) \]
                        17. *-lowering-*.f6498.0

                          \[\leadsto \mathsf{fma}\left(-0.25, r \cdot \left(w \cdot \left(r \cdot w\right)\right), \frac{2}{\color{blue}{r \cdot r}} + -1.5\right) \]
                      7. Applied egg-rr98.0%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.25, r \cdot \left(w \cdot \left(r \cdot w\right)\right), \frac{2}{r \cdot r} + -1.5\right)} \]

                      if -2.45000000000000014e70 < v < 1.85000000000000012e-60

                      1. Initial program 89.0%

                        \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
                      2. Add Preprocessing
                      3. Taylor expanded in 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)} \]
                      4. Step-by-step derivation
                        1. sub-negN/A

                          \[\leadsto \color{blue}{2 \cdot \frac{1}{{r}^{2}} + \left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{3}{8} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right)} \]
                        2. +-lowering-+.f64N/A

                          \[\leadsto \color{blue}{2 \cdot \frac{1}{{r}^{2}} + \left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{3}{8} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right)} \]
                        3. associate-*r/N/A

                          \[\leadsto \color{blue}{\frac{2 \cdot 1}{{r}^{2}}} + \left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{3}{8} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) \]
                        4. metadata-evalN/A

                          \[\leadsto \frac{\color{blue}{2}}{{r}^{2}} + \left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{3}{8} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) \]
                        5. /-lowering-/.f64N/A

                          \[\leadsto \color{blue}{\frac{2}{{r}^{2}}} + \left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{3}{8} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) \]
                        6. unpow2N/A

                          \[\leadsto \frac{2}{\color{blue}{r \cdot r}} + \left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{3}{8} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) \]
                        7. *-lowering-*.f64N/A

                          \[\leadsto \frac{2}{\color{blue}{r \cdot r}} + \left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{3}{8} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) \]
                        8. +-commutativeN/A

                          \[\leadsto \frac{2}{r \cdot r} + \left(\mathsf{neg}\left(\color{blue}{\left(\frac{3}{8} \cdot \left({r}^{2} \cdot {w}^{2}\right) + \frac{3}{2}\right)}\right)\right) \]
                        9. distribute-neg-inN/A

                          \[\leadsto \frac{2}{r \cdot r} + \color{blue}{\left(\left(\mathsf{neg}\left(\frac{3}{8} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right) + \left(\mathsf{neg}\left(\frac{3}{2}\right)\right)\right)} \]
                        10. associate-*r*N/A

                          \[\leadsto \frac{2}{r \cdot r} + \left(\left(\mathsf{neg}\left(\color{blue}{\left(\frac{3}{8} \cdot {r}^{2}\right) \cdot {w}^{2}}\right)\right) + \left(\mathsf{neg}\left(\frac{3}{2}\right)\right)\right) \]
                        11. *-commutativeN/A

                          \[\leadsto \frac{2}{r \cdot r} + \left(\left(\mathsf{neg}\left(\color{blue}{{w}^{2} \cdot \left(\frac{3}{8} \cdot {r}^{2}\right)}\right)\right) + \left(\mathsf{neg}\left(\frac{3}{2}\right)\right)\right) \]
                        12. distribute-rgt-neg-inN/A

                          \[\leadsto \frac{2}{r \cdot r} + \left(\color{blue}{{w}^{2} \cdot \left(\mathsf{neg}\left(\frac{3}{8} \cdot {r}^{2}\right)\right)} + \left(\mathsf{neg}\left(\frac{3}{2}\right)\right)\right) \]
                        13. distribute-lft-neg-inN/A

                          \[\leadsto \frac{2}{r \cdot r} + \left({w}^{2} \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{3}{8}\right)\right) \cdot {r}^{2}\right)} + \left(\mathsf{neg}\left(\frac{3}{2}\right)\right)\right) \]
                        14. metadata-evalN/A

                          \[\leadsto \frac{2}{r \cdot r} + \left({w}^{2} \cdot \left(\color{blue}{\frac{-3}{8}} \cdot {r}^{2}\right) + \left(\mathsf{neg}\left(\frac{3}{2}\right)\right)\right) \]
                        15. metadata-evalN/A

                          \[\leadsto \frac{2}{r \cdot r} + \left({w}^{2} \cdot \left(\frac{-3}{8} \cdot {r}^{2}\right) + \color{blue}{\frac{-3}{2}}\right) \]
                        16. accelerator-lowering-fma.f64N/A

                          \[\leadsto \frac{2}{r \cdot r} + \color{blue}{\mathsf{fma}\left({w}^{2}, \frac{-3}{8} \cdot {r}^{2}, \frac{-3}{2}\right)} \]
                      5. Simplified86.1%

                        \[\leadsto \color{blue}{\frac{2}{r \cdot r} + \mathsf{fma}\left(w \cdot w, \left(r \cdot r\right) \cdot -0.375, -1.5\right)} \]
                      6. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \color{blue}{\left(\left(w \cdot w\right) \cdot \left(\left(r \cdot r\right) \cdot \frac{-3}{8}\right) + \frac{-3}{2}\right) + \frac{2}{r \cdot r}} \]
                        2. associate-+l+N/A

                          \[\leadsto \color{blue}{\left(w \cdot w\right) \cdot \left(\left(r \cdot r\right) \cdot \frac{-3}{8}\right) + \left(\frac{-3}{2} + \frac{2}{r \cdot r}\right)} \]
                        3. *-commutativeN/A

                          \[\leadsto \color{blue}{\left(\left(r \cdot r\right) \cdot \frac{-3}{8}\right) \cdot \left(w \cdot w\right)} + \left(\frac{-3}{2} + \frac{2}{r \cdot r}\right) \]
                        4. *-commutativeN/A

                          \[\leadsto \color{blue}{\left(\frac{-3}{8} \cdot \left(r \cdot r\right)\right)} \cdot \left(w \cdot w\right) + \left(\frac{-3}{2} + \frac{2}{r \cdot r}\right) \]
                        5. associate-*r*N/A

                          \[\leadsto \color{blue}{\frac{-3}{8} \cdot \left(\left(r \cdot r\right) \cdot \left(w \cdot w\right)\right)} + \left(\frac{-3}{2} + \frac{2}{r \cdot r}\right) \]
                        6. associate-*r*N/A

                          \[\leadsto \frac{-3}{8} \cdot \color{blue}{\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right)} + \left(\frac{-3}{2} + \frac{2}{r \cdot r}\right) \]
                        7. *-commutativeN/A

                          \[\leadsto \color{blue}{\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right) \cdot \frac{-3}{8}} + \left(\frac{-3}{2} + \frac{2}{r \cdot r}\right) \]
                        8. +-commutativeN/A

                          \[\leadsto \left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right) \cdot \frac{-3}{8} + \color{blue}{\left(\frac{2}{r \cdot r} + \frac{-3}{2}\right)} \]
                        9. accelerator-lowering-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right), \frac{-3}{8}, \frac{2}{r \cdot r} + \frac{-3}{2}\right)} \]
                        10. associate-*r*N/A

                          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(r \cdot r\right) \cdot \left(w \cdot w\right)}, \frac{-3}{8}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        11. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(w \cdot w\right) \cdot \left(r \cdot r\right)}, \frac{-3}{8}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        12. associate-*l*N/A

                          \[\leadsto \mathsf{fma}\left(\color{blue}{w \cdot \left(w \cdot \left(r \cdot r\right)\right)}, \frac{-3}{8}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        13. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \color{blue}{\left(\left(r \cdot r\right) \cdot w\right)}, \frac{-3}{8}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        14. associate-*r*N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \color{blue}{\left(r \cdot \left(r \cdot w\right)\right)}, \frac{-3}{8}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        15. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(\color{blue}{w \cdot \left(r \cdot \left(r \cdot w\right)\right)}, \frac{-3}{8}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        16. associate-*r*N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \color{blue}{\left(\left(r \cdot r\right) \cdot w\right)}, \frac{-3}{8}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        17. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \color{blue}{\left(w \cdot \left(r \cdot r\right)\right)}, \frac{-3}{8}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        18. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \color{blue}{\left(w \cdot \left(r \cdot r\right)\right)}, \frac{-3}{8}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        19. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \left(w \cdot \color{blue}{\left(r \cdot r\right)}\right), \frac{-3}{8}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        20. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \left(w \cdot \left(r \cdot r\right)\right), \frac{-3}{8}, \color{blue}{\frac{2}{r \cdot r} + \frac{-3}{2}}\right) \]
                        21. /-lowering-/.f64N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \left(w \cdot \left(r \cdot r\right)\right), \frac{-3}{8}, \color{blue}{\frac{2}{r \cdot r}} + \frac{-3}{2}\right) \]
                        22. *-lowering-*.f6497.0

                          \[\leadsto \mathsf{fma}\left(w \cdot \left(w \cdot \left(r \cdot r\right)\right), -0.375, \frac{2}{\color{blue}{r \cdot r}} + -1.5\right) \]
                      7. Applied egg-rr97.0%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(w \cdot \left(w \cdot \left(r \cdot r\right)\right), -0.375, \frac{2}{r \cdot r} + -1.5\right)} \]

                      if 1.85000000000000012e-60 < v

                      1. Initial program 77.2%

                        \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
                      2. Add Preprocessing
                      3. 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)} \]
                      4. Step-by-step derivation
                        1. sub-negN/A

                          \[\leadsto \color{blue}{2 \cdot \frac{1}{{r}^{2}} + \left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right)} \]
                        2. +-commutativeN/A

                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}}} \]
                        3. distribute-neg-inN/A

                          \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(\frac{3}{2}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right)} + 2 \cdot \frac{1}{{r}^{2}} \]
                        4. metadata-evalN/A

                          \[\leadsto \left(\color{blue}{\frac{-3}{2}} + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        5. distribute-lft-neg-inN/A

                          \[\leadsto \left(\frac{-3}{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) \cdot \left({r}^{2} \cdot {w}^{2}\right)}\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        6. metadata-evalN/A

                          \[\leadsto \left(\frac{-3}{2} + \color{blue}{\frac{-1}{4}} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        7. associate-+l+N/A

                          \[\leadsto \color{blue}{\frac{-3}{2} + \left(\frac{-1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right) + 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        8. +-lowering-+.f64N/A

                          \[\leadsto \color{blue}{\frac{-3}{2} + \left(\frac{-1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right) + 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        9. associate-*r*N/A

                          \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot {w}^{2}} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        10. unpow2N/A

                          \[\leadsto \frac{-3}{2} + \left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot \color{blue}{\left(w \cdot w\right)} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        11. associate-*r*N/A

                          \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        12. accelerator-lowering-fma.f64N/A

                          \[\leadsto \frac{-3}{2} + \color{blue}{\mathsf{fma}\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        13. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w}, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right)} \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        15. unpow2N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \color{blue}{\left(r \cdot r\right)}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        16. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \color{blue}{\left(r \cdot r\right)}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        17. associate-*r/N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w, w, \color{blue}{\frac{2 \cdot 1}{{r}^{2}}}\right) \]
                      5. Simplified87.6%

                        \[\leadsto \color{blue}{-1.5 + \mathsf{fma}\left(\left(-0.25 \cdot \left(r \cdot r\right)\right) \cdot w, w, \frac{2}{r \cdot r}\right)} \]
                      6. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \color{blue}{\left(\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w\right) \cdot w + \frac{2}{r \cdot r}\right) + \frac{-3}{2}} \]
                        2. associate-+l+N/A

                          \[\leadsto \color{blue}{\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w\right) \cdot w + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right)} \]
                        3. *-commutativeN/A

                          \[\leadsto \color{blue}{w \cdot \left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w\right)} + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        4. associate-*l*N/A

                          \[\leadsto w \cdot \color{blue}{\left(\frac{-1}{4} \cdot \left(\left(r \cdot r\right) \cdot w\right)\right)} + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        5. *-commutativeN/A

                          \[\leadsto w \cdot \left(\frac{-1}{4} \cdot \color{blue}{\left(w \cdot \left(r \cdot r\right)\right)}\right) + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        6. associate-*r*N/A

                          \[\leadsto \color{blue}{\left(w \cdot \frac{-1}{4}\right) \cdot \left(w \cdot \left(r \cdot r\right)\right)} + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        7. accelerator-lowering-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left(w \cdot \frac{-1}{4}, w \cdot \left(r \cdot r\right), \frac{2}{r \cdot r} + \frac{-3}{2}\right)} \]
                        8. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(\color{blue}{w \cdot \frac{-1}{4}}, w \cdot \left(r \cdot r\right), \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        9. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, \color{blue}{\left(r \cdot r\right) \cdot w}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        10. associate-*l*N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, \color{blue}{r \cdot \left(r \cdot w\right)}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        11. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, \color{blue}{r \cdot \left(r \cdot w\right)}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        12. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, r \cdot \color{blue}{\left(r \cdot w\right)}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        13. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, r \cdot \left(r \cdot w\right), \color{blue}{\frac{2}{r \cdot r} + \frac{-3}{2}}\right) \]
                        14. /-lowering-/.f64N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, r \cdot \left(r \cdot w\right), \color{blue}{\frac{2}{r \cdot r}} + \frac{-3}{2}\right) \]
                        15. *-lowering-*.f6497.0

                          \[\leadsto \mathsf{fma}\left(w \cdot -0.25, r \cdot \left(r \cdot w\right), \frac{2}{\color{blue}{r \cdot r}} + -1.5\right) \]
                      7. Applied egg-rr97.0%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(w \cdot -0.25, r \cdot \left(r \cdot w\right), \frac{2}{r \cdot r} + -1.5\right)} \]
                    3. Recombined 3 regimes into one program.
                    4. Final simplification97.2%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;v \leq -2.45 \cdot 10^{+70}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, r \cdot \left(w \cdot \left(r \cdot w\right)\right), \frac{2}{r \cdot r} + -1.5\right)\\ \mathbf{elif}\;v \leq 1.85 \cdot 10^{-60}:\\ \;\;\;\;\mathsf{fma}\left(w \cdot \left(w \cdot \left(r \cdot r\right)\right), -0.375, \frac{2}{r \cdot r} + -1.5\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.25 \cdot w, r \cdot \left(r \cdot w\right), \frac{2}{r \cdot r} + -1.5\right)\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 13: 90.4% accurate, 1.6× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2}{r \cdot r}\\ \mathbf{if}\;r \leq 2 \cdot 10^{+126}:\\ \;\;\;\;-1.5 + \mathsf{fma}\left(w \cdot \left(-0.25 \cdot \left(r \cdot r\right)\right), w, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, r \cdot \left(w \cdot \left(r \cdot w\right)\right), t\_0 + -1.5\right)\\ \end{array} \end{array} \]
                    (FPCore (v w r)
                     :precision binary64
                     (let* ((t_0 (/ 2.0 (* r r))))
                       (if (<= r 2e+126)
                         (+ -1.5 (fma (* w (* -0.25 (* r r))) w t_0))
                         (fma -0.25 (* r (* w (* r w))) (+ t_0 -1.5)))))
                    double code(double v, double w, double r) {
                    	double t_0 = 2.0 / (r * r);
                    	double tmp;
                    	if (r <= 2e+126) {
                    		tmp = -1.5 + fma((w * (-0.25 * (r * r))), w, t_0);
                    	} else {
                    		tmp = fma(-0.25, (r * (w * (r * w))), (t_0 + -1.5));
                    	}
                    	return tmp;
                    }
                    
                    function code(v, w, r)
                    	t_0 = Float64(2.0 / Float64(r * r))
                    	tmp = 0.0
                    	if (r <= 2e+126)
                    		tmp = Float64(-1.5 + fma(Float64(w * Float64(-0.25 * Float64(r * r))), w, t_0));
                    	else
                    		tmp = fma(-0.25, Float64(r * Float64(w * Float64(r * w))), 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]}, If[LessEqual[r, 2e+126], N[(-1.5 + N[(N[(w * N[(-0.25 * N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * w + t$95$0), $MachinePrecision]), $MachinePrecision], N[(-0.25 * N[(r * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 + -1.5), $MachinePrecision]), $MachinePrecision]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := \frac{2}{r \cdot r}\\
                    \mathbf{if}\;r \leq 2 \cdot 10^{+126}:\\
                    \;\;\;\;-1.5 + \mathsf{fma}\left(w \cdot \left(-0.25 \cdot \left(r \cdot r\right)\right), w, t\_0\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\mathsf{fma}\left(-0.25, r \cdot \left(w \cdot \left(r \cdot w\right)\right), t\_0 + -1.5\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if r < 1.99999999999999985e126

                      1. Initial program 83.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. Add Preprocessing
                      3. 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)} \]
                      4. Step-by-step derivation
                        1. sub-negN/A

                          \[\leadsto \color{blue}{2 \cdot \frac{1}{{r}^{2}} + \left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right)} \]
                        2. +-commutativeN/A

                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}}} \]
                        3. distribute-neg-inN/A

                          \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(\frac{3}{2}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right)} + 2 \cdot \frac{1}{{r}^{2}} \]
                        4. metadata-evalN/A

                          \[\leadsto \left(\color{blue}{\frac{-3}{2}} + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        5. distribute-lft-neg-inN/A

                          \[\leadsto \left(\frac{-3}{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) \cdot \left({r}^{2} \cdot {w}^{2}\right)}\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        6. metadata-evalN/A

                          \[\leadsto \left(\frac{-3}{2} + \color{blue}{\frac{-1}{4}} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        7. associate-+l+N/A

                          \[\leadsto \color{blue}{\frac{-3}{2} + \left(\frac{-1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right) + 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        8. +-lowering-+.f64N/A

                          \[\leadsto \color{blue}{\frac{-3}{2} + \left(\frac{-1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right) + 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        9. associate-*r*N/A

                          \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot {w}^{2}} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        10. unpow2N/A

                          \[\leadsto \frac{-3}{2} + \left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot \color{blue}{\left(w \cdot w\right)} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        11. associate-*r*N/A

                          \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        12. accelerator-lowering-fma.f64N/A

                          \[\leadsto \frac{-3}{2} + \color{blue}{\mathsf{fma}\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        13. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w}, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right)} \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        15. unpow2N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \color{blue}{\left(r \cdot r\right)}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        16. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \color{blue}{\left(r \cdot r\right)}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        17. associate-*r/N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w, w, \color{blue}{\frac{2 \cdot 1}{{r}^{2}}}\right) \]
                      5. Simplified90.1%

                        \[\leadsto \color{blue}{-1.5 + \mathsf{fma}\left(\left(-0.25 \cdot \left(r \cdot r\right)\right) \cdot w, w, \frac{2}{r \cdot r}\right)} \]

                      if 1.99999999999999985e126 < r

                      1. Initial program 87.6%

                        \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
                      2. Add Preprocessing
                      3. Taylor expanded in 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)} \]
                      4. Step-by-step derivation
                        1. sub-negN/A

                          \[\leadsto \color{blue}{2 \cdot \frac{1}{{r}^{2}} + \left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right)} \]
                        2. +-commutativeN/A

                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}}} \]
                        3. distribute-neg-inN/A

                          \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(\frac{3}{2}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right)} + 2 \cdot \frac{1}{{r}^{2}} \]
                        4. metadata-evalN/A

                          \[\leadsto \left(\color{blue}{\frac{-3}{2}} + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        5. distribute-lft-neg-inN/A

                          \[\leadsto \left(\frac{-3}{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) \cdot \left({r}^{2} \cdot {w}^{2}\right)}\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        6. metadata-evalN/A

                          \[\leadsto \left(\frac{-3}{2} + \color{blue}{\frac{-1}{4}} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        7. associate-+l+N/A

                          \[\leadsto \color{blue}{\frac{-3}{2} + \left(\frac{-1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right) + 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        8. +-lowering-+.f64N/A

                          \[\leadsto \color{blue}{\frac{-3}{2} + \left(\frac{-1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right) + 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        9. associate-*r*N/A

                          \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot {w}^{2}} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        10. unpow2N/A

                          \[\leadsto \frac{-3}{2} + \left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot \color{blue}{\left(w \cdot w\right)} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        11. associate-*r*N/A

                          \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        12. accelerator-lowering-fma.f64N/A

                          \[\leadsto \frac{-3}{2} + \color{blue}{\mathsf{fma}\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        13. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w}, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right)} \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        15. unpow2N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \color{blue}{\left(r \cdot r\right)}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        16. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \color{blue}{\left(r \cdot r\right)}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        17. associate-*r/N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w, w, \color{blue}{\frac{2 \cdot 1}{{r}^{2}}}\right) \]
                      5. Simplified63.1%

                        \[\leadsto \color{blue}{-1.5 + \mathsf{fma}\left(\left(-0.25 \cdot \left(r \cdot r\right)\right) \cdot w, w, \frac{2}{r \cdot r}\right)} \]
                      6. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \color{blue}{\left(\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w\right) \cdot w + \frac{2}{r \cdot r}\right) + \frac{-3}{2}} \]
                        2. associate-+l+N/A

                          \[\leadsto \color{blue}{\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w\right) \cdot w + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right)} \]
                        3. associate-*l*N/A

                          \[\leadsto \color{blue}{\left(\frac{-1}{4} \cdot \left(\left(r \cdot r\right) \cdot w\right)\right)} \cdot w + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        4. *-commutativeN/A

                          \[\leadsto \left(\frac{-1}{4} \cdot \color{blue}{\left(w \cdot \left(r \cdot r\right)\right)}\right) \cdot w + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        5. associate-*l*N/A

                          \[\leadsto \color{blue}{\frac{-1}{4} \cdot \left(\left(w \cdot \left(r \cdot r\right)\right) \cdot w\right)} + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        6. *-commutativeN/A

                          \[\leadsto \frac{-1}{4} \cdot \color{blue}{\left(w \cdot \left(w \cdot \left(r \cdot r\right)\right)\right)} + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        7. accelerator-lowering-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{4}, w \cdot \left(w \cdot \left(r \cdot r\right)\right), \frac{2}{r \cdot r} + \frac{-3}{2}\right)} \]
                        8. associate-*r*N/A

                          \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, w \cdot \color{blue}{\left(\left(w \cdot r\right) \cdot r\right)}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        9. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, w \cdot \left(\color{blue}{\left(r \cdot w\right)} \cdot r\right), \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        10. associate-*r*N/A

                          \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, \color{blue}{\left(w \cdot \left(r \cdot w\right)\right) \cdot r}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        11. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, \color{blue}{r \cdot \left(w \cdot \left(r \cdot w\right)\right)}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        12. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, \color{blue}{r \cdot \left(w \cdot \left(r \cdot w\right)\right)}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        13. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, r \cdot \color{blue}{\left(w \cdot \left(r \cdot w\right)\right)}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, r \cdot \left(w \cdot \color{blue}{\left(r \cdot w\right)}\right), \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        15. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, r \cdot \left(w \cdot \left(r \cdot w\right)\right), \color{blue}{\frac{2}{r \cdot r} + \frac{-3}{2}}\right) \]
                        16. /-lowering-/.f64N/A

                          \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, r \cdot \left(w \cdot \left(r \cdot w\right)\right), \color{blue}{\frac{2}{r \cdot r}} + \frac{-3}{2}\right) \]
                        17. *-lowering-*.f6493.0

                          \[\leadsto \mathsf{fma}\left(-0.25, r \cdot \left(w \cdot \left(r \cdot w\right)\right), \frac{2}{\color{blue}{r \cdot r}} + -1.5\right) \]
                      7. Applied egg-rr93.0%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.25, r \cdot \left(w \cdot \left(r \cdot w\right)\right), \frac{2}{r \cdot r} + -1.5\right)} \]
                    3. Recombined 2 regimes into one program.
                    4. Final simplification90.4%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;r \leq 2 \cdot 10^{+126}:\\ \;\;\;\;-1.5 + \mathsf{fma}\left(w \cdot \left(-0.25 \cdot \left(r \cdot r\right)\right), w, \frac{2}{r \cdot r}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, r \cdot \left(w \cdot \left(r \cdot w\right)\right), \frac{2}{r \cdot r} + -1.5\right)\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 14: 90.4% accurate, 1.6× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;r \leq 5 \cdot 10^{+117}:\\ \;\;\;\;-1.5 + \mathsf{fma}\left(w \cdot \left(-0.25 \cdot \left(r \cdot r\right)\right), w, \frac{2}{r \cdot r}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(r \cdot w, -0.25 \cdot \left(r \cdot w\right), -1.5\right)\\ \end{array} \end{array} \]
                    (FPCore (v w r)
                     :precision binary64
                     (if (<= r 5e+117)
                       (+ -1.5 (fma (* w (* -0.25 (* r r))) w (/ 2.0 (* r r))))
                       (fma (* r w) (* -0.25 (* r w)) -1.5)))
                    double code(double v, double w, double r) {
                    	double tmp;
                    	if (r <= 5e+117) {
                    		tmp = -1.5 + fma((w * (-0.25 * (r * r))), w, (2.0 / (r * r)));
                    	} else {
                    		tmp = fma((r * w), (-0.25 * (r * w)), -1.5);
                    	}
                    	return tmp;
                    }
                    
                    function code(v, w, r)
                    	tmp = 0.0
                    	if (r <= 5e+117)
                    		tmp = Float64(-1.5 + fma(Float64(w * Float64(-0.25 * Float64(r * r))), w, Float64(2.0 / Float64(r * r))));
                    	else
                    		tmp = fma(Float64(r * w), Float64(-0.25 * Float64(r * w)), -1.5);
                    	end
                    	return tmp
                    end
                    
                    code[v_, w_, r_] := If[LessEqual[r, 5e+117], N[(-1.5 + N[(N[(w * N[(-0.25 * N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * w + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(r * w), $MachinePrecision] * N[(-0.25 * N[(r * w), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;r \leq 5 \cdot 10^{+117}:\\
                    \;\;\;\;-1.5 + \mathsf{fma}\left(w \cdot \left(-0.25 \cdot \left(r \cdot r\right)\right), w, \frac{2}{r \cdot r}\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\mathsf{fma}\left(r \cdot w, -0.25 \cdot \left(r \cdot w\right), -1.5\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if r < 4.99999999999999983e117

                      1. Initial program 83.6%

                        \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
                      2. Add Preprocessing
                      3. Taylor expanded in 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)} \]
                      4. Step-by-step derivation
                        1. sub-negN/A

                          \[\leadsto \color{blue}{2 \cdot \frac{1}{{r}^{2}} + \left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right)} \]
                        2. +-commutativeN/A

                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}}} \]
                        3. distribute-neg-inN/A

                          \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(\frac{3}{2}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right)} + 2 \cdot \frac{1}{{r}^{2}} \]
                        4. metadata-evalN/A

                          \[\leadsto \left(\color{blue}{\frac{-3}{2}} + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        5. distribute-lft-neg-inN/A

                          \[\leadsto \left(\frac{-3}{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) \cdot \left({r}^{2} \cdot {w}^{2}\right)}\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        6. metadata-evalN/A

                          \[\leadsto \left(\frac{-3}{2} + \color{blue}{\frac{-1}{4}} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        7. associate-+l+N/A

                          \[\leadsto \color{blue}{\frac{-3}{2} + \left(\frac{-1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right) + 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        8. +-lowering-+.f64N/A

                          \[\leadsto \color{blue}{\frac{-3}{2} + \left(\frac{-1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right) + 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        9. associate-*r*N/A

                          \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot {w}^{2}} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        10. unpow2N/A

                          \[\leadsto \frac{-3}{2} + \left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot \color{blue}{\left(w \cdot w\right)} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        11. associate-*r*N/A

                          \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        12. accelerator-lowering-fma.f64N/A

                          \[\leadsto \frac{-3}{2} + \color{blue}{\mathsf{fma}\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        13. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w}, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right)} \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        15. unpow2N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \color{blue}{\left(r \cdot r\right)}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        16. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \color{blue}{\left(r \cdot r\right)}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        17. associate-*r/N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w, w, \color{blue}{\frac{2 \cdot 1}{{r}^{2}}}\right) \]
                      5. Simplified90.0%

                        \[\leadsto \color{blue}{-1.5 + \mathsf{fma}\left(\left(-0.25 \cdot \left(r \cdot r\right)\right) \cdot w, w, \frac{2}{r \cdot r}\right)} \]

                      if 4.99999999999999983e117 < r

                      1. Initial program 89.0%

                        \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
                      2. Add Preprocessing
                      3. Taylor expanded in 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)} \]
                      4. Step-by-step derivation
                        1. sub-negN/A

                          \[\leadsto \color{blue}{2 \cdot \frac{1}{{r}^{2}} + \left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right)} \]
                        2. +-commutativeN/A

                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}}} \]
                        3. distribute-neg-inN/A

                          \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(\frac{3}{2}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right)} + 2 \cdot \frac{1}{{r}^{2}} \]
                        4. metadata-evalN/A

                          \[\leadsto \left(\color{blue}{\frac{-3}{2}} + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        5. distribute-lft-neg-inN/A

                          \[\leadsto \left(\frac{-3}{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) \cdot \left({r}^{2} \cdot {w}^{2}\right)}\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        6. metadata-evalN/A

                          \[\leadsto \left(\frac{-3}{2} + \color{blue}{\frac{-1}{4}} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        7. associate-+l+N/A

                          \[\leadsto \color{blue}{\frac{-3}{2} + \left(\frac{-1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right) + 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        8. +-lowering-+.f64N/A

                          \[\leadsto \color{blue}{\frac{-3}{2} + \left(\frac{-1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right) + 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        9. associate-*r*N/A

                          \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot {w}^{2}} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        10. unpow2N/A

                          \[\leadsto \frac{-3}{2} + \left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot \color{blue}{\left(w \cdot w\right)} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        11. associate-*r*N/A

                          \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        12. accelerator-lowering-fma.f64N/A

                          \[\leadsto \frac{-3}{2} + \color{blue}{\mathsf{fma}\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        13. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w}, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right)} \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        15. unpow2N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \color{blue}{\left(r \cdot r\right)}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        16. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \color{blue}{\left(r \cdot r\right)}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        17. associate-*r/N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w, w, \color{blue}{\frac{2 \cdot 1}{{r}^{2}}}\right) \]
                      5. Simplified67.4%

                        \[\leadsto \color{blue}{-1.5 + \mathsf{fma}\left(\left(-0.25 \cdot \left(r \cdot r\right)\right) \cdot w, w, \frac{2}{r \cdot r}\right)} \]
                      6. Taylor expanded in r around inf

                        \[\leadsto \color{blue}{{r}^{2} \cdot \left(\frac{-1}{4} \cdot {w}^{2} - \frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)} \]
                      7. Step-by-step derivation
                        1. sub-negN/A

                          \[\leadsto {r}^{2} \cdot \color{blue}{\left(\frac{-1}{4} \cdot {w}^{2} + \left(\mathsf{neg}\left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)\right)} \]
                        2. distribute-lft-inN/A

                          \[\leadsto \color{blue}{{r}^{2} \cdot \left(\frac{-1}{4} \cdot {w}^{2}\right) + {r}^{2} \cdot \left(\mathsf{neg}\left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)} \]
                        3. distribute-rgt-neg-inN/A

                          \[\leadsto {r}^{2} \cdot \left(\frac{-1}{4} \cdot {w}^{2}\right) + \color{blue}{\left(\mathsf{neg}\left({r}^{2} \cdot \left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)\right)} \]
                        4. *-commutativeN/A

                          \[\leadsto {r}^{2} \cdot \left(\frac{-1}{4} \cdot {w}^{2}\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right) \cdot {r}^{2}}\right)\right) \]
                        5. associate-*l*N/A

                          \[\leadsto {r}^{2} \cdot \left(\frac{-1}{4} \cdot {w}^{2}\right) + \left(\mathsf{neg}\left(\color{blue}{\frac{3}{2} \cdot \left(\frac{1}{{r}^{2}} \cdot {r}^{2}\right)}\right)\right) \]
                        6. lft-mult-inverseN/A

                          \[\leadsto {r}^{2} \cdot \left(\frac{-1}{4} \cdot {w}^{2}\right) + \left(\mathsf{neg}\left(\frac{3}{2} \cdot \color{blue}{1}\right)\right) \]
                        7. metadata-evalN/A

                          \[\leadsto {r}^{2} \cdot \left(\frac{-1}{4} \cdot {w}^{2}\right) + \left(\mathsf{neg}\left(\color{blue}{\frac{3}{2}}\right)\right) \]
                        8. metadata-evalN/A

                          \[\leadsto {r}^{2} \cdot \left(\frac{-1}{4} \cdot {w}^{2}\right) + \color{blue}{\frac{-3}{2}} \]
                        9. accelerator-lowering-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left({r}^{2}, \frac{-1}{4} \cdot {w}^{2}, \frac{-3}{2}\right)} \]
                        10. unpow2N/A

                          \[\leadsto \mathsf{fma}\left(\color{blue}{r \cdot r}, \frac{-1}{4} \cdot {w}^{2}, \frac{-3}{2}\right) \]
                        11. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(\color{blue}{r \cdot r}, \frac{-1}{4} \cdot {w}^{2}, \frac{-3}{2}\right) \]
                        12. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(r \cdot r, \color{blue}{\frac{-1}{4} \cdot {w}^{2}}, \frac{-3}{2}\right) \]
                        13. unpow2N/A

                          \[\leadsto \mathsf{fma}\left(r \cdot r, \frac{-1}{4} \cdot \color{blue}{\left(w \cdot w\right)}, \frac{-3}{2}\right) \]
                        14. *-lowering-*.f6466.7

                          \[\leadsto \mathsf{fma}\left(r \cdot r, -0.25 \cdot \color{blue}{\left(w \cdot w\right)}, -1.5\right) \]
                      8. Simplified66.7%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(r \cdot r, -0.25 \cdot \left(w \cdot w\right), -1.5\right)} \]
                      9. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \left(r \cdot r\right) \cdot \color{blue}{\left(\left(w \cdot w\right) \cdot \frac{-1}{4}\right)} + \frac{-3}{2} \]
                        2. associate-*r*N/A

                          \[\leadsto \color{blue}{\left(\left(r \cdot r\right) \cdot \left(w \cdot w\right)\right) \cdot \frac{-1}{4}} + \frac{-3}{2} \]
                        3. associate-*r*N/A

                          \[\leadsto \color{blue}{\left(\left(\left(r \cdot r\right) \cdot w\right) \cdot w\right)} \cdot \frac{-1}{4} + \frac{-3}{2} \]
                        4. associate-*r*N/A

                          \[\leadsto \left(\color{blue}{\left(r \cdot \left(r \cdot w\right)\right)} \cdot w\right) \cdot \frac{-1}{4} + \frac{-3}{2} \]
                        5. associate-*r*N/A

                          \[\leadsto \color{blue}{\left(r \cdot \left(r \cdot w\right)\right) \cdot \left(w \cdot \frac{-1}{4}\right)} + \frac{-3}{2} \]
                        6. *-commutativeN/A

                          \[\leadsto \color{blue}{\left(w \cdot \frac{-1}{4}\right) \cdot \left(r \cdot \left(r \cdot w\right)\right)} + \frac{-3}{2} \]
                        7. associate-*r*N/A

                          \[\leadsto \color{blue}{\left(\left(w \cdot \frac{-1}{4}\right) \cdot r\right) \cdot \left(r \cdot w\right)} + \frac{-3}{2} \]
                        8. *-commutativeN/A

                          \[\leadsto \color{blue}{\left(r \cdot w\right) \cdot \left(\left(w \cdot \frac{-1}{4}\right) \cdot r\right)} + \frac{-3}{2} \]
                        9. accelerator-lowering-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left(r \cdot w, \left(w \cdot \frac{-1}{4}\right) \cdot r, \frac{-3}{2}\right)} \]
                        10. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(\color{blue}{w \cdot r}, \left(w \cdot \frac{-1}{4}\right) \cdot r, \frac{-3}{2}\right) \]
                        11. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(\color{blue}{w \cdot r}, \left(w \cdot \frac{-1}{4}\right) \cdot r, \frac{-3}{2}\right) \]
                        12. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(w \cdot r, \color{blue}{\left(\frac{-1}{4} \cdot w\right)} \cdot r, \frac{-3}{2}\right) \]
                        13. associate-*l*N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot r, \color{blue}{\frac{-1}{4} \cdot \left(w \cdot r\right)}, \frac{-3}{2}\right) \]
                        14. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(w \cdot r, \frac{-1}{4} \cdot \color{blue}{\left(r \cdot w\right)}, \frac{-3}{2}\right) \]
                        15. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot r, \color{blue}{\frac{-1}{4} \cdot \left(r \cdot w\right)}, \frac{-3}{2}\right) \]
                        16. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(w \cdot r, \frac{-1}{4} \cdot \color{blue}{\left(w \cdot r\right)}, \frac{-3}{2}\right) \]
                        17. *-lowering-*.f6493.7

                          \[\leadsto \mathsf{fma}\left(w \cdot r, -0.25 \cdot \color{blue}{\left(w \cdot r\right)}, -1.5\right) \]
                      10. Applied egg-rr93.7%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(w \cdot r, -0.25 \cdot \left(w \cdot r\right), -1.5\right)} \]
                    3. Recombined 2 regimes into one program.
                    4. Final simplification90.4%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;r \leq 5 \cdot 10^{+117}:\\ \;\;\;\;-1.5 + \mathsf{fma}\left(w \cdot \left(-0.25 \cdot \left(r \cdot r\right)\right), w, \frac{2}{r \cdot r}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(r \cdot w, -0.25 \cdot \left(r \cdot w\right), -1.5\right)\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 15: 86.3% accurate, 1.7× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;r \leq 0.75:\\ \;\;\;\;\mathsf{fma}\left(-0.25 \cdot w, r \cdot \left(r \cdot w\right), \frac{2}{r \cdot r}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(r \cdot w, -0.25 \cdot \left(r \cdot w\right), -1.5\right)\\ \end{array} \end{array} \]
                    (FPCore (v w r)
                     :precision binary64
                     (if (<= r 0.75)
                       (fma (* -0.25 w) (* r (* r w)) (/ 2.0 (* r r)))
                       (fma (* r w) (* -0.25 (* r w)) -1.5)))
                    double code(double v, double w, double r) {
                    	double tmp;
                    	if (r <= 0.75) {
                    		tmp = fma((-0.25 * w), (r * (r * w)), (2.0 / (r * r)));
                    	} else {
                    		tmp = fma((r * w), (-0.25 * (r * w)), -1.5);
                    	}
                    	return tmp;
                    }
                    
                    function code(v, w, r)
                    	tmp = 0.0
                    	if (r <= 0.75)
                    		tmp = fma(Float64(-0.25 * w), Float64(r * Float64(r * w)), Float64(2.0 / Float64(r * r)));
                    	else
                    		tmp = fma(Float64(r * w), Float64(-0.25 * Float64(r * w)), -1.5);
                    	end
                    	return tmp
                    end
                    
                    code[v_, w_, r_] := If[LessEqual[r, 0.75], N[(N[(-0.25 * w), $MachinePrecision] * N[(r * N[(r * w), $MachinePrecision]), $MachinePrecision] + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(r * w), $MachinePrecision] * N[(-0.25 * N[(r * w), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;r \leq 0.75:\\
                    \;\;\;\;\mathsf{fma}\left(-0.25 \cdot w, r \cdot \left(r \cdot w\right), \frac{2}{r \cdot r}\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\mathsf{fma}\left(r \cdot w, -0.25 \cdot \left(r \cdot w\right), -1.5\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if r < 0.75

                      1. Initial program 82.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. Add Preprocessing
                      3. 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)} \]
                      4. Step-by-step derivation
                        1. sub-negN/A

                          \[\leadsto \color{blue}{2 \cdot \frac{1}{{r}^{2}} + \left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right)} \]
                        2. +-commutativeN/A

                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}}} \]
                        3. distribute-neg-inN/A

                          \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(\frac{3}{2}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right)} + 2 \cdot \frac{1}{{r}^{2}} \]
                        4. metadata-evalN/A

                          \[\leadsto \left(\color{blue}{\frac{-3}{2}} + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        5. distribute-lft-neg-inN/A

                          \[\leadsto \left(\frac{-3}{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) \cdot \left({r}^{2} \cdot {w}^{2}\right)}\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        6. metadata-evalN/A

                          \[\leadsto \left(\frac{-3}{2} + \color{blue}{\frac{-1}{4}} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        7. associate-+l+N/A

                          \[\leadsto \color{blue}{\frac{-3}{2} + \left(\frac{-1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right) + 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        8. +-lowering-+.f64N/A

                          \[\leadsto \color{blue}{\frac{-3}{2} + \left(\frac{-1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right) + 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        9. associate-*r*N/A

                          \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot {w}^{2}} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        10. unpow2N/A

                          \[\leadsto \frac{-3}{2} + \left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot \color{blue}{\left(w \cdot w\right)} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        11. associate-*r*N/A

                          \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        12. accelerator-lowering-fma.f64N/A

                          \[\leadsto \frac{-3}{2} + \color{blue}{\mathsf{fma}\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        13. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w}, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right)} \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        15. unpow2N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \color{blue}{\left(r \cdot r\right)}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        16. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \color{blue}{\left(r \cdot r\right)}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        17. associate-*r/N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w, w, \color{blue}{\frac{2 \cdot 1}{{r}^{2}}}\right) \]
                      5. Simplified89.1%

                        \[\leadsto \color{blue}{-1.5 + \mathsf{fma}\left(\left(-0.25 \cdot \left(r \cdot r\right)\right) \cdot w, w, \frac{2}{r \cdot r}\right)} \]
                      6. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \color{blue}{\left(\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w\right) \cdot w + \frac{2}{r \cdot r}\right) + \frac{-3}{2}} \]
                        2. associate-+l+N/A

                          \[\leadsto \color{blue}{\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w\right) \cdot w + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right)} \]
                        3. *-commutativeN/A

                          \[\leadsto \color{blue}{w \cdot \left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w\right)} + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        4. associate-*l*N/A

                          \[\leadsto w \cdot \color{blue}{\left(\frac{-1}{4} \cdot \left(\left(r \cdot r\right) \cdot w\right)\right)} + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        5. *-commutativeN/A

                          \[\leadsto w \cdot \left(\frac{-1}{4} \cdot \color{blue}{\left(w \cdot \left(r \cdot r\right)\right)}\right) + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        6. associate-*r*N/A

                          \[\leadsto \color{blue}{\left(w \cdot \frac{-1}{4}\right) \cdot \left(w \cdot \left(r \cdot r\right)\right)} + \left(\frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        7. accelerator-lowering-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left(w \cdot \frac{-1}{4}, w \cdot \left(r \cdot r\right), \frac{2}{r \cdot r} + \frac{-3}{2}\right)} \]
                        8. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(\color{blue}{w \cdot \frac{-1}{4}}, w \cdot \left(r \cdot r\right), \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        9. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, \color{blue}{\left(r \cdot r\right) \cdot w}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        10. associate-*l*N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, \color{blue}{r \cdot \left(r \cdot w\right)}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        11. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, \color{blue}{r \cdot \left(r \cdot w\right)}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        12. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, r \cdot \color{blue}{\left(r \cdot w\right)}, \frac{2}{r \cdot r} + \frac{-3}{2}\right) \]
                        13. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, r \cdot \left(r \cdot w\right), \color{blue}{\frac{2}{r \cdot r} + \frac{-3}{2}}\right) \]
                        14. /-lowering-/.f64N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, r \cdot \left(r \cdot w\right), \color{blue}{\frac{2}{r \cdot r}} + \frac{-3}{2}\right) \]
                        15. *-lowering-*.f6493.0

                          \[\leadsto \mathsf{fma}\left(w \cdot -0.25, r \cdot \left(r \cdot w\right), \frac{2}{\color{blue}{r \cdot r}} + -1.5\right) \]
                      7. Applied egg-rr93.0%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(w \cdot -0.25, r \cdot \left(r \cdot w\right), \frac{2}{r \cdot r} + -1.5\right)} \]
                      8. Taylor expanded in r around 0

                        \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, r \cdot \left(r \cdot w\right), \color{blue}{\frac{2}{{r}^{2}}}\right) \]
                      9. Step-by-step derivation
                        1. /-lowering-/.f64N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, r \cdot \left(r \cdot w\right), \color{blue}{\frac{2}{{r}^{2}}}\right) \]
                        2. unpow2N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot \frac{-1}{4}, r \cdot \left(r \cdot w\right), \frac{2}{\color{blue}{r \cdot r}}\right) \]
                        3. *-lowering-*.f6484.6

                          \[\leadsto \mathsf{fma}\left(w \cdot -0.25, r \cdot \left(r \cdot w\right), \frac{2}{\color{blue}{r \cdot r}}\right) \]
                      10. Simplified84.6%

                        \[\leadsto \mathsf{fma}\left(w \cdot -0.25, r \cdot \left(r \cdot w\right), \color{blue}{\frac{2}{r \cdot r}}\right) \]

                      if 0.75 < r

                      1. Initial program 89.2%

                        \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
                      2. Add Preprocessing
                      3. 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)} \]
                      4. Step-by-step derivation
                        1. sub-negN/A

                          \[\leadsto \color{blue}{2 \cdot \frac{1}{{r}^{2}} + \left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right)} \]
                        2. +-commutativeN/A

                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}}} \]
                        3. distribute-neg-inN/A

                          \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(\frac{3}{2}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right)} + 2 \cdot \frac{1}{{r}^{2}} \]
                        4. metadata-evalN/A

                          \[\leadsto \left(\color{blue}{\frac{-3}{2}} + \left(\mathsf{neg}\left(\frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        5. distribute-lft-neg-inN/A

                          \[\leadsto \left(\frac{-3}{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) \cdot \left({r}^{2} \cdot {w}^{2}\right)}\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        6. metadata-evalN/A

                          \[\leadsto \left(\frac{-3}{2} + \color{blue}{\frac{-1}{4}} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right) + 2 \cdot \frac{1}{{r}^{2}} \]
                        7. associate-+l+N/A

                          \[\leadsto \color{blue}{\frac{-3}{2} + \left(\frac{-1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right) + 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        8. +-lowering-+.f64N/A

                          \[\leadsto \color{blue}{\frac{-3}{2} + \left(\frac{-1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right) + 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        9. associate-*r*N/A

                          \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot {w}^{2}} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        10. unpow2N/A

                          \[\leadsto \frac{-3}{2} + \left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot \color{blue}{\left(w \cdot w\right)} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        11. associate-*r*N/A

                          \[\leadsto \frac{-3}{2} + \left(\color{blue}{\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w} + 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        12. accelerator-lowering-fma.f64N/A

                          \[\leadsto \frac{-3}{2} + \color{blue}{\mathsf{fma}\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right)} \]
                        13. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w}, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right)} \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        15. unpow2N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \color{blue}{\left(r \cdot r\right)}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        16. *-lowering-*.f64N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \color{blue}{\left(r \cdot r\right)}\right) \cdot w, w, 2 \cdot \frac{1}{{r}^{2}}\right) \]
                        17. associate-*r/N/A

                          \[\leadsto \frac{-3}{2} + \mathsf{fma}\left(\left(\frac{-1}{4} \cdot \left(r \cdot r\right)\right) \cdot w, w, \color{blue}{\frac{2 \cdot 1}{{r}^{2}}}\right) \]
                      5. Simplified83.4%

                        \[\leadsto \color{blue}{-1.5 + \mathsf{fma}\left(\left(-0.25 \cdot \left(r \cdot r\right)\right) \cdot w, w, \frac{2}{r \cdot r}\right)} \]
                      6. Taylor expanded in r around inf

                        \[\leadsto \color{blue}{{r}^{2} \cdot \left(\frac{-1}{4} \cdot {w}^{2} - \frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)} \]
                      7. Step-by-step derivation
                        1. sub-negN/A

                          \[\leadsto {r}^{2} \cdot \color{blue}{\left(\frac{-1}{4} \cdot {w}^{2} + \left(\mathsf{neg}\left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)\right)} \]
                        2. distribute-lft-inN/A

                          \[\leadsto \color{blue}{{r}^{2} \cdot \left(\frac{-1}{4} \cdot {w}^{2}\right) + {r}^{2} \cdot \left(\mathsf{neg}\left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)} \]
                        3. distribute-rgt-neg-inN/A

                          \[\leadsto {r}^{2} \cdot \left(\frac{-1}{4} \cdot {w}^{2}\right) + \color{blue}{\left(\mathsf{neg}\left({r}^{2} \cdot \left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)\right)} \]
                        4. *-commutativeN/A

                          \[\leadsto {r}^{2} \cdot \left(\frac{-1}{4} \cdot {w}^{2}\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right) \cdot {r}^{2}}\right)\right) \]
                        5. associate-*l*N/A

                          \[\leadsto {r}^{2} \cdot \left(\frac{-1}{4} \cdot {w}^{2}\right) + \left(\mathsf{neg}\left(\color{blue}{\frac{3}{2} \cdot \left(\frac{1}{{r}^{2}} \cdot {r}^{2}\right)}\right)\right) \]
                        6. lft-mult-inverseN/A

                          \[\leadsto {r}^{2} \cdot \left(\frac{-1}{4} \cdot {w}^{2}\right) + \left(\mathsf{neg}\left(\frac{3}{2} \cdot \color{blue}{1}\right)\right) \]
                        7. metadata-evalN/A

                          \[\leadsto {r}^{2} \cdot \left(\frac{-1}{4} \cdot {w}^{2}\right) + \left(\mathsf{neg}\left(\color{blue}{\frac{3}{2}}\right)\right) \]
                        8. metadata-evalN/A

                          \[\leadsto {r}^{2} \cdot \left(\frac{-1}{4} \cdot {w}^{2}\right) + \color{blue}{\frac{-3}{2}} \]
                        9. accelerator-lowering-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left({r}^{2}, \frac{-1}{4} \cdot {w}^{2}, \frac{-3}{2}\right)} \]
                        10. unpow2N/A

                          \[\leadsto \mathsf{fma}\left(\color{blue}{r \cdot r}, \frac{-1}{4} \cdot {w}^{2}, \frac{-3}{2}\right) \]
                        11. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(\color{blue}{r \cdot r}, \frac{-1}{4} \cdot {w}^{2}, \frac{-3}{2}\right) \]
                        12. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(r \cdot r, \color{blue}{\frac{-1}{4} \cdot {w}^{2}}, \frac{-3}{2}\right) \]
                        13. unpow2N/A

                          \[\leadsto \mathsf{fma}\left(r \cdot r, \frac{-1}{4} \cdot \color{blue}{\left(w \cdot w\right)}, \frac{-3}{2}\right) \]
                        14. *-lowering-*.f6482.4

                          \[\leadsto \mathsf{fma}\left(r \cdot r, -0.25 \cdot \color{blue}{\left(w \cdot w\right)}, -1.5\right) \]
                      8. Simplified82.4%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(r \cdot r, -0.25 \cdot \left(w \cdot w\right), -1.5\right)} \]
                      9. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \left(r \cdot r\right) \cdot \color{blue}{\left(\left(w \cdot w\right) \cdot \frac{-1}{4}\right)} + \frac{-3}{2} \]
                        2. associate-*r*N/A

                          \[\leadsto \color{blue}{\left(\left(r \cdot r\right) \cdot \left(w \cdot w\right)\right) \cdot \frac{-1}{4}} + \frac{-3}{2} \]
                        3. associate-*r*N/A

                          \[\leadsto \color{blue}{\left(\left(\left(r \cdot r\right) \cdot w\right) \cdot w\right)} \cdot \frac{-1}{4} + \frac{-3}{2} \]
                        4. associate-*r*N/A

                          \[\leadsto \left(\color{blue}{\left(r \cdot \left(r \cdot w\right)\right)} \cdot w\right) \cdot \frac{-1}{4} + \frac{-3}{2} \]
                        5. associate-*r*N/A

                          \[\leadsto \color{blue}{\left(r \cdot \left(r \cdot w\right)\right) \cdot \left(w \cdot \frac{-1}{4}\right)} + \frac{-3}{2} \]
                        6. *-commutativeN/A

                          \[\leadsto \color{blue}{\left(w \cdot \frac{-1}{4}\right) \cdot \left(r \cdot \left(r \cdot w\right)\right)} + \frac{-3}{2} \]
                        7. associate-*r*N/A

                          \[\leadsto \color{blue}{\left(\left(w \cdot \frac{-1}{4}\right) \cdot r\right) \cdot \left(r \cdot w\right)} + \frac{-3}{2} \]
                        8. *-commutativeN/A

                          \[\leadsto \color{blue}{\left(r \cdot w\right) \cdot \left(\left(w \cdot \frac{-1}{4}\right) \cdot r\right)} + \frac{-3}{2} \]
                        9. accelerator-lowering-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left(r \cdot w, \left(w \cdot \frac{-1}{4}\right) \cdot r, \frac{-3}{2}\right)} \]
                        10. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(\color{blue}{w \cdot r}, \left(w \cdot \frac{-1}{4}\right) \cdot r, \frac{-3}{2}\right) \]
                        11. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(\color{blue}{w \cdot r}, \left(w \cdot \frac{-1}{4}\right) \cdot r, \frac{-3}{2}\right) \]
                        12. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(w \cdot r, \color{blue}{\left(\frac{-1}{4} \cdot w\right)} \cdot r, \frac{-3}{2}\right) \]
                        13. associate-*l*N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot r, \color{blue}{\frac{-1}{4} \cdot \left(w \cdot r\right)}, \frac{-3}{2}\right) \]
                        14. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(w \cdot r, \frac{-1}{4} \cdot \color{blue}{\left(r \cdot w\right)}, \frac{-3}{2}\right) \]
                        15. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(w \cdot r, \color{blue}{\frac{-1}{4} \cdot \left(r \cdot w\right)}, \frac{-3}{2}\right) \]
                        16. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(w \cdot r, \frac{-1}{4} \cdot \color{blue}{\left(w \cdot r\right)}, \frac{-3}{2}\right) \]
                        17. *-lowering-*.f6493.8

                          \[\leadsto \mathsf{fma}\left(w \cdot r, -0.25 \cdot \color{blue}{\left(w \cdot r\right)}, -1.5\right) \]
                      10. Applied egg-rr93.8%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(w \cdot r, -0.25 \cdot \left(w \cdot r\right), -1.5\right)} \]
                    3. Recombined 2 regimes into one program.
                    4. Final simplification86.8%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;r \leq 0.75:\\ \;\;\;\;\mathsf{fma}\left(-0.25 \cdot w, r \cdot \left(r \cdot w\right), \frac{2}{r \cdot r}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(r \cdot w, -0.25 \cdot \left(r \cdot w\right), -1.5\right)\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 16: 50.7% accurate, 3.2× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;r \leq 7 \cdot 10^{-7}:\\ \;\;\;\;\frac{2}{r \cdot r}\\ \mathbf{else}:\\ \;\;\;\;-1.5\\ \end{array} \end{array} \]
                    (FPCore (v w r) :precision binary64 (if (<= r 7e-7) (/ 2.0 (* r r)) -1.5))
                    double code(double v, double w, double r) {
                    	double tmp;
                    	if (r <= 7e-7) {
                    		tmp = 2.0 / (r * r);
                    	} else {
                    		tmp = -1.5;
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(v, w, r)
                        real(8), intent (in) :: v
                        real(8), intent (in) :: w
                        real(8), intent (in) :: r
                        real(8) :: tmp
                        if (r <= 7d-7) then
                            tmp = 2.0d0 / (r * r)
                        else
                            tmp = -1.5d0
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double v, double w, double r) {
                    	double tmp;
                    	if (r <= 7e-7) {
                    		tmp = 2.0 / (r * r);
                    	} else {
                    		tmp = -1.5;
                    	}
                    	return tmp;
                    }
                    
                    def code(v, w, r):
                    	tmp = 0
                    	if r <= 7e-7:
                    		tmp = 2.0 / (r * r)
                    	else:
                    		tmp = -1.5
                    	return tmp
                    
                    function code(v, w, r)
                    	tmp = 0.0
                    	if (r <= 7e-7)
                    		tmp = Float64(2.0 / Float64(r * r));
                    	else
                    		tmp = -1.5;
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(v, w, r)
                    	tmp = 0.0;
                    	if (r <= 7e-7)
                    		tmp = 2.0 / (r * r);
                    	else
                    		tmp = -1.5;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[v_, w_, r_] := If[LessEqual[r, 7e-7], N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision], -1.5]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;r \leq 7 \cdot 10^{-7}:\\
                    \;\;\;\;\frac{2}{r \cdot r}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;-1.5\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if r < 6.99999999999999968e-7

                      1. Initial program 82.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. Add Preprocessing
                      3. Taylor expanded in r around 0

                        \[\leadsto \color{blue}{\frac{2}{{r}^{2}}} \]
                      4. Step-by-step derivation
                        1. /-lowering-/.f64N/A

                          \[\leadsto \color{blue}{\frac{2}{{r}^{2}}} \]
                        2. unpow2N/A

                          \[\leadsto \frac{2}{\color{blue}{r \cdot r}} \]
                        3. *-lowering-*.f6458.5

                          \[\leadsto \frac{2}{\color{blue}{r \cdot r}} \]
                      5. Simplified58.5%

                        \[\leadsto \color{blue}{\frac{2}{r \cdot r}} \]

                      if 6.99999999999999968e-7 < r

                      1. Initial program 89.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. Add Preprocessing
                      3. Taylor expanded in r around inf

                        \[\leadsto \color{blue}{-1 \cdot \left({r}^{2} \cdot \left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)} \]
                      4. Step-by-step derivation
                        1. mul-1-negN/A

                          \[\leadsto \color{blue}{\mathsf{neg}\left({r}^{2} \cdot \left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)} \]
                        2. distribute-rgt-neg-inN/A

                          \[\leadsto \color{blue}{{r}^{2} \cdot \left(\mathsf{neg}\left(\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)\right)} \]
                        3. distribute-neg-inN/A

                          \[\leadsto {r}^{2} \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v}\right)\right) + \left(\mathsf{neg}\left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)\right)} \]
                        4. distribute-lft-inN/A

                          \[\leadsto \color{blue}{{r}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v}\right)\right) + {r}^{2} \cdot \left(\mathsf{neg}\left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)} \]
                        5. distribute-rgt-neg-inN/A

                          \[\leadsto {r}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v}\right)\right) + \color{blue}{\left(\mathsf{neg}\left({r}^{2} \cdot \left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)\right)} \]
                        6. *-commutativeN/A

                          \[\leadsto {r}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v}\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right) \cdot {r}^{2}}\right)\right) \]
                        7. associate-*l*N/A

                          \[\leadsto {r}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v}\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\frac{3}{2} \cdot \left(\frac{1}{{r}^{2}} \cdot {r}^{2}\right)}\right)\right) \]
                        8. lft-mult-inverseN/A

                          \[\leadsto {r}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v}\right)\right) + \left(\mathsf{neg}\left(\frac{3}{2} \cdot \color{blue}{1}\right)\right) \]
                        9. metadata-evalN/A

                          \[\leadsto {r}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v}\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\frac{3}{2}}\right)\right) \]
                        10. metadata-evalN/A

                          \[\leadsto {r}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v}\right)\right) + \color{blue}{\frac{-3}{2}} \]
                        11. accelerator-lowering-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left({r}^{2}, \mathsf{neg}\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v}\right), \frac{-3}{2}\right)} \]
                      5. Simplified82.2%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(r \cdot r, \frac{\left(-0.125 \cdot \left(w \cdot w\right)\right) \cdot \mathsf{fma}\left(v, -2, 3\right)}{1 - v}, -1.5\right)} \]
                      6. Taylor expanded in r around 0

                        \[\leadsto \color{blue}{\frac{-3}{2}} \]
                      7. Step-by-step derivation
                        1. Simplified30.9%

                          \[\leadsto \color{blue}{-1.5} \]
                      8. Recombined 2 regimes into one program.
                      9. Add Preprocessing

                      Alternative 17: 57.7% accurate, 3.7× 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;
                      }
                      
                      real(8) function code(v, w, r)
                          real(8), intent (in) :: v
                          real(8), intent (in) :: w
                          real(8), intent (in) :: r
                          code = (2.0d0 / (r * r)) + (-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.1%

                        \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
                      2. Add Preprocessing
                      3. Taylor expanded in w around 0

                        \[\leadsto \color{blue}{2 \cdot \frac{1}{{r}^{2}} - \frac{3}{2}} \]
                      4. Step-by-step derivation
                        1. sub-negN/A

                          \[\leadsto \color{blue}{2 \cdot \frac{1}{{r}^{2}} + \left(\mathsf{neg}\left(\frac{3}{2}\right)\right)} \]
                        2. metadata-evalN/A

                          \[\leadsto 2 \cdot \frac{1}{{r}^{2}} + \color{blue}{\frac{-3}{2}} \]
                        3. +-commutativeN/A

                          \[\leadsto \color{blue}{\frac{-3}{2} + 2 \cdot \frac{1}{{r}^{2}}} \]
                        4. +-lowering-+.f64N/A

                          \[\leadsto \color{blue}{\frac{-3}{2} + 2 \cdot \frac{1}{{r}^{2}}} \]
                        5. associate-*r/N/A

                          \[\leadsto \frac{-3}{2} + \color{blue}{\frac{2 \cdot 1}{{r}^{2}}} \]
                        6. metadata-evalN/A

                          \[\leadsto \frac{-3}{2} + \frac{\color{blue}{2}}{{r}^{2}} \]
                        7. /-lowering-/.f64N/A

                          \[\leadsto \frac{-3}{2} + \color{blue}{\frac{2}{{r}^{2}}} \]
                        8. unpow2N/A

                          \[\leadsto \frac{-3}{2} + \frac{2}{\color{blue}{r \cdot r}} \]
                        9. *-lowering-*.f6458.7

                          \[\leadsto -1.5 + \frac{2}{\color{blue}{r \cdot r}} \]
                      5. Simplified58.7%

                        \[\leadsto \color{blue}{-1.5 + \frac{2}{r \cdot r}} \]
                      6. Final simplification58.7%

                        \[\leadsto \frac{2}{r \cdot r} + -1.5 \]
                      7. Add Preprocessing

                      Alternative 18: 14.6% accurate, 73.0× speedup?

                      \[\begin{array}{l} \\ -1.5 \end{array} \]
                      (FPCore (v w r) :precision binary64 -1.5)
                      double code(double v, double w, double r) {
                      	return -1.5;
                      }
                      
                      real(8) function code(v, w, r)
                          real(8), intent (in) :: v
                          real(8), intent (in) :: w
                          real(8), intent (in) :: r
                          code = -1.5d0
                      end function
                      
                      public static double code(double v, double w, double r) {
                      	return -1.5;
                      }
                      
                      def code(v, w, r):
                      	return -1.5
                      
                      function code(v, w, r)
                      	return -1.5
                      end
                      
                      function tmp = code(v, w, r)
                      	tmp = -1.5;
                      end
                      
                      code[v_, w_, r_] := -1.5
                      
                      \begin{array}{l}
                      
                      \\
                      -1.5
                      \end{array}
                      
                      Derivation
                      1. Initial program 84.1%

                        \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
                      2. Add Preprocessing
                      3. Taylor expanded in r around inf

                        \[\leadsto \color{blue}{-1 \cdot \left({r}^{2} \cdot \left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)} \]
                      4. Step-by-step derivation
                        1. mul-1-negN/A

                          \[\leadsto \color{blue}{\mathsf{neg}\left({r}^{2} \cdot \left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)} \]
                        2. distribute-rgt-neg-inN/A

                          \[\leadsto \color{blue}{{r}^{2} \cdot \left(\mathsf{neg}\left(\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v} + \frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)\right)} \]
                        3. distribute-neg-inN/A

                          \[\leadsto {r}^{2} \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v}\right)\right) + \left(\mathsf{neg}\left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)\right)} \]
                        4. distribute-lft-inN/A

                          \[\leadsto \color{blue}{{r}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v}\right)\right) + {r}^{2} \cdot \left(\mathsf{neg}\left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)} \]
                        5. distribute-rgt-neg-inN/A

                          \[\leadsto {r}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v}\right)\right) + \color{blue}{\left(\mathsf{neg}\left({r}^{2} \cdot \left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right)\right)\right)} \]
                        6. *-commutativeN/A

                          \[\leadsto {r}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v}\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\left(\frac{3}{2} \cdot \frac{1}{{r}^{2}}\right) \cdot {r}^{2}}\right)\right) \]
                        7. associate-*l*N/A

                          \[\leadsto {r}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v}\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\frac{3}{2} \cdot \left(\frac{1}{{r}^{2}} \cdot {r}^{2}\right)}\right)\right) \]
                        8. lft-mult-inverseN/A

                          \[\leadsto {r}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v}\right)\right) + \left(\mathsf{neg}\left(\frac{3}{2} \cdot \color{blue}{1}\right)\right) \]
                        9. metadata-evalN/A

                          \[\leadsto {r}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v}\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\frac{3}{2}}\right)\right) \]
                        10. metadata-evalN/A

                          \[\leadsto {r}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v}\right)\right) + \color{blue}{\frac{-3}{2}} \]
                        11. accelerator-lowering-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left({r}^{2}, \mathsf{neg}\left(\frac{1}{8} \cdot \frac{{w}^{2} \cdot \left(3 - 2 \cdot v\right)}{1 - v}\right), \frac{-3}{2}\right)} \]
                      5. Simplified44.1%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(r \cdot r, \frac{\left(-0.125 \cdot \left(w \cdot w\right)\right) \cdot \mathsf{fma}\left(v, -2, 3\right)}{1 - v}, -1.5\right)} \]
                      6. Taylor expanded in r around 0

                        \[\leadsto \color{blue}{\frac{-3}{2}} \]
                      7. Step-by-step derivation
                        1. Simplified15.3%

                          \[\leadsto \color{blue}{-1.5} \]
                        2. Add Preprocessing

                        Reproduce

                        ?
                        herbie shell --seed 2024194 
                        (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))