Rosa's TurbineBenchmark

Percentage Accurate: 84.9% → 98.5%
Time: 14.9s
Alternatives: 11
Speedup: 1.3×

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

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

Initial Program: 84.9% accurate, 1.0× speedup?

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

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

Alternative 1: 98.5% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{2}{r \cdot r}\\
\mathbf{if}\;v \leq -3.3 \cdot 10^{+143}:\\
\;\;\;\;t\_0 + \left(-1.5 + -0.25 \cdot \left(w \cdot \left(r \cdot \left(r \cdot w\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(t\_0 + 3\right) + \left(\left(3 + v \cdot -2\right) \cdot \left(r \cdot \left(w \cdot 0.125\right)\right)\right) \cdot \frac{r \cdot w}{v + -1}\right) - 4.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if v < -3.3e143

    1. Initial program 76.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(r, r\right)\right), \mathsf{+.f64}\left(\frac{-3}{2}, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{1}{8}, v\right), \frac{-1}{4}\right), \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(r, \color{blue}{\left(r \cdot w\right)}\right)\right)\right)\right)\right) \]
      20. *-lowering-*.f6495.6%

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

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

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

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

      if -3.3e143 < v

      1. Initial program 83.2%

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

          \[\leadsto \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 \left(w \cdot r\right)\right) \cdot r\right)\right), \mathsf{\_.f64}\left(1, v\right)\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), \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(w \cdot \left(\left(w \cdot r\right) \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(w, \left(\left(w \cdot r\right) \cdot r\right)\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
        4. *-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(w, \mathsf{*.f64}\left(\left(w \cdot r\right), r\right)\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
        5. *-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(w, \mathsf{*.f64}\left(\left(r \cdot w\right), r\right)\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
        6. *-lowering-*.f6493.6%

          \[\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(w, \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, w\right), r\right)\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
      4. Applied egg-rr93.6%

        \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \color{blue}{\left(w \cdot \left(\left(r \cdot w\right) \cdot r\right)\right)}}{1 - v}\right) - 4.5 \]
      5. Step-by-step derivation
        1. 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), \mathsf{/.f64}\left(\left(\left(\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot w\right) \cdot \left(\left(r \cdot w\right) \cdot r\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
        2. *-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(\left(\left(\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot w\right) \cdot \left(r \cdot \left(r \cdot w\right)\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
        3. 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), \mathsf{/.f64}\left(\left(\left(\left(\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot w\right) \cdot r\right) \cdot \left(r \cdot w\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
        4. *-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(\left(\left(\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot w\right) \cdot r\right), \left(r \cdot w\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(\left(\left(\frac{1}{8} \cdot \left(3 - 2 \cdot v\right)\right) \cdot w\right), r\right), \left(r \cdot w\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(\left(\left(\left(3 - 2 \cdot v\right) \cdot \frac{1}{8}\right) \cdot w\right), r\right), \left(r \cdot w\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
        7. 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(\left(\left(3 - 2 \cdot v\right) \cdot \left(\frac{1}{8} \cdot w\right)\right), r\right), \left(r \cdot w\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
        8. *-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(\mathsf{*.f64}\left(\left(3 - 2 \cdot v\right), \left(\frac{1}{8} \cdot w\right)\right), r\right), \left(r \cdot w\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
        9. sub-negN/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(\mathsf{*.f64}\left(\left(3 + \left(\mathsf{neg}\left(2 \cdot v\right)\right)\right), \left(\frac{1}{8} \cdot w\right)\right), r\right), \left(r \cdot w\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
        10. +-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(\mathsf{*.f64}\left(\mathsf{+.f64}\left(3, \left(\mathsf{neg}\left(2 \cdot v\right)\right)\right), \left(\frac{1}{8} \cdot w\right)\right), r\right), \left(r \cdot w\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
        11. *-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(\mathsf{*.f64}\left(\mathsf{+.f64}\left(3, \left(\mathsf{neg}\left(v \cdot 2\right)\right)\right), \left(\frac{1}{8} \cdot w\right)\right), r\right), \left(r \cdot w\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
        12. distribute-rgt-neg-inN/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(\mathsf{*.f64}\left(\mathsf{+.f64}\left(3, \left(v \cdot \left(\mathsf{neg}\left(2\right)\right)\right)\right), \left(\frac{1}{8} \cdot w\right)\right), r\right), \left(r \cdot w\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
        13. *-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(\mathsf{*.f64}\left(\mathsf{+.f64}\left(3, \mathsf{*.f64}\left(v, \left(\mathsf{neg}\left(2\right)\right)\right)\right), \left(\frac{1}{8} \cdot w\right)\right), r\right), \left(r \cdot w\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
        14. metadata-evalN/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(\mathsf{*.f64}\left(\mathsf{+.f64}\left(3, \mathsf{*.f64}\left(v, -2\right)\right), \left(\frac{1}{8} \cdot w\right)\right), r\right), \left(r \cdot w\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
        15. *-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(\mathsf{*.f64}\left(\mathsf{+.f64}\left(3, \mathsf{*.f64}\left(v, -2\right)\right), \mathsf{*.f64}\left(\frac{1}{8}, w\right)\right), r\right), \left(r \cdot w\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
        16. *-lowering-*.f6495.3%

          \[\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(\mathsf{*.f64}\left(\mathsf{+.f64}\left(3, \mathsf{*.f64}\left(v, -2\right)\right), \mathsf{*.f64}\left(\frac{1}{8}, w\right)\right), r\right), \mathsf{*.f64}\left(r, w\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
      6. Applied egg-rr95.3%

        \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\color{blue}{\left(\left(\left(3 + v \cdot -2\right) \cdot \left(0.125 \cdot w\right)\right) \cdot r\right) \cdot \left(r \cdot w\right)}}{1 - v}\right) - 4.5 \]
      7. 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(\left(\left(3 + v \cdot -2\right) \cdot \left(\frac{1}{8} \cdot w\right)\right) \cdot r\right) \cdot \frac{r \cdot w}{1 - v}\right)\right), \frac{9}{2}\right) \]
        2. *-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(\frac{r \cdot w}{1 - v} \cdot \left(\left(\left(3 + v \cdot -2\right) \cdot \left(\frac{1}{8} \cdot w\right)\right) \cdot r\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(\frac{r \cdot w}{1 - v}\right), \left(\left(\left(3 + v \cdot -2\right) \cdot \left(\frac{1}{8} \cdot w\right)\right) \cdot r\right)\right)\right), \frac{9}{2}\right) \]
        4. /-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(\left(r \cdot w\right), \left(1 - v\right)\right), \left(\left(\left(3 + v \cdot -2\right) \cdot \left(\frac{1}{8} \cdot w\right)\right) \cdot r\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(r, w\right), \left(1 - v\right)\right), \left(\left(\left(3 + v \cdot -2\right) \cdot \left(\frac{1}{8} \cdot w\right)\right) \cdot r\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(\mathsf{*.f64}\left(r, w\right), \mathsf{\_.f64}\left(1, v\right)\right), \left(\left(\left(3 + v \cdot -2\right) \cdot \left(\frac{1}{8} \cdot w\right)\right) \cdot r\right)\right)\right), \frac{9}{2}\right) \]
        7. 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(r, w\right), \mathsf{\_.f64}\left(1, v\right)\right), \left(\left(3 + v \cdot -2\right) \cdot \left(\left(\frac{1}{8} \cdot w\right) \cdot r\right)\right)\right)\right), \frac{9}{2}\right) \]
        8. *-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(r, w\right), \mathsf{\_.f64}\left(1, v\right)\right), \mathsf{*.f64}\left(\left(3 + v \cdot -2\right), \left(\left(\frac{1}{8} \cdot w\right) \cdot r\right)\right)\right)\right), \frac{9}{2}\right) \]
        9. +-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(r, w\right), \mathsf{\_.f64}\left(1, v\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(3, \left(v \cdot -2\right)\right), \left(\left(\frac{1}{8} \cdot w\right) \cdot r\right)\right)\right)\right), \frac{9}{2}\right) \]
        10. *-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(r, w\right), \mathsf{\_.f64}\left(1, v\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(3, \mathsf{*.f64}\left(v, -2\right)\right), \left(\left(\frac{1}{8} \cdot w\right) \cdot r\right)\right)\right)\right), \frac{9}{2}\right) \]
        11. *-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(r, w\right), \mathsf{\_.f64}\left(1, v\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(3, \mathsf{*.f64}\left(v, -2\right)\right), \left(r \cdot \left(\frac{1}{8} \cdot w\right)\right)\right)\right)\right), \frac{9}{2}\right) \]
        12. *-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(r, w\right), \mathsf{\_.f64}\left(1, v\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(3, \mathsf{*.f64}\left(v, -2\right)\right), \mathsf{*.f64}\left(r, \left(\frac{1}{8} \cdot w\right)\right)\right)\right)\right), \frac{9}{2}\right) \]
        13. *-lowering-*.f6498.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(r, w\right), \mathsf{\_.f64}\left(1, v\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(3, \mathsf{*.f64}\left(v, -2\right)\right), \mathsf{*.f64}\left(r, \mathsf{*.f64}\left(\frac{1}{8}, w\right)\right)\right)\right)\right), \frac{9}{2}\right) \]
      8. Applied egg-rr98.9%

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

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

    Alternative 2: 96.5% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := w \cdot \left(r \cdot \left(r \cdot w\right)\right)\\ t_1 := \frac{2}{r \cdot r}\\ \mathbf{if}\;v \leq -3.9 \cdot 10^{-13}:\\ \;\;\;\;\left(t\_1 + -1.5\right) + r \cdot \left(\left(-0.25 + \frac{0.125}{v}\right) \cdot \left(w \cdot \left(r \cdot w\right)\right)\right)\\ \mathbf{elif}\;v \leq 2.55 \cdot 10^{-46}:\\ \;\;\;\;\left(\left(t\_1 + 3\right) + \frac{0.375 \cdot t\_0}{v + -1}\right) - 4.5\\ \mathbf{else}:\\ \;\;\;\;t\_1 + \left(-1.5 + -0.25 \cdot t\_0\right)\\ \end{array} \end{array} \]
    (FPCore (v w r)
     :precision binary64
     (let* ((t_0 (* w (* r (* r w)))) (t_1 (/ 2.0 (* r r))))
       (if (<= v -3.9e-13)
         (+ (+ t_1 -1.5) (* r (* (+ -0.25 (/ 0.125 v)) (* w (* r w)))))
         (if (<= v 2.55e-46)
           (- (+ (+ t_1 3.0) (/ (* 0.375 t_0) (+ v -1.0))) 4.5)
           (+ t_1 (+ -1.5 (* -0.25 t_0)))))))
    double code(double v, double w, double r) {
    	double t_0 = w * (r * (r * w));
    	double t_1 = 2.0 / (r * r);
    	double tmp;
    	if (v <= -3.9e-13) {
    		tmp = (t_1 + -1.5) + (r * ((-0.25 + (0.125 / v)) * (w * (r * w))));
    	} else if (v <= 2.55e-46) {
    		tmp = ((t_1 + 3.0) + ((0.375 * t_0) / (v + -1.0))) - 4.5;
    	} else {
    		tmp = t_1 + (-1.5 + (-0.25 * t_0));
    	}
    	return tmp;
    }
    
    real(8) function code(v, w, r)
        real(8), intent (in) :: v
        real(8), intent (in) :: w
        real(8), intent (in) :: r
        real(8) :: t_0
        real(8) :: t_1
        real(8) :: tmp
        t_0 = w * (r * (r * w))
        t_1 = 2.0d0 / (r * r)
        if (v <= (-3.9d-13)) then
            tmp = (t_1 + (-1.5d0)) + (r * (((-0.25d0) + (0.125d0 / v)) * (w * (r * w))))
        else if (v <= 2.55d-46) then
            tmp = ((t_1 + 3.0d0) + ((0.375d0 * t_0) / (v + (-1.0d0)))) - 4.5d0
        else
            tmp = t_1 + ((-1.5d0) + ((-0.25d0) * t_0))
        end if
        code = tmp
    end function
    
    public static double code(double v, double w, double r) {
    	double t_0 = w * (r * (r * w));
    	double t_1 = 2.0 / (r * r);
    	double tmp;
    	if (v <= -3.9e-13) {
    		tmp = (t_1 + -1.5) + (r * ((-0.25 + (0.125 / v)) * (w * (r * w))));
    	} else if (v <= 2.55e-46) {
    		tmp = ((t_1 + 3.0) + ((0.375 * t_0) / (v + -1.0))) - 4.5;
    	} else {
    		tmp = t_1 + (-1.5 + (-0.25 * t_0));
    	}
    	return tmp;
    }
    
    def code(v, w, r):
    	t_0 = w * (r * (r * w))
    	t_1 = 2.0 / (r * r)
    	tmp = 0
    	if v <= -3.9e-13:
    		tmp = (t_1 + -1.5) + (r * ((-0.25 + (0.125 / v)) * (w * (r * w))))
    	elif v <= 2.55e-46:
    		tmp = ((t_1 + 3.0) + ((0.375 * t_0) / (v + -1.0))) - 4.5
    	else:
    		tmp = t_1 + (-1.5 + (-0.25 * t_0))
    	return tmp
    
    function code(v, w, r)
    	t_0 = Float64(w * Float64(r * Float64(r * w)))
    	t_1 = Float64(2.0 / Float64(r * r))
    	tmp = 0.0
    	if (v <= -3.9e-13)
    		tmp = Float64(Float64(t_1 + -1.5) + Float64(r * Float64(Float64(-0.25 + Float64(0.125 / v)) * Float64(w * Float64(r * w)))));
    	elseif (v <= 2.55e-46)
    		tmp = Float64(Float64(Float64(t_1 + 3.0) + Float64(Float64(0.375 * t_0) / Float64(v + -1.0))) - 4.5);
    	else
    		tmp = Float64(t_1 + Float64(-1.5 + Float64(-0.25 * t_0)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(v, w, r)
    	t_0 = w * (r * (r * w));
    	t_1 = 2.0 / (r * r);
    	tmp = 0.0;
    	if (v <= -3.9e-13)
    		tmp = (t_1 + -1.5) + (r * ((-0.25 + (0.125 / v)) * (w * (r * w))));
    	elseif (v <= 2.55e-46)
    		tmp = ((t_1 + 3.0) + ((0.375 * t_0) / (v + -1.0))) - 4.5;
    	else
    		tmp = t_1 + (-1.5 + (-0.25 * t_0));
    	end
    	tmp_2 = tmp;
    end
    
    code[v_, w_, r_] := Block[{t$95$0 = N[(w * N[(r * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[v, -3.9e-13], N[(N[(t$95$1 + -1.5), $MachinePrecision] + N[(r * N[(N[(-0.25 + N[(0.125 / v), $MachinePrecision]), $MachinePrecision] * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[v, 2.55e-46], N[(N[(N[(t$95$1 + 3.0), $MachinePrecision] + N[(N[(0.375 * t$95$0), $MachinePrecision] / N[(v + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.5), $MachinePrecision], N[(t$95$1 + N[(-1.5 + N[(-0.25 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := w \cdot \left(r \cdot \left(r \cdot w\right)\right)\\
    t_1 := \frac{2}{r \cdot r}\\
    \mathbf{if}\;v \leq -3.9 \cdot 10^{-13}:\\
    \;\;\;\;\left(t\_1 + -1.5\right) + r \cdot \left(\left(-0.25 + \frac{0.125}{v}\right) \cdot \left(w \cdot \left(r \cdot w\right)\right)\right)\\
    
    \mathbf{elif}\;v \leq 2.55 \cdot 10^{-46}:\\
    \;\;\;\;\left(\left(t\_1 + 3\right) + \frac{0.375 \cdot t\_0}{v + -1}\right) - 4.5\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1 + \left(-1.5 + -0.25 \cdot t\_0\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if v < -3.90000000000000004e-13

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -3.90000000000000004e-13 < v < 2.5499999999999999e-46

      1. Initial program 85.4%

        \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5 \]
      2. Add Preprocessing
      3. 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 \left(w \cdot r\right)\right) \cdot r\right)\right), \mathsf{\_.f64}\left(1, v\right)\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), \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(w \cdot \left(\left(w \cdot r\right) \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(w, \left(\left(w \cdot r\right) \cdot r\right)\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
        4. *-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(w, \mathsf{*.f64}\left(\left(w \cdot r\right), r\right)\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
        5. *-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(w, \mathsf{*.f64}\left(\left(r \cdot w\right), r\right)\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
        6. *-lowering-*.f6497.0%

          \[\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(w, \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, w\right), r\right)\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
      4. Applied egg-rr97.0%

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

        \[\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(\color{blue}{\frac{3}{8}}, \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(\mathsf{*.f64}\left(r, w\right), r\right)\right)\right), \mathsf{\_.f64}\left(1, v\right)\right)\right), \frac{9}{2}\right) \]
      6. Step-by-step derivation
        1. Simplified97.0%

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

        if 2.5499999999999999e-46 < v

        1. Initial program 81.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 3: 67.8% accurate, 1.1× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;r \leq 1.95 \cdot 10^{-122}:\\ \;\;\;\;\frac{\frac{2}{r}}{r}\\ \mathbf{elif}\;r \leq 10^{+85}:\\ \;\;\;\;\left(\frac{2}{r \cdot r} + -1.5\right) + r \cdot \left(r \cdot \left(-0.25 \cdot \left(w \cdot w\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-1.5 + r \cdot \left(-0.25 \cdot \left(w \cdot \left(r \cdot w\right)\right)\right)\\ \end{array} \end{array} \]
        (FPCore (v w r)
         :precision binary64
         (if (<= r 1.95e-122)
           (/ (/ 2.0 r) r)
           (if (<= r 1e+85)
             (+ (+ (/ 2.0 (* r r)) -1.5) (* r (* r (* -0.25 (* w w)))))
             (+ -1.5 (* r (* -0.25 (* w (* r w))))))))
        double code(double v, double w, double r) {
        	double tmp;
        	if (r <= 1.95e-122) {
        		tmp = (2.0 / r) / r;
        	} else if (r <= 1e+85) {
        		tmp = ((2.0 / (r * r)) + -1.5) + (r * (r * (-0.25 * (w * w))));
        	} else {
        		tmp = -1.5 + (r * (-0.25 * (w * (r * 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 <= 1.95d-122) then
                tmp = (2.0d0 / r) / r
            else if (r <= 1d+85) then
                tmp = ((2.0d0 / (r * r)) + (-1.5d0)) + (r * (r * ((-0.25d0) * (w * w))))
            else
                tmp = (-1.5d0) + (r * ((-0.25d0) * (w * (r * w))))
            end if
            code = tmp
        end function
        
        public static double code(double v, double w, double r) {
        	double tmp;
        	if (r <= 1.95e-122) {
        		tmp = (2.0 / r) / r;
        	} else if (r <= 1e+85) {
        		tmp = ((2.0 / (r * r)) + -1.5) + (r * (r * (-0.25 * (w * w))));
        	} else {
        		tmp = -1.5 + (r * (-0.25 * (w * (r * w))));
        	}
        	return tmp;
        }
        
        def code(v, w, r):
        	tmp = 0
        	if r <= 1.95e-122:
        		tmp = (2.0 / r) / r
        	elif r <= 1e+85:
        		tmp = ((2.0 / (r * r)) + -1.5) + (r * (r * (-0.25 * (w * w))))
        	else:
        		tmp = -1.5 + (r * (-0.25 * (w * (r * w))))
        	return tmp
        
        function code(v, w, r)
        	tmp = 0.0
        	if (r <= 1.95e-122)
        		tmp = Float64(Float64(2.0 / r) / r);
        	elseif (r <= 1e+85)
        		tmp = Float64(Float64(Float64(2.0 / Float64(r * r)) + -1.5) + Float64(r * Float64(r * Float64(-0.25 * Float64(w * w)))));
        	else
        		tmp = Float64(-1.5 + Float64(r * Float64(-0.25 * Float64(w * Float64(r * w)))));
        	end
        	return tmp
        end
        
        function tmp_2 = code(v, w, r)
        	tmp = 0.0;
        	if (r <= 1.95e-122)
        		tmp = (2.0 / r) / r;
        	elseif (r <= 1e+85)
        		tmp = ((2.0 / (r * r)) + -1.5) + (r * (r * (-0.25 * (w * w))));
        	else
        		tmp = -1.5 + (r * (-0.25 * (w * (r * w))));
        	end
        	tmp_2 = tmp;
        end
        
        code[v_, w_, r_] := If[LessEqual[r, 1.95e-122], N[(N[(2.0 / r), $MachinePrecision] / r), $MachinePrecision], If[LessEqual[r, 1e+85], N[(N[(N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision] + -1.5), $MachinePrecision] + N[(r * N[(r * N[(-0.25 * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.5 + N[(r * N[(-0.25 * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;r \leq 1.95 \cdot 10^{-122}:\\
        \;\;\;\;\frac{\frac{2}{r}}{r}\\
        
        \mathbf{elif}\;r \leq 10^{+85}:\\
        \;\;\;\;\left(\frac{2}{r \cdot r} + -1.5\right) + r \cdot \left(r \cdot \left(-0.25 \cdot \left(w \cdot w\right)\right)\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;-1.5 + r \cdot \left(-0.25 \cdot \left(w \cdot \left(r \cdot w\right)\right)\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if r < 1.94999999999999995e-122

          1. Initial program 81.0%

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

            \[\leadsto \color{blue}{\frac{2}{{r}^{2}}} \]
          4. Step-by-step derivation
            1. /-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-*.f6455.2%

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

            \[\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-/.f6455.2%

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

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

          if 1.94999999999999995e-122 < r < 1e85

          1. Initial program 89.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 1e85 < r

          1. Initial program 79.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto -1.5 + \left(\color{blue}{-0.25} \cdot \left(w \cdot \left(r \cdot w\right)\right)\right) \cdot r \]
            4. Recombined 3 regimes into one program.
            5. Final simplification67.7%

              \[\leadsto \begin{array}{l} \mathbf{if}\;r \leq 1.95 \cdot 10^{-122}:\\ \;\;\;\;\frac{\frac{2}{r}}{r}\\ \mathbf{elif}\;r \leq 10^{+85}:\\ \;\;\;\;\left(\frac{2}{r \cdot r} + -1.5\right) + r \cdot \left(r \cdot \left(-0.25 \cdot \left(w \cdot w\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-1.5 + r \cdot \left(-0.25 \cdot \left(w \cdot \left(r \cdot w\right)\right)\right)\\ \end{array} \]
            6. Add Preprocessing

            Alternative 4: 92.5% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if 1e148 < r

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto -1.5 + \left(\color{blue}{-0.25} \cdot \left(w \cdot \left(r \cdot w\right)\right)\right) \cdot r \]
                  4. Recombined 2 regimes into one program.
                  5. Final simplification93.6%

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

                  Alternative 5: 65.5% accurate, 1.8× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;r \leq 5 \cdot 10^{-27}:\\ \;\;\;\;\frac{\frac{2}{r}}{r}\\ \mathbf{else}:\\ \;\;\;\;-1.5 + r \cdot \left(-0.25 \cdot \left(w \cdot \left(r \cdot w\right)\right)\right)\\ \end{array} \end{array} \]
                  (FPCore (v w r)
                   :precision binary64
                   (if (<= r 5e-27) (/ (/ 2.0 r) r) (+ -1.5 (* r (* -0.25 (* w (* r w)))))))
                  double code(double v, double w, double r) {
                  	double tmp;
                  	if (r <= 5e-27) {
                  		tmp = (2.0 / r) / r;
                  	} else {
                  		tmp = -1.5 + (r * (-0.25 * (w * (r * 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 <= 5d-27) then
                          tmp = (2.0d0 / r) / r
                      else
                          tmp = (-1.5d0) + (r * ((-0.25d0) * (w * (r * w))))
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double v, double w, double r) {
                  	double tmp;
                  	if (r <= 5e-27) {
                  		tmp = (2.0 / r) / r;
                  	} else {
                  		tmp = -1.5 + (r * (-0.25 * (w * (r * w))));
                  	}
                  	return tmp;
                  }
                  
                  def code(v, w, r):
                  	tmp = 0
                  	if r <= 5e-27:
                  		tmp = (2.0 / r) / r
                  	else:
                  		tmp = -1.5 + (r * (-0.25 * (w * (r * w))))
                  	return tmp
                  
                  function code(v, w, r)
                  	tmp = 0.0
                  	if (r <= 5e-27)
                  		tmp = Float64(Float64(2.0 / r) / r);
                  	else
                  		tmp = Float64(-1.5 + Float64(r * Float64(-0.25 * Float64(w * Float64(r * w)))));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(v, w, r)
                  	tmp = 0.0;
                  	if (r <= 5e-27)
                  		tmp = (2.0 / r) / r;
                  	else
                  		tmp = -1.5 + (r * (-0.25 * (w * (r * w))));
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[v_, w_, r_] := If[LessEqual[r, 5e-27], N[(N[(2.0 / r), $MachinePrecision] / r), $MachinePrecision], N[(-1.5 + N[(r * N[(-0.25 * N[(w * N[(r * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;r \leq 5 \cdot 10^{-27}:\\
                  \;\;\;\;\frac{\frac{2}{r}}{r}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;-1.5 + r \cdot \left(-0.25 \cdot \left(w \cdot \left(r \cdot w\right)\right)\right)\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if r < 5.0000000000000002e-27

                    1. Initial program 81.7%

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

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

                      \[\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-/.f6457.2%

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

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

                    if 5.0000000000000002e-27 < r

                    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 v around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 6: 64.8% accurate, 1.8× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;r \leq 4.6 \cdot 10^{-27}:\\ \;\;\;\;\frac{\frac{2}{r}}{r}\\ \mathbf{else}:\\ \;\;\;\;-1.5 + r \cdot \left(-0.25 \cdot \left(r \cdot \left(w \cdot w\right)\right)\right)\\ \end{array} \end{array} \]
                      (FPCore (v w r)
                       :precision binary64
                       (if (<= r 4.6e-27) (/ (/ 2.0 r) r) (+ -1.5 (* r (* -0.25 (* r (* w w)))))))
                      double code(double v, double w, double r) {
                      	double tmp;
                      	if (r <= 4.6e-27) {
                      		tmp = (2.0 / r) / r;
                      	} else {
                      		tmp = -1.5 + (r * (-0.25 * (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 <= 4.6d-27) then
                              tmp = (2.0d0 / r) / r
                          else
                              tmp = (-1.5d0) + (r * ((-0.25d0) * (r * (w * w))))
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double v, double w, double r) {
                      	double tmp;
                      	if (r <= 4.6e-27) {
                      		tmp = (2.0 / r) / r;
                      	} else {
                      		tmp = -1.5 + (r * (-0.25 * (r * (w * w))));
                      	}
                      	return tmp;
                      }
                      
                      def code(v, w, r):
                      	tmp = 0
                      	if r <= 4.6e-27:
                      		tmp = (2.0 / r) / r
                      	else:
                      		tmp = -1.5 + (r * (-0.25 * (r * (w * w))))
                      	return tmp
                      
                      function code(v, w, r)
                      	tmp = 0.0
                      	if (r <= 4.6e-27)
                      		tmp = Float64(Float64(2.0 / r) / r);
                      	else
                      		tmp = Float64(-1.5 + Float64(r * Float64(-0.25 * Float64(r * Float64(w * w)))));
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(v, w, r)
                      	tmp = 0.0;
                      	if (r <= 4.6e-27)
                      		tmp = (2.0 / r) / r;
                      	else
                      		tmp = -1.5 + (r * (-0.25 * (r * (w * w))));
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[v_, w_, r_] := If[LessEqual[r, 4.6e-27], N[(N[(2.0 / r), $MachinePrecision] / r), $MachinePrecision], N[(-1.5 + N[(r * N[(-0.25 * N[(r * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;r \leq 4.6 \cdot 10^{-27}:\\
                      \;\;\;\;\frac{\frac{2}{r}}{r}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;-1.5 + r \cdot \left(-0.25 \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 < 4.5999999999999999e-27

                        1. Initial program 81.7%

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

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

                          \[\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-/.f6457.2%

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

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

                        if 4.5999999999999999e-27 < r

                        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 v around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto -1.5 + \color{blue}{\left(-0.25 \cdot \left(r \cdot \left(w \cdot w\right)\right)\right)} \cdot r \]
                        9. Recombined 2 regimes into one program.
                        10. Final simplification64.6%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;r \leq 4.6 \cdot 10^{-27}:\\ \;\;\;\;\frac{\frac{2}{r}}{r}\\ \mathbf{else}:\\ \;\;\;\;-1.5 + r \cdot \left(-0.25 \cdot \left(r \cdot \left(w \cdot w\right)\right)\right)\\ \end{array} \]
                        11. Add Preprocessing

                        Alternative 7: 50.3% accurate, 2.9× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;r \leq 9.2 \cdot 10^{-15}:\\ \;\;\;\;\frac{\frac{2}{r}}{r}\\ \mathbf{else}:\\ \;\;\;\;-1.5\\ \end{array} \end{array} \]
                        (FPCore (v w r) :precision binary64 (if (<= r 9.2e-15) (/ (/ 2.0 r) r) -1.5))
                        double code(double v, double w, double r) {
                        	double tmp;
                        	if (r <= 9.2e-15) {
                        		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 <= 9.2d-15) 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 <= 9.2e-15) {
                        		tmp = (2.0 / r) / r;
                        	} else {
                        		tmp = -1.5;
                        	}
                        	return tmp;
                        }
                        
                        def code(v, w, r):
                        	tmp = 0
                        	if r <= 9.2e-15:
                        		tmp = (2.0 / r) / r
                        	else:
                        		tmp = -1.5
                        	return tmp
                        
                        function code(v, w, r)
                        	tmp = 0.0
                        	if (r <= 9.2e-15)
                        		tmp = Float64(Float64(2.0 / r) / r);
                        	else
                        		tmp = -1.5;
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(v, w, r)
                        	tmp = 0.0;
                        	if (r <= 9.2e-15)
                        		tmp = (2.0 / r) / r;
                        	else
                        		tmp = -1.5;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[v_, w_, r_] := If[LessEqual[r, 9.2e-15], N[(N[(2.0 / r), $MachinePrecision] / r), $MachinePrecision], -1.5]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;r \leq 9.2 \cdot 10^{-15}:\\
                        \;\;\;\;\frac{\frac{2}{r}}{r}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;-1.5\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if r < 9.19999999999999961e-15

                          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-*.f6456.9%

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

                            \[\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-/.f6456.9%

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

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

                          if 9.19999999999999961e-15 < r

                          1. Initial program 82.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          Alternative 8: 50.3% accurate, 2.9× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;r \leq 9.2 \cdot 10^{-15}:\\ \;\;\;\;\frac{2}{r \cdot r}\\ \mathbf{else}:\\ \;\;\;\;-1.5\\ \end{array} \end{array} \]
                          (FPCore (v w r) :precision binary64 (if (<= r 9.2e-15) (/ 2.0 (* r r)) -1.5))
                          double code(double v, double w, double r) {
                          	double tmp;
                          	if (r <= 9.2e-15) {
                          		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 <= 9.2d-15) 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 <= 9.2e-15) {
                          		tmp = 2.0 / (r * r);
                          	} else {
                          		tmp = -1.5;
                          	}
                          	return tmp;
                          }
                          
                          def code(v, w, r):
                          	tmp = 0
                          	if r <= 9.2e-15:
                          		tmp = 2.0 / (r * r)
                          	else:
                          		tmp = -1.5
                          	return tmp
                          
                          function code(v, w, r)
                          	tmp = 0.0
                          	if (r <= 9.2e-15)
                          		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 <= 9.2e-15)
                          		tmp = 2.0 / (r * r);
                          	else
                          		tmp = -1.5;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[v_, w_, r_] := If[LessEqual[r, 9.2e-15], N[(2.0 / N[(r * r), $MachinePrecision]), $MachinePrecision], -1.5]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;r \leq 9.2 \cdot 10^{-15}:\\
                          \;\;\;\;\frac{2}{r \cdot r}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;-1.5\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if r < 9.19999999999999961e-15

                            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-*.f6456.9%

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

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

                            if 9.19999999999999961e-15 < r

                            1. Initial program 82.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            Alternative 9: 57.0% accurate, 4.1× 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 82.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-*.f6455.6%

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

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

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

                            Alternative 10: 14.1% accurate, 29.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 82.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              Alternative 11: 4.3% accurate, 29.0× speedup?

                              \[\begin{array}{l} \\ -4.5 \end{array} \]
                              (FPCore (v w r) :precision binary64 -4.5)
                              double code(double v, double w, double r) {
                              	return -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 = -4.5d0
                              end function
                              
                              public static double code(double v, double w, double r) {
                              	return -4.5;
                              }
                              
                              def code(v, w, r):
                              	return -4.5
                              
                              function code(v, w, r)
                              	return -4.5
                              end
                              
                              function tmp = code(v, w, r)
                              	tmp = -4.5;
                              end
                              
                              code[v_, w_, r_] := -4.5
                              
                              \begin{array}{l}
                              
                              \\
                              -4.5
                              \end{array}
                              
                              Derivation
                              1. Initial program 82.0%

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\color{blue}{\left(\frac{2}{r}\right)}, r\right), \frac{9}{2}\right) \]
                              7. Step-by-step derivation
                                1. /-lowering-/.f6446.6%

                                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, r\right), r\right), \frac{9}{2}\right) \]
                              8. Simplified46.6%

                                \[\leadsto \frac{\color{blue}{\frac{2}{r}}}{r} - 4.5 \]
                              9. Taylor expanded in r around inf

                                \[\leadsto \color{blue}{\frac{-9}{2}} \]
                              10. Step-by-step derivation
                                1. Simplified4.1%

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

                                Reproduce

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