Rosa's TurbineBenchmark

Percentage Accurate: 84.3% → 99.3%
Time: 12.1s
Alternatives: 17
Speedup: 1.7×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 84.3% 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.3% accurate, 1.1× speedup?

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

\\
\mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right) \cdot \left(\left(w \cdot \frac{r}{1 - v}\right) \cdot \left(w \cdot r\right)\right), -0.125, \frac{2}{r \cdot r} + 3\right) - 4.5
\end{array}
Derivation
  1. Initial program 86.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. Step-by-step derivation
    1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 97.7% accurate, 0.4× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t\_1 - 1.5\\


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

    1. Initial program 85.4%

      \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
    2. Add Preprocessing
    3. Taylor expanded in 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-*.f646.7

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

      \[\leadsto \color{blue}{\frac{2}{r \cdot r}} \]
    6. Taylor expanded in v around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 86.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. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 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 w around 0

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{2}{r \cdot r} - 1.5} \]
    7. Recombined 3 regimes into one program.
    8. Final simplification98.8%

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

    Alternative 3: 95.0% accurate, 0.4× speedup?

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

      1. Initial program 85.4%

        \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
      2. Add Preprocessing
      3. Taylor expanded in 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-*.f646.7

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

        \[\leadsto \color{blue}{\frac{2}{r \cdot r}} \]
      6. Taylor expanded in v around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        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

        1. Initial program 86.0%

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

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

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

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

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

            \[\leadsto \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)} + 2 \cdot \frac{1}{{r}^{2}} \]
          5. metadata-evalN/A

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(-0.375, \left(\left(w \cdot w\right) \cdot r\right) \cdot r, \frac{2}{r \cdot r} - 1.5\right)} \]
        6. 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)} \]
        7. Step-by-step derivation
          1. Applied rewrites59.1%

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

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

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

            1. Initial program 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 w around 0

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

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

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

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

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

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

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

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

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

          Alternative 4: 92.8% accurate, 0.4× speedup?

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

            1. Initial program 85.4%

              \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
            2. Add Preprocessing
            3. Taylor expanded in 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-*.f646.7

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

              \[\leadsto \color{blue}{\frac{2}{r \cdot r}} \]
            6. Taylor expanded in v around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              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

              1. Initial program 86.0%

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

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

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

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

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

                  \[\leadsto \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)} + 2 \cdot \frac{1}{{r}^{2}} \]
                5. metadata-evalN/A

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(-0.375, \left(\left(w \cdot w\right) \cdot r\right) \cdot r, \frac{2}{r \cdot r} - 1.5\right)} \]
              6. 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)} \]
              7. Step-by-step derivation
                1. Applied rewrites59.1%

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

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

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

                  1. Initial program 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 w around 0

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

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

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

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

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

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

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

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

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

                Alternative 5: 92.8% accurate, 0.4× speedup?

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

                  1. Initial program 85.4%

                    \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
                  2. Add Preprocessing
                  3. Taylor expanded in 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-*.f646.7

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

                    \[\leadsto \color{blue}{\frac{2}{r \cdot r}} \]
                  6. Taylor expanded in v around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    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

                    1. Initial program 86.0%

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

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

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

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

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

                        \[\leadsto \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)} + 2 \cdot \frac{1}{{r}^{2}} \]
                      5. metadata-evalN/A

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.375, \left(\left(w \cdot w\right) \cdot r\right) \cdot r, \frac{2}{r \cdot r} - 1.5\right)} \]
                    6. 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)} \]
                    7. Step-by-step derivation
                      1. Applied rewrites59.1%

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

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

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

                        1. Initial program 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 w around 0

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

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

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

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

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

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

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

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

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

                      Alternative 6: 89.5% accurate, 0.4× speedup?

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

                        1. Initial program 85.4%

                          \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
                        2. Add Preprocessing
                        3. Taylor expanded in 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-*.f646.7

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

                          \[\leadsto \color{blue}{\frac{2}{r \cdot r}} \]
                        6. Taylor expanded in v around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          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))) < 2

                          1. Initial program 96.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 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. +-commutativeN/A

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

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

                              \[\leadsto \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)} + 2 \cdot \frac{1}{{r}^{2}} \]
                            5. metadata-evalN/A

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

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

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

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

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

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

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

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

                            \[\leadsto \color{blue}{\mathsf{fma}\left(-0.375, \left(\left(w \cdot w\right) \cdot r\right) \cdot r, \frac{2}{r \cdot r} - 1.5\right)} \]
                          6. 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)} \]
                          7. Step-by-step derivation
                            1. Applied rewrites67.1%

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

                            if 2 < (-.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 84.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. lower--.f64N/A

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

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

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

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

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

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

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

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

                          Alternative 7: 92.0% accurate, 0.6× speedup?

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

                            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. +-commutativeN/A

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

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

                                \[\leadsto \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)} + 2 \cdot \frac{1}{{r}^{2}} \]
                              5. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                1. Initial program 85.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 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-*.f6477.0

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

                                  \[\leadsto \color{blue}{\frac{2}{r \cdot r}} \]
                                6. Taylor expanded in v around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                Alternative 8: 91.4% accurate, 0.8× speedup?

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

                                  1. Initial program 85.6%

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

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

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

                                      \[\leadsto \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)} + 2 \cdot \frac{1}{{r}^{2}} \]
                                    5. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      1. Initial program 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 w around 0

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

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

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

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

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

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

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

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

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

                                    Alternative 9: 87.8% accurate, 0.8× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2}{r \cdot r}\\ \mathbf{if}\;\left(t\_0 + 3\right) - \frac{\left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right) \cdot \left(\left(3 - 2 \cdot v\right) \cdot 0.125\right)}{1 - v} \leq -20000000000000:\\ \;\;\;\;\left(\left(-0.375 \cdot \left(r \cdot r\right)\right) \cdot w\right) \cdot w\\ \mathbf{else}:\\ \;\;\;\;t\_0 - 1.5\\ \end{array} \end{array} \]
                                    (FPCore (v w r)
                                     :precision binary64
                                     (let* ((t_0 (/ 2.0 (* r r))))
                                       (if (<=
                                            (-
                                             (+ t_0 3.0)
                                             (/ (* (* (* (* w w) r) r) (* (- 3.0 (* 2.0 v)) 0.125)) (- 1.0 v)))
                                            -20000000000000.0)
                                         (* (* (* -0.375 (* r r)) w) w)
                                         (- t_0 1.5))))
                                    double code(double v, double w, double r) {
                                    	double t_0 = 2.0 / (r * r);
                                    	double tmp;
                                    	if (((t_0 + 3.0) - (((((w * w) * r) * r) * ((3.0 - (2.0 * v)) * 0.125)) / (1.0 - v))) <= -20000000000000.0) {
                                    		tmp = ((-0.375 * (r * r)) * w) * w;
                                    	} else {
                                    		tmp = t_0 - 1.5;
                                    	}
                                    	return tmp;
                                    }
                                    
                                    real(8) function code(v, w, r)
                                        real(8), intent (in) :: v
                                        real(8), intent (in) :: w
                                        real(8), intent (in) :: r
                                        real(8) :: t_0
                                        real(8) :: tmp
                                        t_0 = 2.0d0 / (r * r)
                                        if (((t_0 + 3.0d0) - (((((w * w) * r) * r) * ((3.0d0 - (2.0d0 * v)) * 0.125d0)) / (1.0d0 - v))) <= (-20000000000000.0d0)) then
                                            tmp = (((-0.375d0) * (r * r)) * w) * w
                                        else
                                            tmp = t_0 - 1.5d0
                                        end if
                                        code = tmp
                                    end function
                                    
                                    public static double code(double v, double w, double r) {
                                    	double t_0 = 2.0 / (r * r);
                                    	double tmp;
                                    	if (((t_0 + 3.0) - (((((w * w) * r) * r) * ((3.0 - (2.0 * v)) * 0.125)) / (1.0 - v))) <= -20000000000000.0) {
                                    		tmp = ((-0.375 * (r * r)) * w) * w;
                                    	} else {
                                    		tmp = t_0 - 1.5;
                                    	}
                                    	return tmp;
                                    }
                                    
                                    def code(v, w, r):
                                    	t_0 = 2.0 / (r * r)
                                    	tmp = 0
                                    	if ((t_0 + 3.0) - (((((w * w) * r) * r) * ((3.0 - (2.0 * v)) * 0.125)) / (1.0 - v))) <= -20000000000000.0:
                                    		tmp = ((-0.375 * (r * r)) * w) * w
                                    	else:
                                    		tmp = t_0 - 1.5
                                    	return tmp
                                    
                                    function code(v, w, r)
                                    	t_0 = Float64(2.0 / Float64(r * r))
                                    	tmp = 0.0
                                    	if (Float64(Float64(t_0 + 3.0) - Float64(Float64(Float64(Float64(Float64(w * w) * r) * r) * Float64(Float64(3.0 - Float64(2.0 * v)) * 0.125)) / Float64(1.0 - v))) <= -20000000000000.0)
                                    		tmp = Float64(Float64(Float64(-0.375 * Float64(r * r)) * w) * w);
                                    	else
                                    		tmp = Float64(t_0 - 1.5);
                                    	end
                                    	return tmp
                                    end
                                    
                                    function tmp_2 = code(v, w, r)
                                    	t_0 = 2.0 / (r * r);
                                    	tmp = 0.0;
                                    	if (((t_0 + 3.0) - (((((w * w) * r) * r) * ((3.0 - (2.0 * v)) * 0.125)) / (1.0 - v))) <= -20000000000000.0)
                                    		tmp = ((-0.375 * (r * r)) * w) * w;
                                    	else
                                    		tmp = t_0 - 1.5;
                                    	end
                                    	tmp_2 = tmp;
                                    end
                                    
                                    code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(t$95$0 + 3.0), $MachinePrecision] - N[(N[(N[(N[(N[(w * w), $MachinePrecision] * r), $MachinePrecision] * r), $MachinePrecision] * N[(N[(3.0 - N[(2.0 * v), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -20000000000000.0], N[(N[(N[(-0.375 * N[(r * r), $MachinePrecision]), $MachinePrecision] * w), $MachinePrecision] * w), $MachinePrecision], N[(t$95$0 - 1.5), $MachinePrecision]]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    t_0 := \frac{2}{r \cdot r}\\
                                    \mathbf{if}\;\left(t\_0 + 3\right) - \frac{\left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right) \cdot \left(\left(3 - 2 \cdot v\right) \cdot 0.125\right)}{1 - v} \leq -20000000000000:\\
                                    \;\;\;\;\left(\left(-0.375 \cdot \left(r \cdot r\right)\right) \cdot w\right) \cdot w\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;t\_0 - 1.5\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 2 regimes
                                    2. if (-.f64 (+.f64 #s(literal 3 binary64) (/.f64 #s(literal 2 binary64) (*.f64 r r))) (/.f64 (*.f64 (*.f64 #s(literal 1/8 binary64) (-.f64 #s(literal 3 binary64) (*.f64 #s(literal 2 binary64) v))) (*.f64 (*.f64 (*.f64 w w) r) r)) (-.f64 #s(literal 1 binary64) v))) < -2e13

                                      1. Initial program 87.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. +-commutativeN/A

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

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

                                          \[\leadsto \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)} + 2 \cdot \frac{1}{{r}^{2}} \]
                                        5. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

                                        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)))

                                        1. Initial program 84.9%

                                          \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
                                        2. 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. lower--.f64N/A

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

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

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

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

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

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

                                          \[\leadsto \color{blue}{\frac{2}{r \cdot r} - 1.5} \]
                                      8. Recombined 2 regimes into one program.
                                      9. Final simplification89.7%

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

                                      Alternative 10: 94.8% accurate, 1.0× speedup?

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

                                        1. Initial program 75.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. Step-by-step derivation
                                          1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        if -2e86 < v

                                        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. 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. +-commutativeN/A

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

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

                                            \[\leadsto \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)} + 2 \cdot \frac{1}{{r}^{2}} \]
                                          5. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

                                        Alternative 11: 97.5% accurate, 1.1× speedup?

                                        \[\begin{array}{l} \\ \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right), \left(\left(\left(w \cdot \frac{r}{1 - v}\right) \cdot r\right) \cdot w\right) \cdot -0.125, \frac{2}{r \cdot r} - 1.5\right) \end{array} \]
                                        (FPCore (v w r)
                                         :precision binary64
                                         (fma
                                          (fma -2.0 v 3.0)
                                          (* (* (* (* w (/ r (- 1.0 v))) r) w) -0.125)
                                          (- (/ 2.0 (* r r)) 1.5)))
                                        double code(double v, double w, double r) {
                                        	return fma(fma(-2.0, v, 3.0), ((((w * (r / (1.0 - v))) * r) * w) * -0.125), ((2.0 / (r * r)) - 1.5));
                                        }
                                        
                                        function code(v, w, r)
                                        	return fma(fma(-2.0, v, 3.0), Float64(Float64(Float64(Float64(w * Float64(r / Float64(1.0 - v))) * r) * w) * -0.125), Float64(Float64(2.0 / Float64(r * r)) - 1.5))
                                        end
                                        
                                        code[v_, w_, r_] := N[(N[(-2.0 * v + 3.0), $MachinePrecision] * N[(N[(N[(N[(w * N[(r / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * r), $MachinePrecision] * w), $MachinePrecision] * -0.125), $MachinePrecision] + N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] - 1.5), $MachinePrecision]), $MachinePrecision]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \mathsf{fma}\left(\mathsf{fma}\left(-2, v, 3\right), \left(\left(\left(w \cdot \frac{r}{1 - v}\right) \cdot r\right) \cdot w\right) \cdot -0.125, \frac{2}{r \cdot r} - 1.5\right)
                                        \end{array}
                                        
                                        Derivation
                                        1. Initial program 86.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. Step-by-step derivation
                                          1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        Alternative 12: 93.2% accurate, 1.4× speedup?

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

                                          1. Initial program 75.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 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-*.f6434.2

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

                                            \[\leadsto \color{blue}{\frac{2}{r \cdot r}} \]
                                          6. Taylor expanded in v around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            if -2e86 < v < 1.29999999999999994e49

                                            1. Initial program 89.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. +-commutativeN/A

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

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

                                                \[\leadsto \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)} + 2 \cdot \frac{1}{{r}^{2}} \]
                                              5. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

                                              if 1.29999999999999994e49 < v

                                              1. Initial program 83.1%

                                                \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
                                              2. Add Preprocessing
                                              3. Taylor expanded in r around 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-*.f6459.3

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

                                                \[\leadsto \color{blue}{\frac{2}{r \cdot r}} \]
                                              6. Taylor expanded in v around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto \frac{2}{r \cdot r} - \left(\left(\left(w \cdot r\right) \cdot r\right) \cdot 0.25\right) \cdot \color{blue}{w} \]
                                              11. Recombined 3 regimes into one program.
                                              12. Add Preprocessing

                                              Alternative 13: 95.3% accurate, 1.6× speedup?

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

                                                1. Initial program 76.5%

                                                  \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
                                                2. Add Preprocessing
                                                3. Taylor expanded in r around 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-*.f6434.2

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

                                                  \[\leadsto \color{blue}{\frac{2}{r \cdot r}} \]
                                                6. Taylor expanded in v around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  if -2e98 < v

                                                  1. Initial program 87.6%

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

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

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

                                                      \[\leadsto \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)} + 2 \cdot \frac{1}{{r}^{2}} \]
                                                    5. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

                                                  Alternative 14: 86.8% accurate, 1.7× speedup?

                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;r \leq 1.75 \cdot 10^{-6}:\\ \;\;\;\;\mathsf{fma}\left(w \cdot r, -0.375 \cdot \left(w \cdot r\right), \frac{2}{r \cdot r}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(w \cdot r\right) \cdot w\right) \cdot r, -0.375, -1.5\right)\\ \end{array} \end{array} \]
                                                  (FPCore (v w r)
                                                   :precision binary64
                                                   (if (<= r 1.75e-6)
                                                     (fma (* w r) (* -0.375 (* w r)) (/ 2.0 (* r r)))
                                                     (fma (* (* (* w r) w) r) -0.375 -1.5)))
                                                  double code(double v, double w, double r) {
                                                  	double tmp;
                                                  	if (r <= 1.75e-6) {
                                                  		tmp = fma((w * r), (-0.375 * (w * r)), (2.0 / (r * r)));
                                                  	} else {
                                                  		tmp = fma((((w * r) * w) * r), -0.375, -1.5);
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  function code(v, w, r)
                                                  	tmp = 0.0
                                                  	if (r <= 1.75e-6)
                                                  		tmp = fma(Float64(w * r), Float64(-0.375 * Float64(w * r)), Float64(2.0 / Float64(r * r)));
                                                  	else
                                                  		tmp = fma(Float64(Float64(Float64(w * r) * w) * r), -0.375, -1.5);
                                                  	end
                                                  	return tmp
                                                  end
                                                  
                                                  code[v_, w_, r_] := If[LessEqual[r, 1.75e-6], N[(N[(w * r), $MachinePrecision] * N[(-0.375 * N[(w * r), $MachinePrecision]), $MachinePrecision] + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(w * r), $MachinePrecision] * w), $MachinePrecision] * r), $MachinePrecision] * -0.375 + -1.5), $MachinePrecision]]
                                                  
                                                  \begin{array}{l}
                                                  
                                                  \\
                                                  \begin{array}{l}
                                                  \mathbf{if}\;r \leq 1.75 \cdot 10^{-6}:\\
                                                  \;\;\;\;\mathsf{fma}\left(w \cdot r, -0.375 \cdot \left(w \cdot r\right), \frac{2}{r \cdot r}\right)\\
                                                  
                                                  \mathbf{else}:\\
                                                  \;\;\;\;\mathsf{fma}\left(\left(\left(w \cdot r\right) \cdot w\right) \cdot r, -0.375, -1.5\right)\\
                                                  
                                                  
                                                  \end{array}
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Split input into 2 regimes
                                                  2. if r < 1.74999999999999997e-6

                                                    1. Initial program 84.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. +-commutativeN/A

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

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

                                                        \[\leadsto \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)} + 2 \cdot \frac{1}{{r}^{2}} \]
                                                      5. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                        if 1.74999999999999997e-6 < r

                                                        1. Initial program 91.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. +-commutativeN/A

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

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

                                                            \[\leadsto \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)} + 2 \cdot \frac{1}{{r}^{2}} \]
                                                          5. metadata-evalN/A

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

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

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

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

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

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

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

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

                                                          \[\leadsto \color{blue}{\mathsf{fma}\left(-0.375, \left(\left(w \cdot w\right) \cdot r\right) \cdot r, \frac{2}{r \cdot r} - 1.5\right)} \]
                                                        6. 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)} \]
                                                        7. Step-by-step derivation
                                                          1. Applied rewrites77.5%

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

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

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

                                                          Alternative 15: 50.2% accurate, 3.2× speedup?

                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;r \leq 1.75 \cdot 10^{-6}:\\ \;\;\;\;\frac{2}{r \cdot r}\\ \mathbf{else}:\\ \;\;\;\;-1.5\\ \end{array} \end{array} \]
                                                          (FPCore (v w r) :precision binary64 (if (<= r 1.75e-6) (/ 2.0 (* r r)) -1.5))
                                                          double code(double v, double w, double r) {
                                                          	double tmp;
                                                          	if (r <= 1.75e-6) {
                                                          		tmp = 2.0 / (r * r);
                                                          	} else {
                                                          		tmp = -1.5;
                                                          	}
                                                          	return tmp;
                                                          }
                                                          
                                                          real(8) function code(v, w, r)
                                                              real(8), intent (in) :: v
                                                              real(8), intent (in) :: w
                                                              real(8), intent (in) :: r
                                                              real(8) :: tmp
                                                              if (r <= 1.75d-6) then
                                                                  tmp = 2.0d0 / (r * r)
                                                              else
                                                                  tmp = -1.5d0
                                                              end if
                                                              code = tmp
                                                          end function
                                                          
                                                          public static double code(double v, double w, double r) {
                                                          	double tmp;
                                                          	if (r <= 1.75e-6) {
                                                          		tmp = 2.0 / (r * r);
                                                          	} else {
                                                          		tmp = -1.5;
                                                          	}
                                                          	return tmp;
                                                          }
                                                          
                                                          def code(v, w, r):
                                                          	tmp = 0
                                                          	if r <= 1.75e-6:
                                                          		tmp = 2.0 / (r * r)
                                                          	else:
                                                          		tmp = -1.5
                                                          	return tmp
                                                          
                                                          function code(v, w, r)
                                                          	tmp = 0.0
                                                          	if (r <= 1.75e-6)
                                                          		tmp = Float64(2.0 / Float64(r * r));
                                                          	else
                                                          		tmp = -1.5;
                                                          	end
                                                          	return tmp
                                                          end
                                                          
                                                          function tmp_2 = code(v, w, r)
                                                          	tmp = 0.0;
                                                          	if (r <= 1.75e-6)
                                                          		tmp = 2.0 / (r * r);
                                                          	else
                                                          		tmp = -1.5;
                                                          	end
                                                          	tmp_2 = tmp;
                                                          end
                                                          
                                                          code[v_, w_, r_] := If[LessEqual[r, 1.75e-6], N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision], -1.5]
                                                          
                                                          \begin{array}{l}
                                                          
                                                          \\
                                                          \begin{array}{l}
                                                          \mathbf{if}\;r \leq 1.75 \cdot 10^{-6}:\\
                                                          \;\;\;\;\frac{2}{r \cdot r}\\
                                                          
                                                          \mathbf{else}:\\
                                                          \;\;\;\;-1.5\\
                                                          
                                                          
                                                          \end{array}
                                                          \end{array}
                                                          
                                                          Derivation
                                                          1. Split input into 2 regimes
                                                          2. if r < 1.74999999999999997e-6

                                                            1. Initial program 84.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 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-*.f6461.2

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

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

                                                            if 1.74999999999999997e-6 < r

                                                            1. Initial program 91.4%

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

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

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

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

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

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

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

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

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

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

                                                                \[\leadsto -1.5 \]
                                                            8. Recombined 2 regimes into one program.
                                                            9. Add Preprocessing

                                                            Alternative 16: 57.2% accurate, 3.7× speedup?

                                                            \[\begin{array}{l} \\ \frac{2}{r \cdot r} - 1.5 \end{array} \]
                                                            (FPCore (v w r) :precision binary64 (- (/ 2.0 (* r r)) 1.5))
                                                            double code(double v, double w, double r) {
                                                            	return (2.0 / (r * r)) - 1.5;
                                                            }
                                                            
                                                            real(8) function code(v, w, r)
                                                                real(8), intent (in) :: v
                                                                real(8), intent (in) :: w
                                                                real(8), intent (in) :: r
                                                                code = (2.0d0 / (r * r)) - 1.5d0
                                                            end function
                                                            
                                                            public static double code(double v, double w, double r) {
                                                            	return (2.0 / (r * r)) - 1.5;
                                                            }
                                                            
                                                            def code(v, w, r):
                                                            	return (2.0 / (r * r)) - 1.5
                                                            
                                                            function code(v, w, r)
                                                            	return Float64(Float64(2.0 / Float64(r * r)) - 1.5)
                                                            end
                                                            
                                                            function tmp = code(v, w, r)
                                                            	tmp = (2.0 / (r * r)) - 1.5;
                                                            end
                                                            
                                                            code[v_, w_, r_] := N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] - 1.5), $MachinePrecision]
                                                            
                                                            \begin{array}{l}
                                                            
                                                            \\
                                                            \frac{2}{r \cdot r} - 1.5
                                                            \end{array}
                                                            
                                                            Derivation
                                                            1. Initial program 86.0%

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

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

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

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

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

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

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

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

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

                                                            Alternative 17: 14.4% accurate, 73.0× speedup?

                                                            \[\begin{array}{l} \\ -1.5 \end{array} \]
                                                            (FPCore (v w r) :precision binary64 -1.5)
                                                            double code(double v, double w, double r) {
                                                            	return -1.5;
                                                            }
                                                            
                                                            real(8) function code(v, w, r)
                                                                real(8), intent (in) :: v
                                                                real(8), intent (in) :: w
                                                                real(8), intent (in) :: r
                                                                code = -1.5d0
                                                            end function
                                                            
                                                            public static double code(double v, double w, double r) {
                                                            	return -1.5;
                                                            }
                                                            
                                                            def code(v, w, r):
                                                            	return -1.5
                                                            
                                                            function code(v, w, r)
                                                            	return -1.5
                                                            end
                                                            
                                                            function tmp = code(v, w, r)
                                                            	tmp = -1.5;
                                                            end
                                                            
                                                            code[v_, w_, r_] := -1.5
                                                            
                                                            \begin{array}{l}
                                                            
                                                            \\
                                                            -1.5
                                                            \end{array}
                                                            
                                                            Derivation
                                                            1. Initial program 86.0%

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

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

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

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

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

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

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

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

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

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

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

                                                              Reproduce

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