Rosa's TurbineBenchmark

Percentage Accurate: 85.3% → 97.7%
Time: 15.3s
Alternatives: 16
Speedup: 1.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 85.3% accurate, 1.0× speedup?

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

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

Alternative 1: 97.7% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left(t\_1 + \frac{t\_2 \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)}{v + -1}\right) - 4.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))) < -inf.0

    1. Initial program 77.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 inf

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\left({r}^{2}\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\left(r \cdot r\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\left({w}^{2}\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\left(w \cdot w\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
      8. *-lowering-*.f6485.4%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, w\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
    5. Simplified85.4%

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\left(r \cdot \left(r \cdot w\right)\right), \left(w \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, \left(r \cdot w\right)\right), \left(w \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, \mathsf{*.f64}\left(r, w\right)\right), \left(w \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
      7. *-lowering-*.f6498.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, \mathsf{*.f64}\left(r, w\right)\right), \mathsf{*.f64}\left(w, \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
    7. Applied egg-rr98.8%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(2, \left({r}^{2}\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, \mathsf{*.f64}\left(r, w\right)\right), \mathsf{*.f64}\left(w, \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(2, \left(r \cdot r\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, \mathsf{*.f64}\left(r, w\right)\right), \mathsf{*.f64}\left(w, \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
      3. *-lowering-*.f6498.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, \mathsf{*.f64}\left(r, w\right)\right), \mathsf{*.f64}\left(w, \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
    10. Simplified98.8%

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

    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. Initial program 85.6%

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{8}, \mathsf{\_.f64}\left(3, \mathsf{*.f64}\left(2, v\right)\right)\right), \left(\left(w \cdot w\right) \cdot \left(r \cdot r\right)\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
      2. unswap-sqrN/A

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{8}, \mathsf{\_.f64}\left(3, \mathsf{*.f64}\left(2, v\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, w\right), \left(r \cdot w\right)\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
      7. *-lowering-*.f6499.2%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{8}, \mathsf{\_.f64}\left(3, \mathsf{*.f64}\left(2, v\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, w\right), \mathsf{*.f64}\left(r, w\right)\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
    4. Applied egg-rr99.2%

      \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \color{blue}{\left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)}}{1 - v}\right) - 4.5 \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.1%

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

Alternative 2: 97.4% accurate, 1.1× speedup?

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

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

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

      \[\leadsto \left(3 + \frac{2}{r \cdot r}\right) - \color{blue}{\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)} \]
    2. --lowering--.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\left(3 + \frac{2}{r \cdot r}\right), \color{blue}{\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) \]
    3. +-lowering-+.f64N/A

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \left(r \cdot r\right)\right)\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)}{\color{blue}{1 - v}} + \frac{9}{2}\right)\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\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 - \color{blue}{v}} + \frac{9}{2}\right)\right) \]
    6. associate-*r*N/A

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \left(\frac{\left(\frac{1}{8} \cdot \left(v \cdot -2 + 3\right)\right) \cdot \left(\left(r \cdot r\right) \cdot \left(w \cdot w\right)\right)}{1 - v} + \frac{9}{2}\right)\right) \]
    6. swap-sqrN/A

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

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

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \left(\frac{\left(\frac{1}{8} \cdot \left(3 + \left(\mathsf{neg}\left(2\right)\right) \cdot v\right)\right) \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)}{1 - v} + \frac{9}{2}\right)\right) \]
    10. cancel-sign-sub-invN/A

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

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \left(\left(\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(r \cdot w\right)\right) \cdot \frac{r \cdot w}{1 - v} + \frac{9}{2}\right)\right) \]
  6. Applied egg-rr97.1%

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

Alternative 3: 91.1% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;r \leq 460000:\\ \;\;\;\;-1.5 + \mathsf{fma}\left(w \cdot \left(\left(r \cdot r\right) \cdot -0.25\right), w, \frac{2}{r \cdot r}\right)\\ \mathbf{elif}\;r \leq 10^{+147}:\\ \;\;\;\;\mathsf{fma}\left(\left(w \cdot \mathsf{fma}\left(-0.25, v, 0.375\right)\right) \cdot \left(0 - w\right), \frac{r \cdot r}{1 - v}, -1.5\right)\\ \mathbf{else}:\\ \;\;\;\;\left(3 - \left(r \cdot w\right) \cdot \left(r \cdot \left(w \cdot 0.25\right)\right)\right) - 4.5\\ \end{array} \end{array} \]
(FPCore (v w r)
 :precision binary64
 (if (<= r 460000.0)
   (+ -1.5 (fma (* w (* (* r r) -0.25)) w (/ 2.0 (* r r))))
   (if (<= r 1e+147)
     (fma (* (* w (fma -0.25 v 0.375)) (- 0.0 w)) (/ (* r r) (- 1.0 v)) -1.5)
     (- (- 3.0 (* (* r w) (* r (* w 0.25)))) 4.5))))
double code(double v, double w, double r) {
	double tmp;
	if (r <= 460000.0) {
		tmp = -1.5 + fma((w * ((r * r) * -0.25)), w, (2.0 / (r * r)));
	} else if (r <= 1e+147) {
		tmp = fma(((w * fma(-0.25, v, 0.375)) * (0.0 - w)), ((r * r) / (1.0 - v)), -1.5);
	} else {
		tmp = (3.0 - ((r * w) * (r * (w * 0.25)))) - 4.5;
	}
	return tmp;
}
function code(v, w, r)
	tmp = 0.0
	if (r <= 460000.0)
		tmp = Float64(-1.5 + fma(Float64(w * Float64(Float64(r * r) * -0.25)), w, Float64(2.0 / Float64(r * r))));
	elseif (r <= 1e+147)
		tmp = fma(Float64(Float64(w * fma(-0.25, v, 0.375)) * Float64(0.0 - w)), Float64(Float64(r * r) / Float64(1.0 - v)), -1.5);
	else
		tmp = Float64(Float64(3.0 - Float64(Float64(r * w) * Float64(r * Float64(w * 0.25)))) - 4.5);
	end
	return tmp
end
code[v_, w_, r_] := If[LessEqual[r, 460000.0], N[(-1.5 + N[(N[(w * N[(N[(r * r), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision] * w + N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[r, 1e+147], N[(N[(N[(w * N[(-0.25 * v + 0.375), $MachinePrecision]), $MachinePrecision] * N[(0.0 - w), $MachinePrecision]), $MachinePrecision] * N[(N[(r * r), $MachinePrecision] / N[(1.0 - v), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision], N[(N[(3.0 - N[(N[(r * w), $MachinePrecision] * N[(r * N[(w * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;r \leq 460000:\\
\;\;\;\;-1.5 + \mathsf{fma}\left(w \cdot \left(\left(r \cdot r\right) \cdot -0.25\right), w, \frac{2}{r \cdot r}\right)\\

\mathbf{elif}\;r \leq 10^{+147}:\\
\;\;\;\;\mathsf{fma}\left(\left(w \cdot \mathsf{fma}\left(-0.25, v, 0.375\right)\right) \cdot \left(0 - w\right), \frac{r \cdot r}{1 - v}, -1.5\right)\\

\mathbf{else}:\\
\;\;\;\;\left(3 - \left(r \cdot w\right) \cdot \left(r \cdot \left(w \cdot 0.25\right)\right)\right) - 4.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if r < 4.6e5

    1. Initial program 81.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.6e5 < r < 9.9999999999999998e146

    1. Initial program 92.9%

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

        \[\leadsto \left(3 + \frac{2}{r \cdot r}\right) - \color{blue}{\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)} \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(3 + \frac{2}{r \cdot r}\right), \color{blue}{\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) \]
      3. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \left(r \cdot r\right)\right)\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)}{\color{blue}{1 - v}} + \frac{9}{2}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\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 - \color{blue}{v}} + \frac{9}{2}\right)\right) \]
      6. associate-*r*N/A

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{fma.f64}\left(\left(\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(w \cdot w\right) \cdot r\right)\right), \color{blue}{\left(\frac{r}{1 - v}\right)}, \frac{9}{2}\right)\right) \]
    4. Applied egg-rr85.5%

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \left(\frac{\left(\frac{1}{8} \cdot \left(v \cdot -2 + 3\right)\right) \cdot \left(\left(r \cdot r\right) \cdot \left(w \cdot w\right)\right)}{1 - v} + \frac{9}{2}\right)\right) \]
      6. swap-sqrN/A

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \left(\frac{\left(\frac{1}{8} \cdot \left(3 + \left(\mathsf{neg}\left(2\right)\right) \cdot v\right)\right) \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)}{1 - v} + \frac{9}{2}\right)\right) \]
      10. cancel-sign-sub-invN/A

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \left(\left(\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(r \cdot w\right)\right) \cdot \frac{r \cdot w}{1 - v} + \frac{9}{2}\right)\right) \]
    6. Applied egg-rr99.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999998e146 < r

    1. Initial program 83.4%

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\left({r}^{2}\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\left(r \cdot r\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\left({w}^{2}\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\left(w \cdot w\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
      8. *-lowering-*.f6461.4%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, w\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
    5. Simplified61.4%

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\color{blue}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, w\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
    7. Step-by-step derivation
      1. Simplified61.4%

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

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

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

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

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

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(3, \left(\left(\left(w \cdot \frac{1}{4}\right) \cdot r\right) \cdot \left(r \cdot w\right)\right)\right), \frac{9}{2}\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(3, \mathsf{*.f64}\left(\left(\left(w \cdot \frac{1}{4}\right) \cdot r\right), \left(r \cdot w\right)\right)\right), \frac{9}{2}\right) \]
        7. *-lowering-*.f64N/A

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

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(3, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(w, \frac{1}{4}\right), r\right), \left(r \cdot w\right)\right)\right), \frac{9}{2}\right) \]
        9. *-lowering-*.f6485.6%

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(3, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(w, \frac{1}{4}\right), r\right), \mathsf{*.f64}\left(r, w\right)\right)\right), \frac{9}{2}\right) \]
      3. Applied egg-rr85.6%

        \[\leadsto \left(3 - \color{blue}{\left(\left(w \cdot 0.25\right) \cdot r\right) \cdot \left(r \cdot w\right)}\right) - 4.5 \]
    8. Recombined 3 regimes into one program.
    9. Final simplification89.3%

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

    Alternative 4: 90.0% accurate, 1.4× speedup?

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

      1. Initial program 81.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 7.5999999999999996 < r < 1.65e81

      1. Initial program 88.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. associate-*l*N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{8}, \mathsf{\_.f64}\left(3, \mathsf{*.f64}\left(2, v\right)\right)\right), \left(\left(w \cdot w\right) \cdot \left(r \cdot r\right)\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
        2. unswap-sqrN/A

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

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

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

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

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{8}, \mathsf{\_.f64}\left(3, \mathsf{*.f64}\left(2, v\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, w\right), \left(r \cdot w\right)\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
        7. *-lowering-*.f6488.9%

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{8}, \mathsf{\_.f64}\left(3, \mathsf{*.f64}\left(2, v\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, w\right), \mathsf{*.f64}\left(r, w\right)\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
      4. Applied egg-rr88.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(r, \mathsf{*.f64}\left(r, \left({w}^{2}\right)\right)\right), \frac{-3}{8}, \frac{-3}{2}\right)\right) \]
        19. unpow2N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(r, \mathsf{*.f64}\left(r, \left(w \cdot w\right)\right)\right), \frac{-3}{8}, \frac{-3}{2}\right)\right) \]
        20. *-lowering-*.f6486.0%

          \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(r, \mathsf{*.f64}\left(r, \mathsf{*.f64}\left(w, w\right)\right)\right), \frac{-3}{8}, \frac{-3}{2}\right)\right) \]
      7. Simplified86.0%

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

      if 1.65e81 < r

      1. Initial program 88.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 inf

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

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

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

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\left({r}^{2}\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
        4. unpow2N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\left(r \cdot r\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\left({w}^{2}\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
        7. unpow2N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\left(w \cdot w\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
        8. *-lowering-*.f6470.9%

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, w\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
      5. Simplified70.9%

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\color{blue}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, w\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
      7. Step-by-step derivation
        1. Simplified70.9%

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

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

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

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

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

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(3, \left(\left(\left(w \cdot \frac{1}{4}\right) \cdot r\right) \cdot \left(r \cdot w\right)\right)\right), \frac{9}{2}\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(3, \mathsf{*.f64}\left(\left(\left(w \cdot \frac{1}{4}\right) \cdot r\right), \left(r \cdot w\right)\right)\right), \frac{9}{2}\right) \]
          7. *-lowering-*.f64N/A

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

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(3, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(w, \frac{1}{4}\right), r\right), \left(r \cdot w\right)\right)\right), \frac{9}{2}\right) \]
          9. *-lowering-*.f6488.2%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(3, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(w, \frac{1}{4}\right), r\right), \mathsf{*.f64}\left(r, w\right)\right)\right), \frac{9}{2}\right) \]
        3. Applied egg-rr88.2%

          \[\leadsto \left(3 - \color{blue}{\left(\left(w \cdot 0.25\right) \cdot r\right) \cdot \left(r \cdot w\right)}\right) - 4.5 \]
      8. Recombined 3 regimes into one program.
      9. Final simplification88.6%

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

      Alternative 5: 92.1% accurate, 1.4× speedup?

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

        1. Initial program 81.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1100 < r

        1. Initial program 88.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. associate--l-N/A

            \[\leadsto \left(3 + \frac{2}{r \cdot r}\right) - \color{blue}{\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)} \]
          2. --lowering--.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\left(3 + \frac{2}{r \cdot r}\right), \color{blue}{\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) \]
          3. +-lowering-+.f64N/A

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

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \left(r \cdot r\right)\right)\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)}{\color{blue}{1 - v}} + \frac{9}{2}\right)\right) \]
          5. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\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 - \color{blue}{v}} + \frac{9}{2}\right)\right) \]
          6. associate-*r*N/A

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \left(\frac{\left(\frac{1}{8} \cdot \left(v \cdot -2 + 3\right)\right) \cdot \left(\left(r \cdot r\right) \cdot \left(w \cdot w\right)\right)}{1 - v} + \frac{9}{2}\right)\right) \]
          6. swap-sqrN/A

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

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

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

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \left(\frac{\left(\frac{1}{8} \cdot \left(3 + \left(\mathsf{neg}\left(2\right)\right) \cdot v\right)\right) \cdot \left(\left(r \cdot w\right) \cdot \left(r \cdot w\right)\right)}{1 - v} + \frac{9}{2}\right)\right) \]
          10. cancel-sign-sub-invN/A

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

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

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \left(\left(\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(r \cdot w\right)\right) \cdot \frac{r \cdot w}{1 - v} + \frac{9}{2}\right)\right) \]
        6. Applied egg-rr99.6%

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

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

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

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

        Alternative 6: 90.0% accurate, 1.6× speedup?

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

          1. Initial program 81.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 0.75 < r

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

              \[\leadsto \mathsf{\_.f64}\left(\left(\left(\frac{2}{r \cdot r} + 3\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}\right) \]
            2. associate--l+N/A

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

              \[\leadsto \mathsf{\_.f64}\left(\left(\frac{\frac{2}{r}}{r} + \left(3 - \frac{\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right)\right), \frac{9}{2}\right) \]
            4. div-invN/A

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

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

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

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

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{\_.f64}\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}\right)\right)\right), \frac{9}{2}\right) \]
            9. /-lowering-/.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{\_.f64}\left(3, \mathsf{/.f64}\left(\left(\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)\right), \left(1 - v\right)\right)\right)\right), \frac{9}{2}\right) \]
          4. Applied egg-rr77.3%

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

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

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \left(3 + \left(\mathsf{neg}\left(\frac{3}{8}\right)\right) \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right), \frac{9}{2}\right) \]
            2. +-commutativeN/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \left(\left(\mathsf{neg}\left(\frac{3}{8}\right)\right) \cdot \left({r}^{2} \cdot {w}^{2}\right) + 3\right)\right), \frac{9}{2}\right) \]
            3. distribute-lft-neg-inN/A

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

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

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \left(\left(\mathsf{neg}\left({w}^{2} \cdot \left(\frac{3}{8} \cdot {r}^{2}\right)\right)\right) + 3\right)\right), \frac{9}{2}\right) \]
            6. distribute-rgt-neg-inN/A

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

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

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

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

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

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(w, w\right), \left(\frac{-3}{8} \cdot {r}^{2}\right), 3\right)\right), \frac{9}{2}\right) \]
            12. metadata-evalN/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(w, w\right), \left(\left(\mathsf{neg}\left(\frac{3}{8}\right)\right) \cdot {r}^{2}\right), 3\right)\right), \frac{9}{2}\right) \]
            13. distribute-lft-neg-inN/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(w, w\right), \left(\mathsf{neg}\left(\frac{3}{8} \cdot {r}^{2}\right)\right), 3\right)\right), \frac{9}{2}\right) \]
            14. *-commutativeN/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(w, w\right), \left(\mathsf{neg}\left({r}^{2} \cdot \frac{3}{8}\right)\right), 3\right)\right), \frac{9}{2}\right) \]
            15. distribute-rgt-neg-inN/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(w, w\right), \left({r}^{2} \cdot \left(\mathsf{neg}\left(\frac{3}{8}\right)\right)\right), 3\right)\right), \frac{9}{2}\right) \]
            16. metadata-evalN/A

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

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(w, w\right), \mathsf{*.f64}\left(\left({r}^{2}\right), \frac{-3}{8}\right), 3\right)\right), \frac{9}{2}\right) \]
            18. unpow2N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(w, w\right), \mathsf{*.f64}\left(\left(r \cdot r\right), \frac{-3}{8}\right), 3\right)\right), \frac{9}{2}\right) \]
            19. *-lowering-*.f6470.7%

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(w, w\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \frac{-3}{8}\right), 3\right)\right), \frac{9}{2}\right) \]
          7. Simplified70.7%

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

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

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

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

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

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

              \[\leadsto \mathsf{+.f64}\left(\left(\frac{2}{r \cdot r} + \left(w \cdot w\right) \cdot \left(\left(r \cdot r\right) \cdot \frac{-3}{8}\right)\right), \color{blue}{\frac{-3}{2}}\right) \]
          9. Applied egg-rr79.8%

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(r, \mathsf{*.f64}\left(\frac{-3}{8}, w\right)\right), \mathsf{*.f64}\left(r, w\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(2, \left(r \cdot r\right)\right), \frac{-3}{2}\right)\right) \]
            13. *-lowering-*.f6486.0%

              \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(r, \mathsf{*.f64}\left(\frac{-3}{8}, w\right)\right), \mathsf{*.f64}\left(r, w\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right), \frac{-3}{2}\right)\right) \]
          11. Applied egg-rr86.0%

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

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

        Alternative 7: 90.0% accurate, 1.6× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{2}{r \cdot r}\\ \mathbf{if}\;r \leq 0.41:\\ \;\;\;\;-1.5 + \mathsf{fma}\left(w \cdot \left(\left(r \cdot r\right) \cdot -0.25\right), w, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;-1.5 + \mathsf{fma}\left(r, w \cdot \left(r \cdot \left(w \cdot -0.375\right)\right), t\_0\right)\\ \end{array} \end{array} \]
        (FPCore (v w r)
         :precision binary64
         (let* ((t_0 (/ 2.0 (* r r))))
           (if (<= r 0.41)
             (+ -1.5 (fma (* w (* (* r r) -0.25)) w t_0))
             (+ -1.5 (fma r (* w (* r (* w -0.375))) t_0)))))
        double code(double v, double w, double r) {
        	double t_0 = 2.0 / (r * r);
        	double tmp;
        	if (r <= 0.41) {
        		tmp = -1.5 + fma((w * ((r * r) * -0.25)), w, t_0);
        	} else {
        		tmp = -1.5 + fma(r, (w * (r * (w * -0.375))), t_0);
        	}
        	return tmp;
        }
        
        function code(v, w, r)
        	t_0 = Float64(2.0 / Float64(r * r))
        	tmp = 0.0
        	if (r <= 0.41)
        		tmp = Float64(-1.5 + fma(Float64(w * Float64(Float64(r * r) * -0.25)), w, t_0));
        	else
        		tmp = Float64(-1.5 + fma(r, Float64(w * Float64(r * Float64(w * -0.375))), 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, 0.41], N[(-1.5 + N[(N[(w * N[(N[(r * r), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision] * w + t$95$0), $MachinePrecision]), $MachinePrecision], N[(-1.5 + N[(r * N[(w * N[(r * N[(w * -0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \frac{2}{r \cdot r}\\
        \mathbf{if}\;r \leq 0.41:\\
        \;\;\;\;-1.5 + \mathsf{fma}\left(w \cdot \left(\left(r \cdot r\right) \cdot -0.25\right), w, t\_0\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;-1.5 + \mathsf{fma}\left(r, w \cdot \left(r \cdot \left(w \cdot -0.375\right)\right), t\_0\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if r < 0.409999999999999976

          1. Initial program 81.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 0.409999999999999976 < r

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

              \[\leadsto \mathsf{\_.f64}\left(\left(\left(\frac{2}{r \cdot r} + 3\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}\right) \]
            2. associate--l+N/A

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

              \[\leadsto \mathsf{\_.f64}\left(\left(\frac{\frac{2}{r}}{r} + \left(3 - \frac{\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right)\right), \frac{9}{2}\right) \]
            4. div-invN/A

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

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

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

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

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{\_.f64}\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}\right)\right)\right), \frac{9}{2}\right) \]
            9. /-lowering-/.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{\_.f64}\left(3, \mathsf{/.f64}\left(\left(\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)\right), \left(1 - v\right)\right)\right)\right), \frac{9}{2}\right) \]
          4. Applied egg-rr77.3%

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

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

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \left(3 + \left(\mathsf{neg}\left(\frac{3}{8}\right)\right) \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right), \frac{9}{2}\right) \]
            2. +-commutativeN/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \left(\left(\mathsf{neg}\left(\frac{3}{8}\right)\right) \cdot \left({r}^{2} \cdot {w}^{2}\right) + 3\right)\right), \frac{9}{2}\right) \]
            3. distribute-lft-neg-inN/A

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

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

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \left(\left(\mathsf{neg}\left({w}^{2} \cdot \left(\frac{3}{8} \cdot {r}^{2}\right)\right)\right) + 3\right)\right), \frac{9}{2}\right) \]
            6. distribute-rgt-neg-inN/A

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

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

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

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

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

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(w, w\right), \left(\frac{-3}{8} \cdot {r}^{2}\right), 3\right)\right), \frac{9}{2}\right) \]
            12. metadata-evalN/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(w, w\right), \left(\left(\mathsf{neg}\left(\frac{3}{8}\right)\right) \cdot {r}^{2}\right), 3\right)\right), \frac{9}{2}\right) \]
            13. distribute-lft-neg-inN/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(w, w\right), \left(\mathsf{neg}\left(\frac{3}{8} \cdot {r}^{2}\right)\right), 3\right)\right), \frac{9}{2}\right) \]
            14. *-commutativeN/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(w, w\right), \left(\mathsf{neg}\left({r}^{2} \cdot \frac{3}{8}\right)\right), 3\right)\right), \frac{9}{2}\right) \]
            15. distribute-rgt-neg-inN/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(w, w\right), \left({r}^{2} \cdot \left(\mathsf{neg}\left(\frac{3}{8}\right)\right)\right), 3\right)\right), \frac{9}{2}\right) \]
            16. metadata-evalN/A

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

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(w, w\right), \mathsf{*.f64}\left(\left({r}^{2}\right), \frac{-3}{8}\right), 3\right)\right), \frac{9}{2}\right) \]
            18. unpow2N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(w, w\right), \mathsf{*.f64}\left(\left(r \cdot r\right), \frac{-3}{8}\right), 3\right)\right), \frac{9}{2}\right) \]
            19. *-lowering-*.f6470.7%

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(w, w\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \frac{-3}{8}\right), 3\right)\right), \frac{9}{2}\right) \]
          7. Simplified70.7%

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

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

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

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

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

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

              \[\leadsto \mathsf{+.f64}\left(\left(\frac{2}{r \cdot r} + \left(w \cdot w\right) \cdot \left(\left(r \cdot r\right) \cdot \frac{-3}{8}\right)\right), \color{blue}{\frac{-3}{2}}\right) \]
          9. Applied egg-rr79.8%

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

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

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

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

              \[\leadsto \mathsf{+.f64}\left(\mathsf{fma.f64}\left(r, \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, \left(\frac{-3}{8} \cdot w\right)\right), w\right), \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \frac{-3}{2}\right) \]
            5. *-lowering-*.f6486.0%

              \[\leadsto \mathsf{+.f64}\left(\mathsf{fma.f64}\left(r, \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, \mathsf{*.f64}\left(\frac{-3}{8}, w\right)\right), w\right), \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \frac{-3}{2}\right) \]
          11. Applied egg-rr86.0%

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

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

        Alternative 8: 89.9% accurate, 1.6× speedup?

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

          1. Initial program 81.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 4.6e5 < r < 3.7000000000000001e81

          1. Initial program 88.2%

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

              \[\leadsto \mathsf{\_.f64}\left(\left(\left(\frac{2}{r \cdot r} + 3\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}\right) \]
            2. associate--l+N/A

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

              \[\leadsto \mathsf{\_.f64}\left(\left(\frac{\frac{2}{r}}{r} + \left(3 - \frac{\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right)\right), \frac{9}{2}\right) \]
            4. div-invN/A

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

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

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

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

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{\_.f64}\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}\right)\right)\right), \frac{9}{2}\right) \]
            9. /-lowering-/.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{\_.f64}\left(3, \mathsf{/.f64}\left(\left(\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)\right), \left(1 - v\right)\right)\right)\right), \frac{9}{2}\right) \]
          4. Applied egg-rr88.2%

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

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

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \left(3 + \left(\mathsf{neg}\left(\frac{3}{8}\right)\right) \cdot \left({r}^{2} \cdot {w}^{2}\right)\right)\right), \frac{9}{2}\right) \]
            2. +-commutativeN/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \left(\left(\mathsf{neg}\left(\frac{3}{8}\right)\right) \cdot \left({r}^{2} \cdot {w}^{2}\right) + 3\right)\right), \frac{9}{2}\right) \]
            3. distribute-lft-neg-inN/A

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

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

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \left(\left(\mathsf{neg}\left({w}^{2} \cdot \left(\frac{3}{8} \cdot {r}^{2}\right)\right)\right) + 3\right)\right), \frac{9}{2}\right) \]
            6. distribute-rgt-neg-inN/A

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

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

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

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

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

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(w, w\right), \left(\frac{-3}{8} \cdot {r}^{2}\right), 3\right)\right), \frac{9}{2}\right) \]
            12. metadata-evalN/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(w, w\right), \left(\left(\mathsf{neg}\left(\frac{3}{8}\right)\right) \cdot {r}^{2}\right), 3\right)\right), \frac{9}{2}\right) \]
            13. distribute-lft-neg-inN/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(w, w\right), \left(\mathsf{neg}\left(\frac{3}{8} \cdot {r}^{2}\right)\right), 3\right)\right), \frac{9}{2}\right) \]
            14. *-commutativeN/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(w, w\right), \left(\mathsf{neg}\left({r}^{2} \cdot \frac{3}{8}\right)\right), 3\right)\right), \frac{9}{2}\right) \]
            15. distribute-rgt-neg-inN/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(w, w\right), \left({r}^{2} \cdot \left(\mathsf{neg}\left(\frac{3}{8}\right)\right)\right), 3\right)\right), \frac{9}{2}\right) \]
            16. metadata-evalN/A

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

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(w, w\right), \mathsf{*.f64}\left(\left({r}^{2}\right), \frac{-3}{8}\right), 3\right)\right), \frac{9}{2}\right) \]
            18. unpow2N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(w, w\right), \mathsf{*.f64}\left(\left(r \cdot r\right), \frac{-3}{8}\right), 3\right)\right), \frac{9}{2}\right) \]
            19. *-lowering-*.f6485.0%

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(2, r\right), \mathsf{/.f64}\left(1, r\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(w, w\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \frac{-3}{8}\right), 3\right)\right), \frac{9}{2}\right) \]
          7. Simplified85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\left(w \cdot w\right), \frac{-3}{8}\right), \frac{-3}{2}\right) \]
            15. *-lowering-*.f6485.0%

              \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, w\right), \frac{-3}{8}\right), \frac{-3}{2}\right) \]
          10. Simplified85.0%

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

          if 3.7000000000000001e81 < r

          1. Initial program 88.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 inf

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

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

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

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\left({r}^{2}\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
            4. unpow2N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\left(r \cdot r\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
            5. *-lowering-*.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
            6. *-lowering-*.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\left({w}^{2}\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
            7. unpow2N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\left(w \cdot w\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
            8. *-lowering-*.f6470.9%

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, w\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
          5. Simplified70.9%

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

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\color{blue}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, w\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
          7. Step-by-step derivation
            1. Simplified70.9%

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

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

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

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

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

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(3, \left(\left(\left(w \cdot \frac{1}{4}\right) \cdot r\right) \cdot \left(r \cdot w\right)\right)\right), \frac{9}{2}\right) \]
              6. *-lowering-*.f64N/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(3, \mathsf{*.f64}\left(\left(\left(w \cdot \frac{1}{4}\right) \cdot r\right), \left(r \cdot w\right)\right)\right), \frac{9}{2}\right) \]
              7. *-lowering-*.f64N/A

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

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(3, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(w, \frac{1}{4}\right), r\right), \left(r \cdot w\right)\right)\right), \frac{9}{2}\right) \]
              9. *-lowering-*.f6488.2%

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(3, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(w, \frac{1}{4}\right), r\right), \mathsf{*.f64}\left(r, w\right)\right)\right), \frac{9}{2}\right) \]
            3. Applied egg-rr88.2%

              \[\leadsto \left(3 - \color{blue}{\left(\left(w \cdot 0.25\right) \cdot r\right) \cdot \left(r \cdot w\right)}\right) - 4.5 \]
          8. Recombined 3 regimes into one program.
          9. Final simplification88.6%

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

          Alternative 9: 65.1% accurate, 2.2× speedup?

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

            1. Initial program 81.8%

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

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

                \[\leadsto \mathsf{/.f64}\left(2, \color{blue}{\left({r}^{2}\right)}\right) \]
              2. unpow2N/A

                \[\leadsto \mathsf{/.f64}\left(2, \left(r \cdot \color{blue}{r}\right)\right) \]
              3. *-lowering-*.f6461.5%

                \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, \color{blue}{r}\right)\right) \]
            5. Simplified61.5%

              \[\leadsto \color{blue}{\frac{2}{r \cdot r}} \]
            6. Step-by-step derivation
              1. associate-/r*N/A

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

                \[\leadsto \mathsf{/.f64}\left(\left(\frac{2}{r}\right), \color{blue}{r}\right) \]
              3. /-lowering-/.f6461.5%

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(2, r\right), r\right) \]
            7. Applied egg-rr61.5%

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

            if 8.7999999999999994e-18 < r

            1. Initial program 87.1%

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

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

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

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

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\left({r}^{2}\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
              4. unpow2N/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\left(r \cdot r\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
              5. *-lowering-*.f64N/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
              6. *-lowering-*.f64N/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\left({w}^{2}\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
              7. unpow2N/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\left(w \cdot w\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
              8. *-lowering-*.f6474.9%

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, w\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
            5. Simplified74.9%

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

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\color{blue}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, w\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
            7. Step-by-step derivation
              1. Simplified72.0%

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

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

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

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

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

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(3, \left(\left(\left(w \cdot \frac{1}{4}\right) \cdot r\right) \cdot \left(r \cdot w\right)\right)\right), \frac{9}{2}\right) \]
                6. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(3, \mathsf{*.f64}\left(\left(\left(w \cdot \frac{1}{4}\right) \cdot r\right), \left(r \cdot w\right)\right)\right), \frac{9}{2}\right) \]
                7. *-lowering-*.f64N/A

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

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(3, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(w, \frac{1}{4}\right), r\right), \left(r \cdot w\right)\right)\right), \frac{9}{2}\right) \]
                9. *-lowering-*.f6483.6%

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(3, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(w, \frac{1}{4}\right), r\right), \mathsf{*.f64}\left(r, w\right)\right)\right), \frac{9}{2}\right) \]
              3. Applied egg-rr83.6%

                \[\leadsto \left(3 - \color{blue}{\left(\left(w \cdot 0.25\right) \cdot r\right) \cdot \left(r \cdot w\right)}\right) - 4.5 \]
            8. Recombined 2 regimes into one program.
            9. Final simplification66.5%

              \[\leadsto \begin{array}{l} \mathbf{if}\;r \leq 8.8 \cdot 10^{-18}:\\ \;\;\;\;\frac{\frac{2}{r}}{r}\\ \mathbf{else}:\\ \;\;\;\;\left(3 - \left(r \cdot w\right) \cdot \left(r \cdot \left(w \cdot 0.25\right)\right)\right) - 4.5\\ \end{array} \]
            10. Add Preprocessing

            Alternative 10: 64.1% accurate, 2.4× speedup?

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

              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. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(2, \color{blue}{\left({r}^{2}\right)}\right) \]
                2. unpow2N/A

                  \[\leadsto \mathsf{/.f64}\left(2, \left(r \cdot \color{blue}{r}\right)\right) \]
                3. *-lowering-*.f6461.6%

                  \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, \color{blue}{r}\right)\right) \]
              5. Simplified61.6%

                \[\leadsto \color{blue}{\frac{2}{r \cdot r}} \]
              6. Step-by-step derivation
                1. associate-/r*N/A

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

                  \[\leadsto \mathsf{/.f64}\left(\left(\frac{2}{r}\right), \color{blue}{r}\right) \]
                3. /-lowering-/.f6461.6%

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(2, r\right), r\right) \]
              7. Applied egg-rr61.6%

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

              if 1.95e-23 < r

              1. Initial program 85.9%

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

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

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

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

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\left({r}^{2}\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
                4. unpow2N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\left(r \cdot r\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
                5. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
                6. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\left({w}^{2}\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
                7. unpow2N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\left(w \cdot w\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
                8. *-lowering-*.f6475.7%

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, w\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
              5. Simplified75.7%

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

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\color{blue}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, w\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
              7. Step-by-step derivation
                1. Simplified71.3%

                  \[\leadsto \left(\color{blue}{3} - \left(r \cdot r\right) \cdot \left(\left(w \cdot w\right) \cdot 0.25\right)\right) - 4.5 \]
                2. Step-by-step derivation
                  1. --lowering--.f64N/A

                    \[\leadsto \mathsf{\_.f64}\left(\left(3 - \left(r \cdot r\right) \cdot \left(\left(w \cdot w\right) \cdot \frac{1}{4}\right)\right), \color{blue}{\frac{9}{2}}\right) \]
                3. Applied egg-rr82.1%

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

              Alternative 11: 63.9% accurate, 2.5× speedup?

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

                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. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(2, \color{blue}{\left({r}^{2}\right)}\right) \]
                  2. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(2, \left(r \cdot \color{blue}{r}\right)\right) \]
                  3. *-lowering-*.f6461.6%

                    \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, \color{blue}{r}\right)\right) \]
                5. Simplified61.6%

                  \[\leadsto \color{blue}{\frac{2}{r \cdot r}} \]
                6. Step-by-step derivation
                  1. associate-/r*N/A

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

                    \[\leadsto \mathsf{/.f64}\left(\left(\frac{2}{r}\right), \color{blue}{r}\right) \]
                  3. /-lowering-/.f6461.6%

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(2, r\right), r\right) \]
                7. Applied egg-rr61.6%

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

                if 1.7e-23 < r

                1. Initial program 85.9%

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

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

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

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

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\left({r}^{2}\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
                  4. unpow2N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\left(r \cdot r\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
                  5. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
                  6. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\left({w}^{2}\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
                  7. unpow2N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\left(w \cdot w\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
                  8. *-lowering-*.f6475.7%

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, w\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
                5. Simplified75.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 12: 63.9% accurate, 2.6× speedup?

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

                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. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(2, \color{blue}{\left({r}^{2}\right)}\right) \]
                  2. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(2, \left(r \cdot \color{blue}{r}\right)\right) \]
                  3. *-lowering-*.f6461.6%

                    \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, \color{blue}{r}\right)\right) \]
                5. Simplified61.6%

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

                if 2.3000000000000001e-23 < r

                1. Initial program 85.9%

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

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

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

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

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\left({r}^{2}\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
                  4. unpow2N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\left(r \cdot r\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
                  5. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
                  6. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\left({w}^{2}\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
                  7. unpow2N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\left(w \cdot w\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
                  8. *-lowering-*.f6475.7%

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, w\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
                5. Simplified75.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 13: 57.5% accurate, 2.7× speedup?

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

                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. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(2, \color{blue}{\left({r}^{2}\right)}\right) \]
                  2. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(2, \left(r \cdot \color{blue}{r}\right)\right) \]
                  3. *-lowering-*.f6461.6%

                    \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, \color{blue}{r}\right)\right) \]
                5. Simplified61.6%

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

                if 2.15000000000000001e-23 < r

                1. Initial program 85.9%

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

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

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

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

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\left({r}^{2}\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
                  4. unpow2N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\left(r \cdot r\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
                  5. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \left({w}^{2} \cdot \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
                  6. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\left({w}^{2}\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
                  7. unpow2N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\left(w \cdot w\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
                  8. *-lowering-*.f6475.7%

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(3, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, r\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, w\right), \frac{1}{4}\right)\right)\right), \frac{9}{2}\right) \]
                5. Simplified75.7%

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(r, \mathsf{*.f64}\left(r, \left(w \cdot \color{blue}{w}\right)\right)\right)\right) \]
                  7. *-lowering-*.f6459.6%

                    \[\leadsto \mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(r, \mathsf{*.f64}\left(r, \mathsf{*.f64}\left(w, \color{blue}{w}\right)\right)\right)\right) \]
                8. Simplified59.6%

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

              Alternative 14: 50.1% accurate, 3.2× speedup?

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

                1. Initial program 81.5%

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

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

                    \[\leadsto \mathsf{/.f64}\left(2, \color{blue}{\left({r}^{2}\right)}\right) \]
                  2. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(2, \left(r \cdot \color{blue}{r}\right)\right) \]
                  3. *-lowering-*.f6461.2%

                    \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, \color{blue}{r}\right)\right) \]
                5. Simplified61.2%

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

                if 0.0550000000000000003 < r

                1. Initial program 88.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. sub-negN/A

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

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

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

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

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

                    \[\leadsto \mathsf{+.f64}\left(\frac{-3}{2}, \left(\frac{2}{{\color{blue}{r}}^{2}}\right)\right) \]
                  7. /-lowering-/.f64N/A

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

                    \[\leadsto \mathsf{+.f64}\left(\frac{-3}{2}, \mathsf{/.f64}\left(2, \left(r \cdot \color{blue}{r}\right)\right)\right) \]
                  9. *-lowering-*.f6427.0%

                    \[\leadsto \mathsf{+.f64}\left(\frac{-3}{2}, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, \color{blue}{r}\right)\right)\right) \]
                5. Simplified27.0%

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

                  \[\leadsto \color{blue}{\frac{-3}{2}} \]
                7. Step-by-step derivation
                  1. Simplified25.7%

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

                Alternative 15: 56.6% 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.0%

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{+.f64}\left(\frac{-3}{2}, \left(\frac{2}{{\color{blue}{r}}^{2}}\right)\right) \]
                  7. /-lowering-/.f64N/A

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

                    \[\leadsto \mathsf{+.f64}\left(\frac{-3}{2}, \mathsf{/.f64}\left(2, \left(r \cdot \color{blue}{r}\right)\right)\right) \]
                  9. *-lowering-*.f6459.6%

                    \[\leadsto \mathsf{+.f64}\left(\frac{-3}{2}, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, \color{blue}{r}\right)\right)\right) \]
                5. Simplified59.6%

                  \[\leadsto \color{blue}{-1.5 + \frac{2}{r \cdot r}} \]
                6. Final simplification59.6%

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

                Alternative 16: 14.5% accurate, 73.0× speedup?

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{+.f64}\left(\frac{-3}{2}, \left(\frac{2}{{\color{blue}{r}}^{2}}\right)\right) \]
                  7. /-lowering-/.f64N/A

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

                    \[\leadsto \mathsf{+.f64}\left(\frac{-3}{2}, \mathsf{/.f64}\left(2, \left(r \cdot \color{blue}{r}\right)\right)\right) \]
                  9. *-lowering-*.f6459.6%

                    \[\leadsto \mathsf{+.f64}\left(\frac{-3}{2}, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, \color{blue}{r}\right)\right)\right) \]
                5. Simplified59.6%

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

                  \[\leadsto \color{blue}{\frac{-3}{2}} \]
                7. Step-by-step derivation
                  1. Simplified12.5%

                    \[\leadsto \color{blue}{-1.5} \]
                  2. Add Preprocessing

                  Reproduce

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