Rosa's TurbineBenchmark

Percentage Accurate: 85.0% → 99.1%
Time: 14.3s
Alternatives: 15
Speedup: 1.6×

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

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

Initial Program: 85.0% 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: 99.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;r\_m \leq 3.9 \cdot 10^{-46}:\\
\;\;\;\;\mathsf{fma}\left(r\_m \cdot w, \left(r\_m \cdot w\right) \cdot -0.375, -1.5 + \frac{2}{r\_m \cdot r\_m}\right)\\

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


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

    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 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. lower-+.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. lower-/.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. lower-*.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. lower-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. Applied rewrites80.0%

      \[\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. Applied rewrites94.2%

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

      if 3.9000000000000003e-46 < r

      1. Initial program 85.5%

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

          \[\leadsto \color{blue}{\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(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - \frac{9}{2}} \]
        2. lift--.f64N/A

          \[\leadsto \color{blue}{\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(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right)} - \frac{9}{2} \]
        3. associate--l-N/A

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 2: 89.7% accurate, 0.4× speedup?

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

      1. Initial program 85.1%

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

          \[\leadsto \color{blue}{\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(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - \frac{9}{2}} \]
        2. lift--.f64N/A

          \[\leadsto \color{blue}{\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(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right)} - \frac{9}{2} \]
        3. associate--l-N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto 3 - \mathsf{fma}\left(w, 0.25 \cdot \left(\color{blue}{\left(r \cdot r\right)} \cdot w\right), 4.5\right) \]
        4. Applied rewrites82.9%

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

        if -2e13 < (-.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.10000000000000009

        1. Initial program 86.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. 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. lower-+.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. lower-/.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. lower-*.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. lower-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. Applied rewrites54.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. Taylor expanded in w around 0

          \[\leadsto \frac{2}{r \cdot r} + \frac{-3}{2} \]
        7. Step-by-step derivation
          1. Applied rewrites83.5%

            \[\leadsto \frac{2}{r \cdot r} + -1.5 \]
          2. Taylor expanded in r around inf

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

              \[\leadsto \mathsf{fma}\left(w \cdot w, \color{blue}{\left(r \cdot r\right) \cdot -0.375}, -1.5\right) \]
            2. Step-by-step derivation
              1. Applied rewrites93.5%

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

              if 3.10000000000000009 < (-.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 88.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 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. lower-+.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. lower-/.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. lower-*.f6499.8

                  \[\leadsto -1.5 + \frac{2}{\color{blue}{r \cdot r}} \]
              5. Applied rewrites99.8%

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

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

            Alternative 3: 92.8% accurate, 0.4× speedup?

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

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

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

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

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

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

                    \[\leadsto -0.25 \cdot \left(w \cdot \color{blue}{\left(\left(r \cdot r\right) \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))) < 3.10000000000000009

                  1. Initial program 90.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 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. lower-+.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. lower-/.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. lower-*.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. lower-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. Applied rewrites47.9%

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

                    \[\leadsto \frac{2}{r \cdot r} + \frac{-3}{2} \]
                  7. Step-by-step derivation
                    1. Applied rewrites61.1%

                      \[\leadsto \frac{2}{r \cdot r} + -1.5 \]
                    2. Taylor expanded in r around inf

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

                        \[\leadsto \mathsf{fma}\left(w \cdot w, \color{blue}{\left(r \cdot r\right) \cdot -0.375}, -1.5\right) \]
                      2. Step-by-step derivation
                        1. Applied rewrites82.3%

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

                        if 3.10000000000000009 < (-.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 88.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 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. lower-+.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. lower-/.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. lower-*.f6499.8

                            \[\leadsto -1.5 + \frac{2}{\color{blue}{r \cdot r}} \]
                        5. Applied rewrites99.8%

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

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

                      Alternative 4: 88.0% accurate, 0.8× speedup?

                      \[\begin{array}{l} r_m = \left|r\right| \\ \begin{array}{l} t_0 := \frac{2}{r\_m \cdot r\_m}\\ \mathbf{if}\;\left(3 + t\_0\right) + \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(r\_m \cdot \left(r\_m \cdot \left(w \cdot w\right)\right)\right)}{v + -1} \leq -2000000000000:\\ \;\;\;\;-0.25 \cdot \left(w \cdot \left(w \cdot \left(r\_m \cdot r\_m\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-1.5 + t\_0\\ \end{array} \end{array} \]
                      r_m = (fabs.f64 r)
                      (FPCore (v w r_m)
                       :precision binary64
                       (let* ((t_0 (/ 2.0 (* r_m r_m))))
                         (if (<=
                              (+
                               (+ 3.0 t_0)
                               (/
                                (* (* 0.125 (- 3.0 (* 2.0 v))) (* r_m (* r_m (* w w))))
                                (+ v -1.0)))
                              -2000000000000.0)
                           (* -0.25 (* w (* w (* r_m r_m))))
                           (+ -1.5 t_0))))
                      r_m = fabs(r);
                      double code(double v, double w, double r_m) {
                      	double t_0 = 2.0 / (r_m * r_m);
                      	double tmp;
                      	if (((3.0 + t_0) + (((0.125 * (3.0 - (2.0 * v))) * (r_m * (r_m * (w * w)))) / (v + -1.0))) <= -2000000000000.0) {
                      		tmp = -0.25 * (w * (w * (r_m * r_m)));
                      	} else {
                      		tmp = -1.5 + t_0;
                      	}
                      	return tmp;
                      }
                      
                      r_m = abs(r)
                      real(8) function code(v, w, r_m)
                          real(8), intent (in) :: v
                          real(8), intent (in) :: w
                          real(8), intent (in) :: r_m
                          real(8) :: t_0
                          real(8) :: tmp
                          t_0 = 2.0d0 / (r_m * r_m)
                          if (((3.0d0 + t_0) + (((0.125d0 * (3.0d0 - (2.0d0 * v))) * (r_m * (r_m * (w * w)))) / (v + (-1.0d0)))) <= (-2000000000000.0d0)) then
                              tmp = (-0.25d0) * (w * (w * (r_m * r_m)))
                          else
                              tmp = (-1.5d0) + t_0
                          end if
                          code = tmp
                      end function
                      
                      r_m = Math.abs(r);
                      public static double code(double v, double w, double r_m) {
                      	double t_0 = 2.0 / (r_m * r_m);
                      	double tmp;
                      	if (((3.0 + t_0) + (((0.125 * (3.0 - (2.0 * v))) * (r_m * (r_m * (w * w)))) / (v + -1.0))) <= -2000000000000.0) {
                      		tmp = -0.25 * (w * (w * (r_m * r_m)));
                      	} else {
                      		tmp = -1.5 + t_0;
                      	}
                      	return tmp;
                      }
                      
                      r_m = math.fabs(r)
                      def code(v, w, r_m):
                      	t_0 = 2.0 / (r_m * r_m)
                      	tmp = 0
                      	if ((3.0 + t_0) + (((0.125 * (3.0 - (2.0 * v))) * (r_m * (r_m * (w * w)))) / (v + -1.0))) <= -2000000000000.0:
                      		tmp = -0.25 * (w * (w * (r_m * r_m)))
                      	else:
                      		tmp = -1.5 + t_0
                      	return tmp
                      
                      r_m = abs(r)
                      function code(v, w, r_m)
                      	t_0 = Float64(2.0 / Float64(r_m * r_m))
                      	tmp = 0.0
                      	if (Float64(Float64(3.0 + t_0) + Float64(Float64(Float64(0.125 * Float64(3.0 - Float64(2.0 * v))) * Float64(r_m * Float64(r_m * Float64(w * w)))) / Float64(v + -1.0))) <= -2000000000000.0)
                      		tmp = Float64(-0.25 * Float64(w * Float64(w * Float64(r_m * r_m))));
                      	else
                      		tmp = Float64(-1.5 + t_0);
                      	end
                      	return tmp
                      end
                      
                      r_m = abs(r);
                      function tmp_2 = code(v, w, r_m)
                      	t_0 = 2.0 / (r_m * r_m);
                      	tmp = 0.0;
                      	if (((3.0 + t_0) + (((0.125 * (3.0 - (2.0 * v))) * (r_m * (r_m * (w * w)))) / (v + -1.0))) <= -2000000000000.0)
                      		tmp = -0.25 * (w * (w * (r_m * r_m)));
                      	else
                      		tmp = -1.5 + t_0;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      r_m = N[Abs[r], $MachinePrecision]
                      code[v_, w_, r$95$m_] := Block[{t$95$0 = N[(2.0 / N[(r$95$m * r$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(3.0 + t$95$0), $MachinePrecision] + N[(N[(N[(0.125 * N[(3.0 - N[(2.0 * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(r$95$m * N[(r$95$m * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(v + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2000000000000.0], N[(-0.25 * N[(w * N[(w * N[(r$95$m * r$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.5 + t$95$0), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      r_m = \left|r\right|
                      
                      \\
                      \begin{array}{l}
                      t_0 := \frac{2}{r\_m \cdot r\_m}\\
                      \mathbf{if}\;\left(3 + t\_0\right) + \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(r\_m \cdot \left(r\_m \cdot \left(w \cdot w\right)\right)\right)}{v + -1} \leq -2000000000000:\\
                      \;\;\;\;-0.25 \cdot \left(w \cdot \left(w \cdot \left(r\_m \cdot r\_m\right)\right)\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;-1.5 + t\_0\\
                      
                      
                      \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))) < -2e12

                        1. Initial program 85.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}{\left(\frac{-1}{8} \cdot \frac{-3 \cdot \left({r}^{2} \cdot {w}^{2}\right) - -2 \cdot \left({r}^{2} \cdot {w}^{2}\right)}{v} + 2 \cdot \frac{1}{{r}^{2}}\right) - \left(\frac{3}{2} + \frac{1}{4} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)} \]
                        4. Applied rewrites64.3%

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

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

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

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

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

                            if -2e12 < (-.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.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 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. lower-+.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. lower-/.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. lower-*.f6494.8

                                \[\leadsto -1.5 + \frac{2}{\color{blue}{r \cdot r}} \]
                            5. Applied rewrites94.8%

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

                            \[\leadsto \begin{array}{l} \mathbf{if}\;\left(3 + \frac{2}{r \cdot r}\right) + \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(r \cdot \left(r \cdot \left(w \cdot w\right)\right)\right)}{v + -1} \leq -2000000000000:\\ \;\;\;\;-0.25 \cdot \left(w \cdot \left(w \cdot \left(r \cdot r\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-1.5 + \frac{2}{r \cdot r}\\ \end{array} \]
                          6. Add Preprocessing

                          Alternative 5: 99.1% accurate, 1.0× speedup?

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

                            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 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. lower-+.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. lower-/.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. lower-*.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. lower-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. Applied rewrites80.0%

                              \[\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. Applied rewrites94.2%

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

                              if 3.9000000000000003e-46 < r

                              1. Initial program 85.5%

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

                                  \[\leadsto \color{blue}{\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(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - \frac{9}{2}} \]
                                2. lift--.f64N/A

                                  \[\leadsto \color{blue}{\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(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right)} - \frac{9}{2} \]
                                3. associate--l-N/A

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

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

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

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

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

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

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

                            Alternative 6: 98.3% accurate, 1.3× speedup?

                            \[\begin{array}{l} r_m = \left|r\right| \\ \begin{array}{l} \mathbf{if}\;r\_m \leq 195:\\ \;\;\;\;-1.5 + \mathsf{fma}\left(w \cdot \left(\left(r\_m \cdot r\_m\right) \cdot -0.25\right), w, \frac{2}{r\_m \cdot r\_m}\right)\\ \mathbf{else}:\\ \;\;\;\;3 - \mathsf{fma}\left(0.125 \cdot \mathsf{fma}\left(v, -2, 3\right), \left(w \cdot \left(r\_m \cdot w\right)\right) \cdot \frac{r\_m}{1 - v}, 4.5\right)\\ \end{array} \end{array} \]
                            r_m = (fabs.f64 r)
                            (FPCore (v w r_m)
                             :precision binary64
                             (if (<= r_m 195.0)
                               (+ -1.5 (fma (* w (* (* r_m r_m) -0.25)) w (/ 2.0 (* r_m r_m))))
                               (-
                                3.0
                                (fma
                                 (* 0.125 (fma v -2.0 3.0))
                                 (* (* w (* r_m w)) (/ r_m (- 1.0 v)))
                                 4.5))))
                            r_m = fabs(r);
                            double code(double v, double w, double r_m) {
                            	double tmp;
                            	if (r_m <= 195.0) {
                            		tmp = -1.5 + fma((w * ((r_m * r_m) * -0.25)), w, (2.0 / (r_m * r_m)));
                            	} else {
                            		tmp = 3.0 - fma((0.125 * fma(v, -2.0, 3.0)), ((w * (r_m * w)) * (r_m / (1.0 - v))), 4.5);
                            	}
                            	return tmp;
                            }
                            
                            r_m = abs(r)
                            function code(v, w, r_m)
                            	tmp = 0.0
                            	if (r_m <= 195.0)
                            		tmp = Float64(-1.5 + fma(Float64(w * Float64(Float64(r_m * r_m) * -0.25)), w, Float64(2.0 / Float64(r_m * r_m))));
                            	else
                            		tmp = Float64(3.0 - fma(Float64(0.125 * fma(v, -2.0, 3.0)), Float64(Float64(w * Float64(r_m * w)) * Float64(r_m / Float64(1.0 - v))), 4.5));
                            	end
                            	return tmp
                            end
                            
                            r_m = N[Abs[r], $MachinePrecision]
                            code[v_, w_, r$95$m_] := If[LessEqual[r$95$m, 195.0], N[(-1.5 + N[(N[(w * N[(N[(r$95$m * r$95$m), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision] * w + N[(2.0 / N[(r$95$m * r$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(3.0 - N[(N[(0.125 * N[(v * -2.0 + 3.0), $MachinePrecision]), $MachinePrecision] * N[(N[(w * N[(r$95$m * w), $MachinePrecision]), $MachinePrecision] * N[(r$95$m / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 4.5), $MachinePrecision]), $MachinePrecision]]
                            
                            \begin{array}{l}
                            r_m = \left|r\right|
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;r\_m \leq 195:\\
                            \;\;\;\;-1.5 + \mathsf{fma}\left(w \cdot \left(\left(r\_m \cdot r\_m\right) \cdot -0.25\right), w, \frac{2}{r\_m \cdot r\_m}\right)\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;3 - \mathsf{fma}\left(0.125 \cdot \mathsf{fma}\left(v, -2, 3\right), \left(w \cdot \left(r\_m \cdot w\right)\right) \cdot \frac{r\_m}{1 - v}, 4.5\right)\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if r < 195

                              1. Initial program 86.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. lower-+.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. lower-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. lower-*.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. lower-*.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. lower-*.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. Applied rewrites90.7%

                                \[\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 195 < r

                              1. Initial program 87.1%

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

                                  \[\leadsto \color{blue}{\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(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - \frac{9}{2}} \]
                                2. lift--.f64N/A

                                  \[\leadsto \color{blue}{\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(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right)} - \frac{9}{2} \]
                                3. associate--l-N/A

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

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

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

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

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

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

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

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

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

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

                              Alternative 7: 91.5% accurate, 1.4× speedup?

                              \[\begin{array}{l} r_m = \left|r\right| \\ \begin{array}{l} \mathbf{if}\;r\_m \leq 3.9 \cdot 10^{-130}:\\ \;\;\;\;\frac{\frac{2}{r\_m}}{r\_m}\\ \mathbf{elif}\;r\_m \leq 0.43:\\ \;\;\;\;\frac{2}{r\_m \cdot r\_m} + \left(r\_m \cdot r\_m\right) \cdot \left(-0.375 \cdot \left(w \cdot w\right)\right)\\ \mathbf{elif}\;r\_m \leq 2.25 \cdot 10^{+148}:\\ \;\;\;\;3 - \mathsf{fma}\left(w, \left(w \cdot \left(r\_m \cdot r\_m\right)\right) \cdot 0.25, 4.5\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(r\_m \cdot w\right) \cdot -0.375, r\_m \cdot w, -1.5\right)\\ \end{array} \end{array} \]
                              r_m = (fabs.f64 r)
                              (FPCore (v w r_m)
                               :precision binary64
                               (if (<= r_m 3.9e-130)
                                 (/ (/ 2.0 r_m) r_m)
                                 (if (<= r_m 0.43)
                                   (+ (/ 2.0 (* r_m r_m)) (* (* r_m r_m) (* -0.375 (* w w))))
                                   (if (<= r_m 2.25e+148)
                                     (- 3.0 (fma w (* (* w (* r_m r_m)) 0.25) 4.5))
                                     (fma (* (* r_m w) -0.375) (* r_m w) -1.5)))))
                              r_m = fabs(r);
                              double code(double v, double w, double r_m) {
                              	double tmp;
                              	if (r_m <= 3.9e-130) {
                              		tmp = (2.0 / r_m) / r_m;
                              	} else if (r_m <= 0.43) {
                              		tmp = (2.0 / (r_m * r_m)) + ((r_m * r_m) * (-0.375 * (w * w)));
                              	} else if (r_m <= 2.25e+148) {
                              		tmp = 3.0 - fma(w, ((w * (r_m * r_m)) * 0.25), 4.5);
                              	} else {
                              		tmp = fma(((r_m * w) * -0.375), (r_m * w), -1.5);
                              	}
                              	return tmp;
                              }
                              
                              r_m = abs(r)
                              function code(v, w, r_m)
                              	tmp = 0.0
                              	if (r_m <= 3.9e-130)
                              		tmp = Float64(Float64(2.0 / r_m) / r_m);
                              	elseif (r_m <= 0.43)
                              		tmp = Float64(Float64(2.0 / Float64(r_m * r_m)) + Float64(Float64(r_m * r_m) * Float64(-0.375 * Float64(w * w))));
                              	elseif (r_m <= 2.25e+148)
                              		tmp = Float64(3.0 - fma(w, Float64(Float64(w * Float64(r_m * r_m)) * 0.25), 4.5));
                              	else
                              		tmp = fma(Float64(Float64(r_m * w) * -0.375), Float64(r_m * w), -1.5);
                              	end
                              	return tmp
                              end
                              
                              r_m = N[Abs[r], $MachinePrecision]
                              code[v_, w_, r$95$m_] := If[LessEqual[r$95$m, 3.9e-130], N[(N[(2.0 / r$95$m), $MachinePrecision] / r$95$m), $MachinePrecision], If[LessEqual[r$95$m, 0.43], N[(N[(2.0 / N[(r$95$m * r$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[(r$95$m * r$95$m), $MachinePrecision] * N[(-0.375 * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[r$95$m, 2.25e+148], N[(3.0 - N[(w * N[(N[(w * N[(r$95$m * r$95$m), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision] + 4.5), $MachinePrecision]), $MachinePrecision], N[(N[(N[(r$95$m * w), $MachinePrecision] * -0.375), $MachinePrecision] * N[(r$95$m * w), $MachinePrecision] + -1.5), $MachinePrecision]]]]
                              
                              \begin{array}{l}
                              r_m = \left|r\right|
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;r\_m \leq 3.9 \cdot 10^{-130}:\\
                              \;\;\;\;\frac{\frac{2}{r\_m}}{r\_m}\\
                              
                              \mathbf{elif}\;r\_m \leq 0.43:\\
                              \;\;\;\;\frac{2}{r\_m \cdot r\_m} + \left(r\_m \cdot r\_m\right) \cdot \left(-0.375 \cdot \left(w \cdot w\right)\right)\\
                              
                              \mathbf{elif}\;r\_m \leq 2.25 \cdot 10^{+148}:\\
                              \;\;\;\;3 - \mathsf{fma}\left(w, \left(w \cdot \left(r\_m \cdot r\_m\right)\right) \cdot 0.25, 4.5\right)\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\mathsf{fma}\left(\left(r\_m \cdot w\right) \cdot -0.375, r\_m \cdot w, -1.5\right)\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 4 regimes
                              2. if r < 3.9000000000000001e-130

                                1. Initial program 86.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. lower-/.f64N/A

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

                                    \[\leadsto \frac{2}{\color{blue}{r \cdot r}} \]
                                  3. lower-*.f6454.2

                                    \[\leadsto \frac{2}{\color{blue}{r \cdot r}} \]
                                5. Applied rewrites54.2%

                                  \[\leadsto \color{blue}{\frac{2}{r \cdot r}} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites54.2%

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

                                  if 3.9000000000000001e-130 < r < 0.429999999999999993

                                  1. Initial program 90.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. lower-+.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. lower-/.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. lower-*.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. lower-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. Applied rewrites93.9%

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

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

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

                                    if 0.429999999999999993 < r < 2.24999999999999997e148

                                    1. Initial program 87.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. lift--.f64N/A

                                        \[\leadsto \color{blue}{\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(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - \frac{9}{2}} \]
                                      2. lift--.f64N/A

                                        \[\leadsto \color{blue}{\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(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right)} - \frac{9}{2} \]
                                      3. associate--l-N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto 3 - \mathsf{fma}\left(w, 0.25 \cdot \left(\color{blue}{\left(r \cdot r\right)} \cdot w\right), 4.5\right) \]
                                      4. Applied rewrites97.5%

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

                                      if 2.24999999999999997e148 < r

                                      1. Initial program 85.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 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. lower-+.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. lower-/.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. lower-*.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. lower-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. Applied rewrites55.5%

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

                                        \[\leadsto \frac{2}{r \cdot r} + \frac{-3}{2} \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites25.6%

                                          \[\leadsto \frac{2}{r \cdot r} + -1.5 \]
                                        2. Taylor expanded in r around inf

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

                                            \[\leadsto \mathsf{fma}\left(w \cdot w, \color{blue}{\left(r \cdot r\right) \cdot -0.375}, -1.5\right) \]
                                          2. Step-by-step derivation
                                            1. Applied rewrites90.2%

                                              \[\leadsto \mathsf{fma}\left(\left(r \cdot w\right) \cdot -0.375, r \cdot \color{blue}{w}, -1.5\right) \]
                                          3. Recombined 4 regimes into one program.
                                          4. Final simplification68.9%

                                            \[\leadsto \begin{array}{l} \mathbf{if}\;r \leq 3.9 \cdot 10^{-130}:\\ \;\;\;\;\frac{\frac{2}{r}}{r}\\ \mathbf{elif}\;r \leq 0.43:\\ \;\;\;\;\frac{2}{r \cdot r} + \left(r \cdot r\right) \cdot \left(-0.375 \cdot \left(w \cdot w\right)\right)\\ \mathbf{elif}\;r \leq 2.25 \cdot 10^{+148}:\\ \;\;\;\;3 - \mathsf{fma}\left(w, \left(w \cdot \left(r \cdot r\right)\right) \cdot 0.25, 4.5\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(r \cdot w\right) \cdot -0.375, r \cdot w, -1.5\right)\\ \end{array} \]
                                          5. Add Preprocessing

                                          Alternative 8: 95.3% accurate, 1.4× speedup?

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

                                            1. Initial program 86.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. lower-+.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. lower-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. lower-*.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. lower-*.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. lower-*.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. Applied rewrites90.7%

                                              \[\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 195 < r

                                            1. Initial program 87.1%

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

                                                \[\leadsto \color{blue}{\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(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - \frac{9}{2}} \]
                                              2. lift--.f64N/A

                                                \[\leadsto \color{blue}{\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(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right)} - \frac{9}{2} \]
                                              3. associate--l-N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            Alternative 9: 93.3% accurate, 1.6× speedup?

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

                                              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 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. lower-+.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. lower-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. lower-*.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. lower-*.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. lower-*.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. Applied rewrites91.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)} \]

                                              if 2.24999999999999997e148 < r

                                              1. Initial program 85.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 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. lower-+.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. lower-/.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. lower-*.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. lower-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. Applied rewrites55.5%

                                                \[\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. Applied rewrites85.5%

                                                  \[\leadsto \mathsf{fma}\left(r \cdot \left(r \cdot \left(w \cdot w\right)\right), \color{blue}{-0.375}, -1.5 + \frac{2}{r \cdot r}\right) \]
                                                2. Step-by-step derivation
                                                  1. Applied rewrites90.2%

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

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

                                                Alternative 10: 93.3% accurate, 1.6× speedup?

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

                                                  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 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. lower-+.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. lower-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. lower-*.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. lower-*.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. lower-*.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. Applied rewrites91.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)} \]

                                                  if 2.24999999999999997e148 < r

                                                  1. Initial program 85.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 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. lower-+.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. lower-/.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. lower-*.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. lower-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. Applied rewrites55.5%

                                                    \[\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. Applied rewrites90.2%

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

                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;r \leq 2.25 \cdot 10^{+148}:\\ \;\;\;\;-1.5 + \mathsf{fma}\left(w \cdot \left(\left(r \cdot r\right) \cdot -0.25\right), w, \frac{2}{r \cdot r}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(r \cdot w, \left(r \cdot w\right) \cdot -0.375, -1.5 + \frac{2}{r \cdot r}\right)\\ \end{array} \]
                                                  9. Add Preprocessing

                                                  Alternative 11: 93.3% accurate, 1.6× speedup?

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

                                                    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 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. lower-+.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. lower-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. lower-*.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. lower-*.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. lower-*.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. Applied rewrites91.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)} \]

                                                    if 2.24999999999999997e148 < r

                                                    1. Initial program 85.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 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. lower-+.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. lower-/.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. lower-*.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. lower-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. Applied rewrites55.5%

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

                                                      \[\leadsto \frac{2}{r \cdot r} + \frac{-3}{2} \]
                                                    7. Step-by-step derivation
                                                      1. Applied rewrites25.6%

                                                        \[\leadsto \frac{2}{r \cdot r} + -1.5 \]
                                                      2. Taylor expanded in r around inf

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

                                                          \[\leadsto \mathsf{fma}\left(w \cdot w, \color{blue}{\left(r \cdot r\right) \cdot -0.375}, -1.5\right) \]
                                                        2. Step-by-step derivation
                                                          1. Applied rewrites90.2%

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

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

                                                        Alternative 12: 92.9% accurate, 1.6× speedup?

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

                                                          1. Initial program 86.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. 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. lower-+.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. lower-/.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. lower-*.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. lower-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. Applied rewrites80.4%

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

                                                            \[\leadsto \frac{2}{r \cdot r} + \frac{-3}{2} \]
                                                          7. Step-by-step derivation
                                                            1. Applied rewrites67.0%

                                                              \[\leadsto \frac{2}{r \cdot r} + -1.5 \]
                                                            2. Taylor expanded in w around inf

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

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

                                                              if 0.429999999999999993 < r < 2.24999999999999997e148

                                                              1. Initial program 87.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. lift--.f64N/A

                                                                  \[\leadsto \color{blue}{\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(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - \frac{9}{2}} \]
                                                                2. lift--.f64N/A

                                                                  \[\leadsto \color{blue}{\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(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right)} - \frac{9}{2} \]
                                                                3. associate--l-N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                    \[\leadsto 3 - \mathsf{fma}\left(w, 0.25 \cdot \left(\color{blue}{\left(r \cdot r\right)} \cdot w\right), 4.5\right) \]
                                                                4. Applied rewrites97.5%

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

                                                                if 2.24999999999999997e148 < r

                                                                1. Initial program 85.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 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. lower-+.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. lower-/.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. lower-*.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. lower-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. Applied rewrites55.5%

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

                                                                  \[\leadsto \frac{2}{r \cdot r} + \frac{-3}{2} \]
                                                                7. Step-by-step derivation
                                                                  1. Applied rewrites25.6%

                                                                    \[\leadsto \frac{2}{r \cdot r} + -1.5 \]
                                                                  2. Taylor expanded in r around inf

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

                                                                      \[\leadsto \mathsf{fma}\left(w \cdot w, \color{blue}{\left(r \cdot r\right) \cdot -0.375}, -1.5\right) \]
                                                                    2. Step-by-step derivation
                                                                      1. Applied rewrites90.2%

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

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

                                                                    Alternative 13: 57.6% accurate, 3.2× speedup?

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

                                                                      1. Initial program 86.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. Taylor expanded in r around 0

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

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

                                                                          \[\leadsto \frac{2}{\color{blue}{r \cdot r}} \]
                                                                        3. lower-*.f6455.4

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

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

                                                                      if 1.1499999999999999 < r

                                                                      1. Initial program 86.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 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. lower-+.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. lower-/.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. lower-*.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. lower-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. Applied rewrites64.3%

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

                                                                        \[\leadsto \frac{2}{r \cdot r} + \frac{-3}{2} \]
                                                                      7. Step-by-step derivation
                                                                        1. Applied rewrites33.4%

                                                                          \[\leadsto \frac{2}{r \cdot r} + -1.5 \]
                                                                        2. Taylor expanded in r around inf

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

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

                                                                            \[\leadsto \frac{-3}{2} \]
                                                                          3. Step-by-step derivation
                                                                            1. Applied rewrites33.4%

                                                                              \[\leadsto -1.5 \]
                                                                          4. Recombined 2 regimes into one program.
                                                                          5. Add Preprocessing

                                                                          Alternative 14: 58.2% accurate, 3.7× speedup?

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

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

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

                                                                          Alternative 15: 14.9% accurate, 73.0× speedup?

                                                                          \[\begin{array}{l} r_m = \left|r\right| \\ -1.5 \end{array} \]
                                                                          r_m = (fabs.f64 r)
                                                                          (FPCore (v w r_m) :precision binary64 -1.5)
                                                                          r_m = fabs(r);
                                                                          double code(double v, double w, double r_m) {
                                                                          	return -1.5;
                                                                          }
                                                                          
                                                                          r_m = abs(r)
                                                                          real(8) function code(v, w, r_m)
                                                                              real(8), intent (in) :: v
                                                                              real(8), intent (in) :: w
                                                                              real(8), intent (in) :: r_m
                                                                              code = -1.5d0
                                                                          end function
                                                                          
                                                                          r_m = Math.abs(r);
                                                                          public static double code(double v, double w, double r_m) {
                                                                          	return -1.5;
                                                                          }
                                                                          
                                                                          r_m = math.fabs(r)
                                                                          def code(v, w, r_m):
                                                                          	return -1.5
                                                                          
                                                                          r_m = abs(r)
                                                                          function code(v, w, r_m)
                                                                          	return -1.5
                                                                          end
                                                                          
                                                                          r_m = abs(r);
                                                                          function tmp = code(v, w, r_m)
                                                                          	tmp = -1.5;
                                                                          end
                                                                          
                                                                          r_m = N[Abs[r], $MachinePrecision]
                                                                          code[v_, w_, r$95$m_] := -1.5
                                                                          
                                                                          \begin{array}{l}
                                                                          r_m = \left|r\right|
                                                                          
                                                                          \\
                                                                          -1.5
                                                                          \end{array}
                                                                          
                                                                          Derivation
                                                                          1. Initial program 86.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. 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. lower-+.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. lower-/.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. lower-*.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. lower-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. Applied rewrites75.7%

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

                                                                            \[\leadsto \frac{2}{r \cdot r} + \frac{-3}{2} \]
                                                                          7. Step-by-step derivation
                                                                            1. Applied rewrites57.2%

                                                                              \[\leadsto \frac{2}{r \cdot r} + -1.5 \]
                                                                            2. Taylor expanded in r around inf

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

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

                                                                                \[\leadsto \frac{-3}{2} \]
                                                                              3. Step-by-step derivation
                                                                                1. Applied rewrites18.2%

                                                                                  \[\leadsto -1.5 \]
                                                                                2. Add Preprocessing

                                                                                Reproduce

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