Rosa's TurbineBenchmark

Percentage Accurate: 84.7% → 99.7%
Time: 11.7s
Alternatives: 12
Speedup: 1.4×

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 12 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.7% 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.7% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.6% accurate, 0.4× speedup?

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

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

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

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


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

    1. Initial program 78.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{r \cdot r} + \left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot {w}^{2}} + \left(\mathsf{neg}\left(\frac{3}{2}\right)\right)\right) \]
      7. 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)} + \left(\mathsf{neg}\left(\frac{3}{2}\right)\right)\right) \]
      8. 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} + \left(\mathsf{neg}\left(\frac{3}{2}\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \frac{2}{r \cdot r} + \left(\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w + \color{blue}{\frac{-3}{2}}\right) \]
      10. 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)} \]
      11. 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) \]
      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. 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) \]
      14. lower-*.f6492.7

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

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

        \[\leadsto \frac{2}{r \cdot r} + \left(\left(w \cdot \left(r \cdot r\right)\right) \cdot -0.25\right) \cdot \color{blue}{w} \]
      2. Step-by-step derivation
        1. Applied rewrites96.5%

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

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

        1. Initial program 88.7%

          \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. 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. 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(\left(\color{blue}{\left(w \cdot w\right)} \cdot r\right) \cdot r\right)}{1 - v}\right) - \frac{9}{2} \]
          4. 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 \left(\color{blue}{\left(w \cdot \left(w \cdot r\right)\right)} \cdot r\right)}{1 - v}\right) - \frac{9}{2} \]
          5. 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(w \cdot \left(\left(w \cdot r\right) \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(w \cdot \left(\left(w \cdot r\right) \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(w \cdot \color{blue}{\left(\left(w \cdot r\right) \cdot r\right)}\right)}{1 - v}\right) - \frac{9}{2} \]
          8. lower-*.f6491.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(w \cdot \left(\color{blue}{\left(w \cdot r\right)} \cdot r\right)\right)}{1 - v}\right) - 4.5 \]
        4. Applied rewrites91.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(w \cdot \left(\left(w \cdot r\right) \cdot r\right)\right)}}{1 - v}\right) - 4.5 \]
        5. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\color{blue}{3} - \frac{\left(\left(\left(\mathsf{fma}\left(v, -2, 3\right) \cdot 0.125\right) \cdot w\right) \cdot r\right) \cdot \left(r \cdot w\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 85.1%

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

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

              \[\leadsto \color{blue}{2 \cdot \frac{1}{{r}^{2}} + \left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{3}{8} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right)} \]
            2. +-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 rewrites85.1%

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

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

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

          Alternative 3: 95.7% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{2}{r \cdot r} + \left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot {w}^{2}} + \left(\mathsf{neg}\left(\frac{3}{2}\right)\right)\right) \]
              7. 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)} + \left(\mathsf{neg}\left(\frac{3}{2}\right)\right)\right) \]
              8. 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} + \left(\mathsf{neg}\left(\frac{3}{2}\right)\right)\right) \]
              9. metadata-evalN/A

                \[\leadsto \frac{2}{r \cdot r} + \left(\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w + \color{blue}{\frac{-3}{2}}\right) \]
              10. 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)} \]
              11. 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) \]
              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. 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) \]
              14. lower-*.f6492.7

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

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

                \[\leadsto \frac{2}{r \cdot r} + \left(\left(w \cdot \left(r \cdot r\right)\right) \cdot -0.25\right) \cdot \color{blue}{w} \]
              2. Step-by-step derivation
                1. Applied rewrites96.5%

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

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

                1. Initial program 93.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 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. Step-by-step derivation
                  1. Applied rewrites94.1%

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

                  if 1.99999999999999997e307 < (-.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 72.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-*.f64100.0

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

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

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

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

                  Alternative 4: 94.2% accurate, 0.6× speedup?

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

                    1. Initial program 78.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \frac{2}{r \cdot r} + \left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot {w}^{2}} + \left(\mathsf{neg}\left(\frac{3}{2}\right)\right)\right) \]
                      7. 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)} + \left(\mathsf{neg}\left(\frac{3}{2}\right)\right)\right) \]
                      8. 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} + \left(\mathsf{neg}\left(\frac{3}{2}\right)\right)\right) \]
                      9. metadata-evalN/A

                        \[\leadsto \frac{2}{r \cdot r} + \left(\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w + \color{blue}{\frac{-3}{2}}\right) \]
                      10. 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)} \]
                      11. 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) \]
                      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. 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) \]
                      14. lower-*.f6491.8

                        \[\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) \]
                    7. Applied rewrites91.8%

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

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

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

                        if -1.0000000000000001e299 < (-.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.3%

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{2}{r \cdot r} + \color{blue}{-1.5} \]
                          2. Taylor expanded in v around 0

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

                              \[\leadsto \frac{2}{r \cdot r} + \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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \frac{2}{r \cdot r} + \mathsf{fma}\left(\frac{-3}{8} \cdot \left(w \cdot w\right), \color{blue}{r \cdot r}, \frac{-3}{2}\right) \]
                            14. lower-*.f6474.6

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

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

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

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

                          Alternative 5: 91.2% accurate, 0.6× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2}{r \cdot r}\\ \mathbf{if}\;\left(3 + t\_0\right) - \frac{\left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right) \cdot \left(\left(3 - v \cdot 2\right) \cdot 0.125\right)}{1 - v} \leq -1 \cdot 10^{+45}:\\ \;\;\;\;\left(\left(-0.25 \cdot w\right) \cdot r\right) \cdot \left(w \cdot r\right) + t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_0 - 1.5\\ \end{array} \end{array} \]
                          (FPCore (v w r)
                           :precision binary64
                           (let* ((t_0 (/ 2.0 (* r r))))
                             (if (<=
                                  (-
                                   (+ 3.0 t_0)
                                   (/ (* (* (* (* w w) r) r) (* (- 3.0 (* v 2.0)) 0.125)) (- 1.0 v)))
                                  -1e+45)
                               (+ (* (* (* -0.25 w) r) (* w r)) t_0)
                               (- t_0 1.5))))
                          double code(double v, double w, double r) {
                          	double t_0 = 2.0 / (r * r);
                          	double tmp;
                          	if (((3.0 + t_0) - (((((w * w) * r) * r) * ((3.0 - (v * 2.0)) * 0.125)) / (1.0 - v))) <= -1e+45) {
                          		tmp = (((-0.25 * w) * r) * (w * r)) + t_0;
                          	} 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 (((3.0d0 + t_0) - (((((w * w) * r) * r) * ((3.0d0 - (v * 2.0d0)) * 0.125d0)) / (1.0d0 - v))) <= (-1d+45)) then
                                  tmp = ((((-0.25d0) * w) * r) * (w * r)) + t_0
                              else
                                  tmp = t_0 - 1.5d0
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double v, double w, double r) {
                          	double t_0 = 2.0 / (r * r);
                          	double tmp;
                          	if (((3.0 + t_0) - (((((w * w) * r) * r) * ((3.0 - (v * 2.0)) * 0.125)) / (1.0 - v))) <= -1e+45) {
                          		tmp = (((-0.25 * w) * r) * (w * r)) + t_0;
                          	} else {
                          		tmp = t_0 - 1.5;
                          	}
                          	return tmp;
                          }
                          
                          def code(v, w, r):
                          	t_0 = 2.0 / (r * r)
                          	tmp = 0
                          	if ((3.0 + t_0) - (((((w * w) * r) * r) * ((3.0 - (v * 2.0)) * 0.125)) / (1.0 - v))) <= -1e+45:
                          		tmp = (((-0.25 * w) * r) * (w * r)) + t_0
                          	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(3.0 + t_0) - Float64(Float64(Float64(Float64(Float64(w * w) * r) * r) * Float64(Float64(3.0 - Float64(v * 2.0)) * 0.125)) / Float64(1.0 - v))) <= -1e+45)
                          		tmp = Float64(Float64(Float64(Float64(-0.25 * w) * r) * Float64(w * r)) + t_0);
                          	else
                          		tmp = Float64(t_0 - 1.5);
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(v, w, r)
                          	t_0 = 2.0 / (r * r);
                          	tmp = 0.0;
                          	if (((3.0 + t_0) - (((((w * w) * r) * r) * ((3.0 - (v * 2.0)) * 0.125)) / (1.0 - v))) <= -1e+45)
                          		tmp = (((-0.25 * w) * r) * (w * r)) + t_0;
                          	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[(3.0 + t$95$0), $MachinePrecision] - N[(N[(N[(N[(N[(w * w), $MachinePrecision] * r), $MachinePrecision] * r), $MachinePrecision] * N[(N[(3.0 - N[(v * 2.0), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e+45], N[(N[(N[(N[(-0.25 * w), $MachinePrecision] * r), $MachinePrecision] * N[(w * r), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], N[(t$95$0 - 1.5), $MachinePrecision]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          t_0 := \frac{2}{r \cdot r}\\
                          \mathbf{if}\;\left(3 + t\_0\right) - \frac{\left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right) \cdot \left(\left(3 - v \cdot 2\right) \cdot 0.125\right)}{1 - v} \leq -1 \cdot 10^{+45}:\\
                          \;\;\;\;\left(\left(-0.25 \cdot w\right) \cdot r\right) \cdot \left(w \cdot r\right) + t\_0\\
                          
                          \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))) < -9.9999999999999993e44

                            1. Initial program 82.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{2}{r \cdot r} + \left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot {w}^{2}} + \left(\mathsf{neg}\left(\frac{3}{2}\right)\right)\right) \]
                              7. 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)} + \left(\mathsf{neg}\left(\frac{3}{2}\right)\right)\right) \]
                              8. 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} + \left(\mathsf{neg}\left(\frac{3}{2}\right)\right)\right) \]
                              9. metadata-evalN/A

                                \[\leadsto \frac{2}{r \cdot r} + \left(\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w + \color{blue}{\frac{-3}{2}}\right) \]
                              10. 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)} \]
                              11. 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) \]
                              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. 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) \]
                              14. lower-*.f6481.8

                                \[\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) \]
                            7. Applied rewrites81.8%

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

                                \[\leadsto \frac{2}{r \cdot r} + \left(\left(w \cdot \left(r \cdot r\right)\right) \cdot -0.25\right) \cdot \color{blue}{w} \]
                              2. Step-by-step derivation
                                1. Applied rewrites85.6%

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

                                if -9.9999999999999993e44 < (-.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.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 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.9

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

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

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

                              Alternative 6: 89.4% accurate, 0.6× speedup?

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

                                1. Initial program 82.1%

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{2}{r \cdot r} + \color{blue}{-1.5} \]
                                  2. Taylor expanded in v around 0

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

                                      \[\leadsto \frac{2}{r \cdot r} + \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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    if -9.9999999999999993e44 < (-.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.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 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.9

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

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

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

                                  Alternative 7: 87.6% accurate, 0.8× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2}{r \cdot r}\\ \mathbf{if}\;\left(3 + t\_0\right) - \frac{\left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right) \cdot \left(\left(3 - v \cdot 2\right) \cdot 0.125\right)}{1 - v} \leq -1 \cdot 10^{+45}:\\ \;\;\;\;\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 (<=
                                          (-
                                           (+ 3.0 t_0)
                                           (/ (* (* (* (* w w) r) r) (* (- 3.0 (* v 2.0)) 0.125)) (- 1.0 v)))
                                          -1e+45)
                                       (* (* (* -0.375 (* r r)) w) w)
                                       (- t_0 1.5))))
                                  double code(double v, double w, double r) {
                                  	double t_0 = 2.0 / (r * r);
                                  	double tmp;
                                  	if (((3.0 + t_0) - (((((w * w) * r) * r) * ((3.0 - (v * 2.0)) * 0.125)) / (1.0 - v))) <= -1e+45) {
                                  		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 (((3.0d0 + t_0) - (((((w * w) * r) * r) * ((3.0d0 - (v * 2.0d0)) * 0.125d0)) / (1.0d0 - v))) <= (-1d+45)) then
                                          tmp = (((-0.375d0) * (r * r)) * w) * w
                                      else
                                          tmp = t_0 - 1.5d0
                                      end if
                                      code = tmp
                                  end function
                                  
                                  public static double code(double v, double w, double r) {
                                  	double t_0 = 2.0 / (r * r);
                                  	double tmp;
                                  	if (((3.0 + t_0) - (((((w * w) * r) * r) * ((3.0 - (v * 2.0)) * 0.125)) / (1.0 - v))) <= -1e+45) {
                                  		tmp = ((-0.375 * (r * r)) * w) * w;
                                  	} else {
                                  		tmp = t_0 - 1.5;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  def code(v, w, r):
                                  	t_0 = 2.0 / (r * r)
                                  	tmp = 0
                                  	if ((3.0 + t_0) - (((((w * w) * r) * r) * ((3.0 - (v * 2.0)) * 0.125)) / (1.0 - v))) <= -1e+45:
                                  		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(3.0 + t_0) - Float64(Float64(Float64(Float64(Float64(w * w) * r) * r) * Float64(Float64(3.0 - Float64(v * 2.0)) * 0.125)) / Float64(1.0 - v))) <= -1e+45)
                                  		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 (((3.0 + t_0) - (((((w * w) * r) * r) * ((3.0 - (v * 2.0)) * 0.125)) / (1.0 - v))) <= -1e+45)
                                  		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[(3.0 + t$95$0), $MachinePrecision] - N[(N[(N[(N[(N[(w * w), $MachinePrecision] * r), $MachinePrecision] * r), $MachinePrecision] * N[(N[(3.0 - N[(v * 2.0), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e+45], 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(3 + t\_0\right) - \frac{\left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right) \cdot \left(\left(3 - v \cdot 2\right) \cdot 0.125\right)}{1 - v} \leq -1 \cdot 10^{+45}:\\
                                  \;\;\;\;\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))) < -9.9999999999999993e44

                                    1. Initial program 82.1%

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

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

                                        \[\leadsto \color{blue}{2 \cdot \frac{1}{{r}^{2}} + \left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{3}{8} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right)} \]
                                      2. +-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.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. 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 rewrites77.6%

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

                                      if -9.9999999999999993e44 < (-.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.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 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.9

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

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

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right) \cdot \left(\left(3 - v \cdot 2\right) \cdot 0.125\right)}{1 - v} \leq -1 \cdot 10^{+45}:\\ \;\;\;\;\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 8: 87.6% accurate, 0.8× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2}{r \cdot r}\\ \mathbf{if}\;\left(3 + t\_0\right) - \frac{\left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right) \cdot \left(\left(3 - v \cdot 2\right) \cdot 0.125\right)}{1 - v} \leq -1 \cdot 10^{+45}:\\ \;\;\;\;\left(\left(-0.25 \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 (<=
                                            (-
                                             (+ 3.0 t_0)
                                             (/ (* (* (* (* w w) r) r) (* (- 3.0 (* v 2.0)) 0.125)) (- 1.0 v)))
                                            -1e+45)
                                         (* (* (* -0.25 (* r r)) w) w)
                                         (- t_0 1.5))))
                                    double code(double v, double w, double r) {
                                    	double t_0 = 2.0 / (r * r);
                                    	double tmp;
                                    	if (((3.0 + t_0) - (((((w * w) * r) * r) * ((3.0 - (v * 2.0)) * 0.125)) / (1.0 - v))) <= -1e+45) {
                                    		tmp = ((-0.25 * (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 (((3.0d0 + t_0) - (((((w * w) * r) * r) * ((3.0d0 - (v * 2.0d0)) * 0.125d0)) / (1.0d0 - v))) <= (-1d+45)) then
                                            tmp = (((-0.25d0) * (r * r)) * w) * w
                                        else
                                            tmp = t_0 - 1.5d0
                                        end if
                                        code = tmp
                                    end function
                                    
                                    public static double code(double v, double w, double r) {
                                    	double t_0 = 2.0 / (r * r);
                                    	double tmp;
                                    	if (((3.0 + t_0) - (((((w * w) * r) * r) * ((3.0 - (v * 2.0)) * 0.125)) / (1.0 - v))) <= -1e+45) {
                                    		tmp = ((-0.25 * (r * r)) * w) * w;
                                    	} else {
                                    		tmp = t_0 - 1.5;
                                    	}
                                    	return tmp;
                                    }
                                    
                                    def code(v, w, r):
                                    	t_0 = 2.0 / (r * r)
                                    	tmp = 0
                                    	if ((3.0 + t_0) - (((((w * w) * r) * r) * ((3.0 - (v * 2.0)) * 0.125)) / (1.0 - v))) <= -1e+45:
                                    		tmp = ((-0.25 * (r * r)) * w) * w
                                    	else:
                                    		tmp = t_0 - 1.5
                                    	return tmp
                                    
                                    function code(v, w, r)
                                    	t_0 = Float64(2.0 / Float64(r * r))
                                    	tmp = 0.0
                                    	if (Float64(Float64(3.0 + t_0) - Float64(Float64(Float64(Float64(Float64(w * w) * r) * r) * Float64(Float64(3.0 - Float64(v * 2.0)) * 0.125)) / Float64(1.0 - v))) <= -1e+45)
                                    		tmp = Float64(Float64(Float64(-0.25 * 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 (((3.0 + t_0) - (((((w * w) * r) * r) * ((3.0 - (v * 2.0)) * 0.125)) / (1.0 - v))) <= -1e+45)
                                    		tmp = ((-0.25 * (r * r)) * w) * w;
                                    	else
                                    		tmp = t_0 - 1.5;
                                    	end
                                    	tmp_2 = tmp;
                                    end
                                    
                                    code[v_, w_, r_] := Block[{t$95$0 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(3.0 + t$95$0), $MachinePrecision] - N[(N[(N[(N[(N[(w * w), $MachinePrecision] * r), $MachinePrecision] * r), $MachinePrecision] * N[(N[(3.0 - N[(v * 2.0), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e+45], N[(N[(N[(-0.25 * 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(3 + t\_0\right) - \frac{\left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right) \cdot \left(\left(3 - v \cdot 2\right) \cdot 0.125\right)}{1 - v} \leq -1 \cdot 10^{+45}:\\
                                    \;\;\;\;\left(\left(-0.25 \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))) < -9.9999999999999993e44

                                      1. Initial program 82.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-*.f646.8

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        if -9.9999999999999993e44 < (-.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.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 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.9

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

                                          \[\leadsto \color{blue}{\frac{2}{r \cdot r} - 1.5} \]
                                      11. Recombined 2 regimes into one program.
                                      12. Final simplification86.1%

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

                                      Alternative 9: 92.3% accurate, 1.0× speedup?

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

                                        1. Initial program 79.1%

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

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

                                            \[\leadsto \color{blue}{2 \cdot \frac{1}{{r}^{2}} + \left(\mathsf{neg}\left(\left(\frac{3}{2} + \frac{3}{8} \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right)\right)} \]
                                          2. +-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.1%

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

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

                                          if 3.50000000000000005e-65 < r

                                          1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        Alternative 10: 96.0% accurate, 1.4× speedup?

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

                                          1. Initial program 82.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \frac{2}{r \cdot r} + \left(\color{blue}{\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot {w}^{2}} + \left(\mathsf{neg}\left(\frac{3}{2}\right)\right)\right) \]
                                            7. 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)} + \left(\mathsf{neg}\left(\frac{3}{2}\right)\right)\right) \]
                                            8. 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} + \left(\mathsf{neg}\left(\frac{3}{2}\right)\right)\right) \]
                                            9. metadata-evalN/A

                                              \[\leadsto \frac{2}{r \cdot r} + \left(\left(\left(\frac{-1}{4} \cdot {r}^{2}\right) \cdot w\right) \cdot w + \color{blue}{\frac{-3}{2}}\right) \]
                                            10. 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)} \]
                                            11. 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) \]
                                            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. 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) \]
                                            14. lower-*.f6490.9

                                              \[\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) \]
                                          7. Applied rewrites90.9%

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

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

                                            if -3.5000000000000001e55 < v < 4.99999999999999962e-25

                                            1. Initial program 83.8%

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

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

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \frac{2}{r \cdot r} + \color{blue}{-1.5} \]
                                              2. Taylor expanded in v around 0

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

                                                  \[\leadsto \frac{2}{r \cdot r} + \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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              Alternative 11: 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 83.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 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-*.f6455.0

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

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

                                              Alternative 12: 44.3% accurate, 4.3× speedup?

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

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

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

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

                                              Reproduce

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