(x1 / (128*128*128) * y1 + x2 / (128*128*128) * y2) / (y1 + y2) * 128*128*128

Percentage Accurate: 77.8% → 99.7%
Time: 4.1s
Alternatives: 13
Speedup: 1.2×

Specification

?
\[\left(\left(\left(0 \leq x1 \land x1 \leq 1\right) \land \left(0 \leq y1 \land y1 \leq 10000\right)\right) \land \left(0 \leq x2 \land x2 \leq 1\right)\right) \land \left(0 \leq y2 \land y2 \leq 10000\right)\]
\[\begin{array}{l} t_0 := \left(128 \cdot 128\right) \cdot 128\\ \left(\left(\frac{\frac{x1}{t\_0} \cdot y1 + \frac{x2}{t\_0} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \end{array} \]
(FPCore (x1 y1 x2 y2)
  :precision binary64
  (let* ((t_0 (* (* 128.0 128.0) 128.0)))
  (*
   (*
    (* (/ (+ (* (/ x1 t_0) y1) (* (/ x2 t_0) y2)) (+ y1 y2)) 128.0)
    128.0)
   128.0)))
double code(double x1, double y1, double x2, double y2) {
	double t_0 = (128.0 * 128.0) * 128.0;
	return ((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0;
}
real(8) function code(x1, y1, x2, y2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: y1
    real(8), intent (in) :: x2
    real(8), intent (in) :: y2
    real(8) :: t_0
    t_0 = (128.0d0 * 128.0d0) * 128.0d0
    code = ((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0d0) * 128.0d0) * 128.0d0
end function
public static double code(double x1, double y1, double x2, double y2) {
	double t_0 = (128.0 * 128.0) * 128.0;
	return ((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0;
}
def code(x1, y1, x2, y2):
	t_0 = (128.0 * 128.0) * 128.0
	return ((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0
function code(x1, y1, x2, y2)
	t_0 = Float64(Float64(128.0 * 128.0) * 128.0)
	return Float64(Float64(Float64(Float64(Float64(Float64(Float64(x1 / t_0) * y1) + Float64(Float64(x2 / t_0) * y2)) / Float64(y1 + y2)) * 128.0) * 128.0) * 128.0)
end
function tmp = code(x1, y1, x2, y2)
	t_0 = (128.0 * 128.0) * 128.0;
	tmp = ((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0;
end
code[x1_, y1_, x2_, y2_] := Block[{t$95$0 = N[(N[(128.0 * 128.0), $MachinePrecision] * 128.0), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(N[(x1 / t$95$0), $MachinePrecision] * y1), $MachinePrecision] + N[(N[(x2 / t$95$0), $MachinePrecision] * y2), $MachinePrecision]), $MachinePrecision] / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision]]
\begin{array}{l}
t_0 := \left(128 \cdot 128\right) \cdot 128\\
\left(\left(\frac{\frac{x1}{t\_0} \cdot y1 + \frac{x2}{t\_0} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128
\end{array}

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 13 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: 77.8% accurate, 1.0× speedup?

\[\begin{array}{l} t_0 := \left(128 \cdot 128\right) \cdot 128\\ \left(\left(\frac{\frac{x1}{t\_0} \cdot y1 + \frac{x2}{t\_0} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \end{array} \]
(FPCore (x1 y1 x2 y2)
  :precision binary64
  (let* ((t_0 (* (* 128.0 128.0) 128.0)))
  (*
   (*
    (* (/ (+ (* (/ x1 t_0) y1) (* (/ x2 t_0) y2)) (+ y1 y2)) 128.0)
    128.0)
   128.0)))
double code(double x1, double y1, double x2, double y2) {
	double t_0 = (128.0 * 128.0) * 128.0;
	return ((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0;
}
real(8) function code(x1, y1, x2, y2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: y1
    real(8), intent (in) :: x2
    real(8), intent (in) :: y2
    real(8) :: t_0
    t_0 = (128.0d0 * 128.0d0) * 128.0d0
    code = ((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0d0) * 128.0d0) * 128.0d0
end function
public static double code(double x1, double y1, double x2, double y2) {
	double t_0 = (128.0 * 128.0) * 128.0;
	return ((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0;
}
def code(x1, y1, x2, y2):
	t_0 = (128.0 * 128.0) * 128.0
	return ((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0
function code(x1, y1, x2, y2)
	t_0 = Float64(Float64(128.0 * 128.0) * 128.0)
	return Float64(Float64(Float64(Float64(Float64(Float64(Float64(x1 / t_0) * y1) + Float64(Float64(x2 / t_0) * y2)) / Float64(y1 + y2)) * 128.0) * 128.0) * 128.0)
end
function tmp = code(x1, y1, x2, y2)
	t_0 = (128.0 * 128.0) * 128.0;
	tmp = ((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0;
end
code[x1_, y1_, x2_, y2_] := Block[{t$95$0 = N[(N[(128.0 * 128.0), $MachinePrecision] * 128.0), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(N[(x1 / t$95$0), $MachinePrecision] * y1), $MachinePrecision] + N[(N[(x2 / t$95$0), $MachinePrecision] * y2), $MachinePrecision]), $MachinePrecision] / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision]]
\begin{array}{l}
t_0 := \left(128 \cdot 128\right) \cdot 128\\
\left(\left(\frac{\frac{x1}{t\_0} \cdot y1 + \frac{x2}{t\_0} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128
\end{array}

Alternative 1: 99.7% accurate, 1.2× speedup?

\[\left(\left(\mathsf{fma}\left(\frac{y2 \cdot 4.76837158203125 \cdot 10^{-7}}{y1 + y2}, x2, \left(x1 \cdot 4.76837158203125 \cdot 10^{-7}\right) \cdot \frac{y1}{y1 + y2}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
(FPCore (x1 y1 x2 y2)
  :precision binary64
  (*
 (*
  (*
   (fma
    (/ (* y2 4.76837158203125e-7) (+ y1 y2))
    x2
    (* (* x1 4.76837158203125e-7) (/ y1 (+ y1 y2))))
   128.0)
  128.0)
 128.0))
double code(double x1, double y1, double x2, double y2) {
	return ((fma(((y2 * 4.76837158203125e-7) / (y1 + y2)), x2, ((x1 * 4.76837158203125e-7) * (y1 / (y1 + y2)))) * 128.0) * 128.0) * 128.0;
}
function code(x1, y1, x2, y2)
	return Float64(Float64(Float64(fma(Float64(Float64(y2 * 4.76837158203125e-7) / Float64(y1 + y2)), x2, Float64(Float64(x1 * 4.76837158203125e-7) * Float64(y1 / Float64(y1 + y2)))) * 128.0) * 128.0) * 128.0)
end
code[x1_, y1_, x2_, y2_] := N[(N[(N[(N[(N[(N[(y2 * 4.76837158203125e-7), $MachinePrecision] / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] * x2 + N[(N[(x1 * 4.76837158203125e-7), $MachinePrecision] * N[(y1 / N[(y1 + y2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision]
\left(\left(\mathsf{fma}\left(\frac{y2 \cdot 4.76837158203125 \cdot 10^{-7}}{y1 + y2}, x2, \left(x1 \cdot 4.76837158203125 \cdot 10^{-7}\right) \cdot \frac{y1}{y1 + y2}\right) \cdot 128\right) \cdot 128\right) \cdot 128
Derivation
  1. Initial program 77.8%

    \[\left(\left(\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \]
  2. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \left(\left(\color{blue}{\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2}} \cdot 128\right) \cdot 128\right) \cdot 128 \]
    2. mult-flipN/A

      \[\leadsto \left(\left(\color{blue}{\left(\left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2\right) \cdot \frac{1}{y1 + y2}\right)} \cdot 128\right) \cdot 128\right) \cdot 128 \]
    3. *-commutativeN/A

      \[\leadsto \left(\left(\color{blue}{\left(\frac{1}{y1 + y2} \cdot \left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2\right)\right)} \cdot 128\right) \cdot 128\right) \cdot 128 \]
    4. lift-+.f64N/A

      \[\leadsto \left(\left(\left(\frac{1}{y1 + y2} \cdot \color{blue}{\left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2\right)}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    5. +-commutativeN/A

      \[\leadsto \left(\left(\left(\frac{1}{y1 + y2} \cdot \color{blue}{\left(\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2 + \frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1\right)}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    6. distribute-lft-inN/A

      \[\leadsto \left(\left(\color{blue}{\left(\frac{1}{y1 + y2} \cdot \left(\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2\right) + \frac{1}{y1 + y2} \cdot \left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1\right)\right)} \cdot 128\right) \cdot 128\right) \cdot 128 \]
    7. *-commutativeN/A

      \[\leadsto \left(\left(\left(\color{blue}{\left(\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2\right) \cdot \frac{1}{y1 + y2}} + \frac{1}{y1 + y2} \cdot \left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1\right)\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    8. mult-flipN/A

      \[\leadsto \left(\left(\left(\color{blue}{\frac{\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2}} + \frac{1}{y1 + y2} \cdot \left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1\right)\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    9. lift-*.f64N/A

      \[\leadsto \left(\left(\left(\frac{\color{blue}{\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}}{y1 + y2} + \frac{1}{y1 + y2} \cdot \left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1\right)\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    10. associate-/l*N/A

      \[\leadsto \left(\left(\left(\color{blue}{\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot \frac{y2}{y1 + y2}} + \frac{1}{y1 + y2} \cdot \left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1\right)\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    11. *-commutativeN/A

      \[\leadsto \left(\left(\left(\color{blue}{\frac{y2}{y1 + y2} \cdot \frac{x2}{\left(128 \cdot 128\right) \cdot 128}} + \frac{1}{y1 + y2} \cdot \left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1\right)\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    12. *-commutativeN/A

      \[\leadsto \left(\left(\left(\frac{y2}{y1 + y2} \cdot \frac{x2}{\left(128 \cdot 128\right) \cdot 128} + \color{blue}{\left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1\right) \cdot \frac{1}{y1 + y2}}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    13. mult-flipN/A

      \[\leadsto \left(\left(\left(\frac{y2}{y1 + y2} \cdot \frac{x2}{\left(128 \cdot 128\right) \cdot 128} + \color{blue}{\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1}{y1 + y2}}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
  3. Applied rewrites99.6%

    \[\leadsto \left(\left(\color{blue}{\mathsf{fma}\left(\frac{y2}{y2 + y1}, 4.76837158203125 \cdot 10^{-7} \cdot x2, \left(4.76837158203125 \cdot 10^{-7} \cdot y1\right) \cdot \frac{x1}{y2 + y1}\right)} \cdot 128\right) \cdot 128\right) \cdot 128 \]
  4. Step-by-step derivation
    1. lift-fma.f64N/A

      \[\leadsto \left(\left(\color{blue}{\left(\frac{y2}{y2 + y1} \cdot \left(\frac{1}{2097152} \cdot x2\right) + \left(\frac{1}{2097152} \cdot y1\right) \cdot \frac{x1}{y2 + y1}\right)} \cdot 128\right) \cdot 128\right) \cdot 128 \]
    2. lift-*.f64N/A

      \[\leadsto \left(\left(\left(\frac{y2}{y2 + y1} \cdot \color{blue}{\left(\frac{1}{2097152} \cdot x2\right)} + \left(\frac{1}{2097152} \cdot y1\right) \cdot \frac{x1}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    3. associate-*r*N/A

      \[\leadsto \left(\left(\left(\color{blue}{\left(\frac{y2}{y2 + y1} \cdot \frac{1}{2097152}\right) \cdot x2} + \left(\frac{1}{2097152} \cdot y1\right) \cdot \frac{x1}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    4. lower-fma.f64N/A

      \[\leadsto \left(\left(\color{blue}{\mathsf{fma}\left(\frac{y2}{y2 + y1} \cdot \frac{1}{2097152}, x2, \left(\frac{1}{2097152} \cdot y1\right) \cdot \frac{x1}{y2 + y1}\right)} \cdot 128\right) \cdot 128\right) \cdot 128 \]
    5. lift-/.f64N/A

      \[\leadsto \left(\left(\mathsf{fma}\left(\color{blue}{\frac{y2}{y2 + y1}} \cdot \frac{1}{2097152}, x2, \left(\frac{1}{2097152} \cdot y1\right) \cdot \frac{x1}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    6. lift-+.f64N/A

      \[\leadsto \left(\left(\mathsf{fma}\left(\frac{y2}{\color{blue}{y2 + y1}} \cdot \frac{1}{2097152}, x2, \left(\frac{1}{2097152} \cdot y1\right) \cdot \frac{x1}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    7. +-commutativeN/A

      \[\leadsto \left(\left(\mathsf{fma}\left(\frac{y2}{\color{blue}{y1 + y2}} \cdot \frac{1}{2097152}, x2, \left(\frac{1}{2097152} \cdot y1\right) \cdot \frac{x1}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    8. lift-+.f64N/A

      \[\leadsto \left(\left(\mathsf{fma}\left(\frac{y2}{\color{blue}{y1 + y2}} \cdot \frac{1}{2097152}, x2, \left(\frac{1}{2097152} \cdot y1\right) \cdot \frac{x1}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    9. associate-*l/N/A

      \[\leadsto \left(\left(\mathsf{fma}\left(\color{blue}{\frac{y2 \cdot \frac{1}{2097152}}{y1 + y2}}, x2, \left(\frac{1}{2097152} \cdot y1\right) \cdot \frac{x1}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    10. lower-/.f64N/A

      \[\leadsto \left(\left(\mathsf{fma}\left(\color{blue}{\frac{y2 \cdot \frac{1}{2097152}}{y1 + y2}}, x2, \left(\frac{1}{2097152} \cdot y1\right) \cdot \frac{x1}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    11. lower-*.f6499.6%

      \[\leadsto \left(\left(\mathsf{fma}\left(\frac{\color{blue}{y2 \cdot 4.76837158203125 \cdot 10^{-7}}}{y1 + y2}, x2, \left(4.76837158203125 \cdot 10^{-7} \cdot y1\right) \cdot \frac{x1}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    12. lift-*.f64N/A

      \[\leadsto \left(\left(\mathsf{fma}\left(\frac{y2 \cdot \frac{1}{2097152}}{y1 + y2}, x2, \color{blue}{\left(\frac{1}{2097152} \cdot y1\right) \cdot \frac{x1}{y2 + y1}}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    13. lift-*.f64N/A

      \[\leadsto \left(\left(\mathsf{fma}\left(\frac{y2 \cdot \frac{1}{2097152}}{y1 + y2}, x2, \color{blue}{\left(\frac{1}{2097152} \cdot y1\right)} \cdot \frac{x1}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    14. *-commutativeN/A

      \[\leadsto \left(\left(\mathsf{fma}\left(\frac{y2 \cdot \frac{1}{2097152}}{y1 + y2}, x2, \color{blue}{\left(y1 \cdot \frac{1}{2097152}\right)} \cdot \frac{x1}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    15. metadata-evalN/A

      \[\leadsto \left(\left(\mathsf{fma}\left(\frac{y2 \cdot \frac{1}{2097152}}{y1 + y2}, x2, \left(y1 \cdot \color{blue}{\frac{1}{2097152}}\right) \cdot \frac{x1}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    16. metadata-evalN/A

      \[\leadsto \left(\left(\mathsf{fma}\left(\frac{y2 \cdot \frac{1}{2097152}}{y1 + y2}, x2, \left(y1 \cdot \frac{1}{\color{blue}{16384 \cdot 128}}\right) \cdot \frac{x1}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    17. metadata-evalN/A

      \[\leadsto \left(\left(\mathsf{fma}\left(\frac{y2 \cdot \frac{1}{2097152}}{y1 + y2}, x2, \left(y1 \cdot \frac{1}{\color{blue}{\left(128 \cdot 128\right)} \cdot 128}\right) \cdot \frac{x1}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    18. mult-flip-revN/A

      \[\leadsto \left(\left(\mathsf{fma}\left(\frac{y2 \cdot \frac{1}{2097152}}{y1 + y2}, x2, \color{blue}{\frac{y1}{\left(128 \cdot 128\right) \cdot 128}} \cdot \frac{x1}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    19. lift-/.f64N/A

      \[\leadsto \left(\left(\mathsf{fma}\left(\frac{y2 \cdot \frac{1}{2097152}}{y1 + y2}, x2, \frac{y1}{\left(128 \cdot 128\right) \cdot 128} \cdot \color{blue}{\frac{x1}{y2 + y1}}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    20. lift-+.f64N/A

      \[\leadsto \left(\left(\mathsf{fma}\left(\frac{y2 \cdot \frac{1}{2097152}}{y1 + y2}, x2, \frac{y1}{\left(128 \cdot 128\right) \cdot 128} \cdot \frac{x1}{\color{blue}{y2 + y1}}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    21. +-commutativeN/A

      \[\leadsto \left(\left(\mathsf{fma}\left(\frac{y2 \cdot \frac{1}{2097152}}{y1 + y2}, x2, \frac{y1}{\left(128 \cdot 128\right) \cdot 128} \cdot \frac{x1}{\color{blue}{y1 + y2}}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    22. lift-+.f64N/A

      \[\leadsto \left(\left(\mathsf{fma}\left(\frac{y2 \cdot \frac{1}{2097152}}{y1 + y2}, x2, \frac{y1}{\left(128 \cdot 128\right) \cdot 128} \cdot \frac{x1}{\color{blue}{y1 + y2}}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    23. frac-timesN/A

      \[\leadsto \left(\left(\mathsf{fma}\left(\frac{y2 \cdot \frac{1}{2097152}}{y1 + y2}, x2, \color{blue}{\frac{y1 \cdot x1}{\left(\left(128 \cdot 128\right) \cdot 128\right) \cdot \left(y1 + y2\right)}}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
  5. Applied rewrites99.7%

    \[\leadsto \left(\left(\color{blue}{\mathsf{fma}\left(\frac{y2 \cdot 4.76837158203125 \cdot 10^{-7}}{y1 + y2}, x2, \left(x1 \cdot 4.76837158203125 \cdot 10^{-7}\right) \cdot \frac{y1}{y1 + y2}\right)} \cdot 128\right) \cdot 128\right) \cdot 128 \]
  6. Add Preprocessing

Alternative 2: 99.6% accurate, 1.2× speedup?

\[\left(\left(\mathsf{fma}\left(\frac{y2}{y2 + y1}, 4.76837158203125 \cdot 10^{-7} \cdot x2, \left(4.76837158203125 \cdot 10^{-7} \cdot y1\right) \cdot \frac{x1}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
(FPCore (x1 y1 x2 y2)
  :precision binary64
  (*
 (*
  (*
   (fma
    (/ y2 (+ y2 y1))
    (* 4.76837158203125e-7 x2)
    (* (* 4.76837158203125e-7 y1) (/ x1 (+ y2 y1))))
   128.0)
  128.0)
 128.0))
double code(double x1, double y1, double x2, double y2) {
	return ((fma((y2 / (y2 + y1)), (4.76837158203125e-7 * x2), ((4.76837158203125e-7 * y1) * (x1 / (y2 + y1)))) * 128.0) * 128.0) * 128.0;
}
function code(x1, y1, x2, y2)
	return Float64(Float64(Float64(fma(Float64(y2 / Float64(y2 + y1)), Float64(4.76837158203125e-7 * x2), Float64(Float64(4.76837158203125e-7 * y1) * Float64(x1 / Float64(y2 + y1)))) * 128.0) * 128.0) * 128.0)
end
code[x1_, y1_, x2_, y2_] := N[(N[(N[(N[(N[(y2 / N[(y2 + y1), $MachinePrecision]), $MachinePrecision] * N[(4.76837158203125e-7 * x2), $MachinePrecision] + N[(N[(4.76837158203125e-7 * y1), $MachinePrecision] * N[(x1 / N[(y2 + y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision]
\left(\left(\mathsf{fma}\left(\frac{y2}{y2 + y1}, 4.76837158203125 \cdot 10^{-7} \cdot x2, \left(4.76837158203125 \cdot 10^{-7} \cdot y1\right) \cdot \frac{x1}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128
Derivation
  1. Initial program 77.8%

    \[\left(\left(\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \]
  2. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \left(\left(\color{blue}{\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2}} \cdot 128\right) \cdot 128\right) \cdot 128 \]
    2. mult-flipN/A

      \[\leadsto \left(\left(\color{blue}{\left(\left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2\right) \cdot \frac{1}{y1 + y2}\right)} \cdot 128\right) \cdot 128\right) \cdot 128 \]
    3. *-commutativeN/A

      \[\leadsto \left(\left(\color{blue}{\left(\frac{1}{y1 + y2} \cdot \left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2\right)\right)} \cdot 128\right) \cdot 128\right) \cdot 128 \]
    4. lift-+.f64N/A

      \[\leadsto \left(\left(\left(\frac{1}{y1 + y2} \cdot \color{blue}{\left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2\right)}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    5. +-commutativeN/A

      \[\leadsto \left(\left(\left(\frac{1}{y1 + y2} \cdot \color{blue}{\left(\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2 + \frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1\right)}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    6. distribute-lft-inN/A

      \[\leadsto \left(\left(\color{blue}{\left(\frac{1}{y1 + y2} \cdot \left(\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2\right) + \frac{1}{y1 + y2} \cdot \left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1\right)\right)} \cdot 128\right) \cdot 128\right) \cdot 128 \]
    7. *-commutativeN/A

      \[\leadsto \left(\left(\left(\color{blue}{\left(\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2\right) \cdot \frac{1}{y1 + y2}} + \frac{1}{y1 + y2} \cdot \left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1\right)\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    8. mult-flipN/A

      \[\leadsto \left(\left(\left(\color{blue}{\frac{\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2}} + \frac{1}{y1 + y2} \cdot \left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1\right)\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    9. lift-*.f64N/A

      \[\leadsto \left(\left(\left(\frac{\color{blue}{\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}}{y1 + y2} + \frac{1}{y1 + y2} \cdot \left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1\right)\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    10. associate-/l*N/A

      \[\leadsto \left(\left(\left(\color{blue}{\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot \frac{y2}{y1 + y2}} + \frac{1}{y1 + y2} \cdot \left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1\right)\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    11. *-commutativeN/A

      \[\leadsto \left(\left(\left(\color{blue}{\frac{y2}{y1 + y2} \cdot \frac{x2}{\left(128 \cdot 128\right) \cdot 128}} + \frac{1}{y1 + y2} \cdot \left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1\right)\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    12. *-commutativeN/A

      \[\leadsto \left(\left(\left(\frac{y2}{y1 + y2} \cdot \frac{x2}{\left(128 \cdot 128\right) \cdot 128} + \color{blue}{\left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1\right) \cdot \frac{1}{y1 + y2}}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    13. mult-flipN/A

      \[\leadsto \left(\left(\left(\frac{y2}{y1 + y2} \cdot \frac{x2}{\left(128 \cdot 128\right) \cdot 128} + \color{blue}{\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1}{y1 + y2}}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
  3. Applied rewrites99.6%

    \[\leadsto \left(\left(\color{blue}{\mathsf{fma}\left(\frac{y2}{y2 + y1}, 4.76837158203125 \cdot 10^{-7} \cdot x2, \left(4.76837158203125 \cdot 10^{-7} \cdot y1\right) \cdot \frac{x1}{y2 + y1}\right)} \cdot 128\right) \cdot 128\right) \cdot 128 \]
  4. Add Preprocessing

Alternative 3: 99.6% accurate, 1.2× speedup?

\[\left(\left(\mathsf{fma}\left(\frac{y1}{y2 + y1}, 4.76837158203125 \cdot 10^{-7} \cdot x1, \left(4.76837158203125 \cdot 10^{-7} \cdot y2\right) \cdot \frac{x2}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
(FPCore (x1 y1 x2 y2)
  :precision binary64
  (*
 (*
  (*
   (fma
    (/ y1 (+ y2 y1))
    (* 4.76837158203125e-7 x1)
    (* (* 4.76837158203125e-7 y2) (/ x2 (+ y2 y1))))
   128.0)
  128.0)
 128.0))
double code(double x1, double y1, double x2, double y2) {
	return ((fma((y1 / (y2 + y1)), (4.76837158203125e-7 * x1), ((4.76837158203125e-7 * y2) * (x2 / (y2 + y1)))) * 128.0) * 128.0) * 128.0;
}
function code(x1, y1, x2, y2)
	return Float64(Float64(Float64(fma(Float64(y1 / Float64(y2 + y1)), Float64(4.76837158203125e-7 * x1), Float64(Float64(4.76837158203125e-7 * y2) * Float64(x2 / Float64(y2 + y1)))) * 128.0) * 128.0) * 128.0)
end
code[x1_, y1_, x2_, y2_] := N[(N[(N[(N[(N[(y1 / N[(y2 + y1), $MachinePrecision]), $MachinePrecision] * N[(4.76837158203125e-7 * x1), $MachinePrecision] + N[(N[(4.76837158203125e-7 * y2), $MachinePrecision] * N[(x2 / N[(y2 + y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision]
\left(\left(\mathsf{fma}\left(\frac{y1}{y2 + y1}, 4.76837158203125 \cdot 10^{-7} \cdot x1, \left(4.76837158203125 \cdot 10^{-7} \cdot y2\right) \cdot \frac{x2}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128
Derivation
  1. Initial program 77.8%

    \[\left(\left(\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \]
  2. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \left(\left(\color{blue}{\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2}} \cdot 128\right) \cdot 128\right) \cdot 128 \]
    2. lift-+.f64N/A

      \[\leadsto \left(\left(\frac{\color{blue}{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \]
    3. div-addN/A

      \[\leadsto \left(\left(\color{blue}{\left(\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1}{y1 + y2} + \frac{\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2}\right)} \cdot 128\right) \cdot 128\right) \cdot 128 \]
    4. mult-flipN/A

      \[\leadsto \left(\left(\left(\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1}{y1 + y2} + \color{blue}{\left(\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2\right) \cdot \frac{1}{y1 + y2}}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    5. lift-*.f64N/A

      \[\leadsto \left(\left(\left(\frac{\color{blue}{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1}}{y1 + y2} + \left(\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2\right) \cdot \frac{1}{y1 + y2}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    6. associate-/l*N/A

      \[\leadsto \left(\left(\left(\color{blue}{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot \frac{y1}{y1 + y2}} + \left(\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2\right) \cdot \frac{1}{y1 + y2}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    7. *-commutativeN/A

      \[\leadsto \left(\left(\left(\color{blue}{\frac{y1}{y1 + y2} \cdot \frac{x1}{\left(128 \cdot 128\right) \cdot 128}} + \left(\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2\right) \cdot \frac{1}{y1 + y2}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    8. mult-flipN/A

      \[\leadsto \left(\left(\left(\frac{y1}{y1 + y2} \cdot \frac{x1}{\left(128 \cdot 128\right) \cdot 128} + \color{blue}{\frac{\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2}}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    9. lower-fma.f64N/A

      \[\leadsto \left(\left(\color{blue}{\mathsf{fma}\left(\frac{y1}{y1 + y2}, \frac{x1}{\left(128 \cdot 128\right) \cdot 128}, \frac{\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2}\right)} \cdot 128\right) \cdot 128\right) \cdot 128 \]
  3. Applied rewrites99.6%

    \[\leadsto \left(\left(\color{blue}{\mathsf{fma}\left(\frac{y1}{y2 + y1}, 4.76837158203125 \cdot 10^{-7} \cdot x1, \left(4.76837158203125 \cdot 10^{-7} \cdot y2\right) \cdot \frac{x2}{y2 + y1}\right)} \cdot 128\right) \cdot 128\right) \cdot 128 \]
  4. Add Preprocessing

Alternative 4: 91.8% accurate, 0.6× speedup?

\[\begin{array}{l} t_0 := \left(128 \cdot 128\right) \cdot 128\\ \mathbf{if}\;\left(\left(\frac{\frac{x1}{t\_0} \cdot y1 + \frac{x2}{t\_0} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \leq 0:\\ \;\;\;\;\left(\left(\mathsf{fma}\left(1, 4.76837158203125 \cdot 10^{-7} \cdot x2, \left(4.76837158203125 \cdot 10^{-7} \cdot y1\right) \cdot \frac{x1}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot y2}{y1 + y2}\\ \end{array} \]
(FPCore (x1 y1 x2 y2)
  :precision binary64
  (let* ((t_0 (* (* 128.0 128.0) 128.0)))
  (if (<=
       (*
        (*
         (*
          (/ (+ (* (/ x1 t_0) y1) (* (/ x2 t_0) y2)) (+ y1 y2))
          128.0)
         128.0)
        128.0)
       0.0)
    (*
     (*
      (*
       (fma
        1.0
        (* 4.76837158203125e-7 x2)
        (* (* 4.76837158203125e-7 y1) (/ x1 (+ y2 y1))))
       128.0)
      128.0)
     128.0)
    (+ (/ (* x1 y1) (+ y1 y2)) (/ (* x2 y2) (+ y1 y2))))))
double code(double x1, double y1, double x2, double y2) {
	double t_0 = (128.0 * 128.0) * 128.0;
	double tmp;
	if ((((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0) <= 0.0) {
		tmp = ((fma(1.0, (4.76837158203125e-7 * x2), ((4.76837158203125e-7 * y1) * (x1 / (y2 + y1)))) * 128.0) * 128.0) * 128.0;
	} else {
		tmp = ((x1 * y1) / (y1 + y2)) + ((x2 * y2) / (y1 + y2));
	}
	return tmp;
}
function code(x1, y1, x2, y2)
	t_0 = Float64(Float64(128.0 * 128.0) * 128.0)
	tmp = 0.0
	if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(x1 / t_0) * y1) + Float64(Float64(x2 / t_0) * y2)) / Float64(y1 + y2)) * 128.0) * 128.0) * 128.0) <= 0.0)
		tmp = Float64(Float64(Float64(fma(1.0, Float64(4.76837158203125e-7 * x2), Float64(Float64(4.76837158203125e-7 * y1) * Float64(x1 / Float64(y2 + y1)))) * 128.0) * 128.0) * 128.0);
	else
		tmp = Float64(Float64(Float64(x1 * y1) / Float64(y1 + y2)) + Float64(Float64(x2 * y2) / Float64(y1 + y2)));
	end
	return tmp
end
code[x1_, y1_, x2_, y2_] := Block[{t$95$0 = N[(N[(128.0 * 128.0), $MachinePrecision] * 128.0), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(N[(N[(x1 / t$95$0), $MachinePrecision] * y1), $MachinePrecision] + N[(N[(x2 / t$95$0), $MachinePrecision] * y2), $MachinePrecision]), $MachinePrecision] / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision], 0.0], N[(N[(N[(N[(1.0 * N[(4.76837158203125e-7 * x2), $MachinePrecision] + N[(N[(4.76837158203125e-7 * y1), $MachinePrecision] * N[(x1 / N[(y2 + y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision], N[(N[(N[(x1 * y1), $MachinePrecision] / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * y2), $MachinePrecision] / N[(y1 + y2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left(128 \cdot 128\right) \cdot 128\\
\mathbf{if}\;\left(\left(\frac{\frac{x1}{t\_0} \cdot y1 + \frac{x2}{t\_0} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \leq 0:\\
\;\;\;\;\left(\left(\mathsf{fma}\left(1, 4.76837158203125 \cdot 10^{-7} \cdot x2, \left(4.76837158203125 \cdot 10^{-7} \cdot y1\right) \cdot \frac{x1}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128\\

\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot y2}{y1 + y2}\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (*.f64 (/.f64 (+.f64 (*.f64 (/.f64 x1 (*.f64 (*.f64 #s(literal 128 binary64) #s(literal 128 binary64)) #s(literal 128 binary64))) y1) (*.f64 (/.f64 x2 (*.f64 (*.f64 #s(literal 128 binary64) #s(literal 128 binary64)) #s(literal 128 binary64))) y2)) (+.f64 y1 y2)) #s(literal 128 binary64)) #s(literal 128 binary64)) #s(literal 128 binary64)) < 0.0

    1. Initial program 77.8%

      \[\left(\left(\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left(\left(\color{blue}{\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2}} \cdot 128\right) \cdot 128\right) \cdot 128 \]
      2. mult-flipN/A

        \[\leadsto \left(\left(\color{blue}{\left(\left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2\right) \cdot \frac{1}{y1 + y2}\right)} \cdot 128\right) \cdot 128\right) \cdot 128 \]
      3. *-commutativeN/A

        \[\leadsto \left(\left(\color{blue}{\left(\frac{1}{y1 + y2} \cdot \left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2\right)\right)} \cdot 128\right) \cdot 128\right) \cdot 128 \]
      4. lift-+.f64N/A

        \[\leadsto \left(\left(\left(\frac{1}{y1 + y2} \cdot \color{blue}{\left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2\right)}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
      5. +-commutativeN/A

        \[\leadsto \left(\left(\left(\frac{1}{y1 + y2} \cdot \color{blue}{\left(\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2 + \frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1\right)}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
      6. distribute-lft-inN/A

        \[\leadsto \left(\left(\color{blue}{\left(\frac{1}{y1 + y2} \cdot \left(\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2\right) + \frac{1}{y1 + y2} \cdot \left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1\right)\right)} \cdot 128\right) \cdot 128\right) \cdot 128 \]
      7. *-commutativeN/A

        \[\leadsto \left(\left(\left(\color{blue}{\left(\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2\right) \cdot \frac{1}{y1 + y2}} + \frac{1}{y1 + y2} \cdot \left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1\right)\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
      8. mult-flipN/A

        \[\leadsto \left(\left(\left(\color{blue}{\frac{\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2}} + \frac{1}{y1 + y2} \cdot \left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1\right)\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
      9. lift-*.f64N/A

        \[\leadsto \left(\left(\left(\frac{\color{blue}{\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}}{y1 + y2} + \frac{1}{y1 + y2} \cdot \left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1\right)\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
      10. associate-/l*N/A

        \[\leadsto \left(\left(\left(\color{blue}{\frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot \frac{y2}{y1 + y2}} + \frac{1}{y1 + y2} \cdot \left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1\right)\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
      11. *-commutativeN/A

        \[\leadsto \left(\left(\left(\color{blue}{\frac{y2}{y1 + y2} \cdot \frac{x2}{\left(128 \cdot 128\right) \cdot 128}} + \frac{1}{y1 + y2} \cdot \left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1\right)\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
      12. *-commutativeN/A

        \[\leadsto \left(\left(\left(\frac{y2}{y1 + y2} \cdot \frac{x2}{\left(128 \cdot 128\right) \cdot 128} + \color{blue}{\left(\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1\right) \cdot \frac{1}{y1 + y2}}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
      13. mult-flipN/A

        \[\leadsto \left(\left(\left(\frac{y2}{y1 + y2} \cdot \frac{x2}{\left(128 \cdot 128\right) \cdot 128} + \color{blue}{\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1}{y1 + y2}}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    3. Applied rewrites99.6%

      \[\leadsto \left(\left(\color{blue}{\mathsf{fma}\left(\frac{y2}{y2 + y1}, 4.76837158203125 \cdot 10^{-7} \cdot x2, \left(4.76837158203125 \cdot 10^{-7} \cdot y1\right) \cdot \frac{x1}{y2 + y1}\right)} \cdot 128\right) \cdot 128\right) \cdot 128 \]
    4. Taylor expanded in y1 around 0

      \[\leadsto \left(\left(\mathsf{fma}\left(\color{blue}{1}, 4.76837158203125 \cdot 10^{-7} \cdot x2, \left(4.76837158203125 \cdot 10^{-7} \cdot y1\right) \cdot \frac{x1}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]
    5. Step-by-step derivation
      1. Applied rewrites74.8%

        \[\leadsto \left(\left(\mathsf{fma}\left(\color{blue}{1}, 4.76837158203125 \cdot 10^{-7} \cdot x2, \left(4.76837158203125 \cdot 10^{-7} \cdot y1\right) \cdot \frac{x1}{y2 + y1}\right) \cdot 128\right) \cdot 128\right) \cdot 128 \]

      if 0.0 < (*.f64 (*.f64 (*.f64 (/.f64 (+.f64 (*.f64 (/.f64 x1 (*.f64 (*.f64 #s(literal 128 binary64) #s(literal 128 binary64)) #s(literal 128 binary64))) y1) (*.f64 (/.f64 x2 (*.f64 (*.f64 #s(literal 128 binary64) #s(literal 128 binary64)) #s(literal 128 binary64))) y2)) (+.f64 y1 y2)) #s(literal 128 binary64)) #s(literal 128 binary64)) #s(literal 128 binary64))

      1. Initial program 77.8%

        \[\left(\left(\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \]
      2. Taylor expanded in x1 around 0

        \[\leadsto \color{blue}{\frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot y2}{y1 + y2}} \]
      3. Step-by-step derivation
        1. lower-+.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{y1 + y2} + \color{blue}{\frac{x2 \cdot y2}{y1 + y2}} \]
        2. lower-/.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{y1 + y2} + \frac{\color{blue}{x2 \cdot y2}}{y1 + y2} \]
        3. lower-*.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{y1 + y2} + \frac{\color{blue}{x2} \cdot y2}{y1 + y2} \]
        4. lower-+.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot \color{blue}{y2}}{y1 + y2} \]
        5. lower-/.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot y2}{\color{blue}{y1 + y2}} \]
        6. lower-*.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot y2}{\color{blue}{y1} + y2} \]
        7. lower-+.f6479.5%

          \[\leadsto \frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot y2}{y1 + \color{blue}{y2}} \]
      4. Applied rewrites79.5%

        \[\leadsto \color{blue}{\frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot y2}{y1 + y2}} \]
    6. Recombined 2 regimes into one program.
    7. Add Preprocessing

    Alternative 5: 87.7% accurate, 0.6× speedup?

    \[\begin{array}{l} t_0 := \left(128 \cdot 128\right) \cdot 128\\ \mathbf{if}\;\left(\left(\frac{\frac{x1}{t\_0} \cdot y1 + \frac{x2}{t\_0} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \leq 2 \cdot 10^{-265}:\\ \;\;\;\;\frac{y1}{y1 + y2} \cdot x1\\ \mathbf{else}:\\ \;\;\;\;\frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot y2}{y1 + y2}\\ \end{array} \]
    (FPCore (x1 y1 x2 y2)
      :precision binary64
      (let* ((t_0 (* (* 128.0 128.0) 128.0)))
      (if (<=
           (*
            (*
             (*
              (/ (+ (* (/ x1 t_0) y1) (* (/ x2 t_0) y2)) (+ y1 y2))
              128.0)
             128.0)
            128.0)
           2e-265)
        (* (/ y1 (+ y1 y2)) x1)
        (+ (/ (* x1 y1) (+ y1 y2)) (/ (* x2 y2) (+ y1 y2))))))
    double code(double x1, double y1, double x2, double y2) {
    	double t_0 = (128.0 * 128.0) * 128.0;
    	double tmp;
    	if ((((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0) <= 2e-265) {
    		tmp = (y1 / (y1 + y2)) * x1;
    	} else {
    		tmp = ((x1 * y1) / (y1 + y2)) + ((x2 * y2) / (y1 + y2));
    	}
    	return tmp;
    }
    
    real(8) function code(x1, y1, x2, y2)
        real(8), intent (in) :: x1
        real(8), intent (in) :: y1
        real(8), intent (in) :: x2
        real(8), intent (in) :: y2
        real(8) :: t_0
        real(8) :: tmp
        t_0 = (128.0d0 * 128.0d0) * 128.0d0
        if ((((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0d0) * 128.0d0) * 128.0d0) <= 2d-265) then
            tmp = (y1 / (y1 + y2)) * x1
        else
            tmp = ((x1 * y1) / (y1 + y2)) + ((x2 * y2) / (y1 + y2))
        end if
        code = tmp
    end function
    
    public static double code(double x1, double y1, double x2, double y2) {
    	double t_0 = (128.0 * 128.0) * 128.0;
    	double tmp;
    	if ((((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0) <= 2e-265) {
    		tmp = (y1 / (y1 + y2)) * x1;
    	} else {
    		tmp = ((x1 * y1) / (y1 + y2)) + ((x2 * y2) / (y1 + y2));
    	}
    	return tmp;
    }
    
    def code(x1, y1, x2, y2):
    	t_0 = (128.0 * 128.0) * 128.0
    	tmp = 0
    	if (((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0) <= 2e-265:
    		tmp = (y1 / (y1 + y2)) * x1
    	else:
    		tmp = ((x1 * y1) / (y1 + y2)) + ((x2 * y2) / (y1 + y2))
    	return tmp
    
    function code(x1, y1, x2, y2)
    	t_0 = Float64(Float64(128.0 * 128.0) * 128.0)
    	tmp = 0.0
    	if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(x1 / t_0) * y1) + Float64(Float64(x2 / t_0) * y2)) / Float64(y1 + y2)) * 128.0) * 128.0) * 128.0) <= 2e-265)
    		tmp = Float64(Float64(y1 / Float64(y1 + y2)) * x1);
    	else
    		tmp = Float64(Float64(Float64(x1 * y1) / Float64(y1 + y2)) + Float64(Float64(x2 * y2) / Float64(y1 + y2)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x1, y1, x2, y2)
    	t_0 = (128.0 * 128.0) * 128.0;
    	tmp = 0.0;
    	if ((((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0) <= 2e-265)
    		tmp = (y1 / (y1 + y2)) * x1;
    	else
    		tmp = ((x1 * y1) / (y1 + y2)) + ((x2 * y2) / (y1 + y2));
    	end
    	tmp_2 = tmp;
    end
    
    code[x1_, y1_, x2_, y2_] := Block[{t$95$0 = N[(N[(128.0 * 128.0), $MachinePrecision] * 128.0), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(N[(N[(x1 / t$95$0), $MachinePrecision] * y1), $MachinePrecision] + N[(N[(x2 / t$95$0), $MachinePrecision] * y2), $MachinePrecision]), $MachinePrecision] / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision], 2e-265], N[(N[(y1 / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] * x1), $MachinePrecision], N[(N[(N[(x1 * y1), $MachinePrecision] / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * y2), $MachinePrecision] / N[(y1 + y2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    t_0 := \left(128 \cdot 128\right) \cdot 128\\
    \mathbf{if}\;\left(\left(\frac{\frac{x1}{t\_0} \cdot y1 + \frac{x2}{t\_0} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \leq 2 \cdot 10^{-265}:\\
    \;\;\;\;\frac{y1}{y1 + y2} \cdot x1\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot y2}{y1 + y2}\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 (*.f64 (*.f64 (/.f64 (+.f64 (*.f64 (/.f64 x1 (*.f64 (*.f64 #s(literal 128 binary64) #s(literal 128 binary64)) #s(literal 128 binary64))) y1) (*.f64 (/.f64 x2 (*.f64 (*.f64 #s(literal 128 binary64) #s(literal 128 binary64)) #s(literal 128 binary64))) y2)) (+.f64 y1 y2)) #s(literal 128 binary64)) #s(literal 128 binary64)) #s(literal 128 binary64)) < 2e-265

      1. Initial program 77.8%

        \[\left(\left(\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \]
      2. Taylor expanded in x1 around inf

        \[\leadsto \color{blue}{\frac{x1 \cdot y1}{y1 + y2}} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{\color{blue}{y1 + y2}} \]
        2. lower-*.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{\color{blue}{y1} + y2} \]
        3. lower-+.f6442.1%

          \[\leadsto \frac{x1 \cdot y1}{y1 + \color{blue}{y2}} \]
      4. Applied rewrites42.1%

        \[\leadsto \color{blue}{\frac{x1 \cdot y1}{y1 + y2}} \]
      5. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{\color{blue}{y1 + y2}} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{\color{blue}{y1} + y2} \]
        3. associate-/l*N/A

          \[\leadsto x1 \cdot \color{blue}{\frac{y1}{y1 + y2}} \]
        4. lift-/.f64N/A

          \[\leadsto x1 \cdot \frac{y1}{\color{blue}{y1 + y2}} \]
        5. *-commutativeN/A

          \[\leadsto \frac{y1}{y1 + y2} \cdot \color{blue}{x1} \]
        6. lower-*.f6451.6%

          \[\leadsto \frac{y1}{y1 + y2} \cdot \color{blue}{x1} \]
      6. Applied rewrites51.6%

        \[\leadsto \frac{y1}{y1 + y2} \cdot \color{blue}{x1} \]

      if 2e-265 < (*.f64 (*.f64 (*.f64 (/.f64 (+.f64 (*.f64 (/.f64 x1 (*.f64 (*.f64 #s(literal 128 binary64) #s(literal 128 binary64)) #s(literal 128 binary64))) y1) (*.f64 (/.f64 x2 (*.f64 (*.f64 #s(literal 128 binary64) #s(literal 128 binary64)) #s(literal 128 binary64))) y2)) (+.f64 y1 y2)) #s(literal 128 binary64)) #s(literal 128 binary64)) #s(literal 128 binary64))

      1. Initial program 77.8%

        \[\left(\left(\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \]
      2. Taylor expanded in x1 around 0

        \[\leadsto \color{blue}{\frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot y2}{y1 + y2}} \]
      3. Step-by-step derivation
        1. lower-+.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{y1 + y2} + \color{blue}{\frac{x2 \cdot y2}{y1 + y2}} \]
        2. lower-/.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{y1 + y2} + \frac{\color{blue}{x2 \cdot y2}}{y1 + y2} \]
        3. lower-*.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{y1 + y2} + \frac{\color{blue}{x2} \cdot y2}{y1 + y2} \]
        4. lower-+.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot \color{blue}{y2}}{y1 + y2} \]
        5. lower-/.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot y2}{\color{blue}{y1 + y2}} \]
        6. lower-*.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot y2}{\color{blue}{y1} + y2} \]
        7. lower-+.f6479.5%

          \[\leadsto \frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot y2}{y1 + \color{blue}{y2}} \]
      4. Applied rewrites79.5%

        \[\leadsto \color{blue}{\frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot y2}{y1 + y2}} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 6: 87.7% accurate, 0.7× speedup?

    \[\begin{array}{l} t_0 := \left(128 \cdot 128\right) \cdot 128\\ \mathbf{if}\;\left(\left(\frac{\frac{x1}{t\_0} \cdot y1 + \frac{x2}{t\_0} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \leq 2 \cdot 10^{-265}:\\ \;\;\;\;\frac{y1}{y1 + y2} \cdot x1\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x1, y1, x2 \cdot y2\right)}{y1 + y2}\\ \end{array} \]
    (FPCore (x1 y1 x2 y2)
      :precision binary64
      (let* ((t_0 (* (* 128.0 128.0) 128.0)))
      (if (<=
           (*
            (*
             (*
              (/ (+ (* (/ x1 t_0) y1) (* (/ x2 t_0) y2)) (+ y1 y2))
              128.0)
             128.0)
            128.0)
           2e-265)
        (* (/ y1 (+ y1 y2)) x1)
        (/ (fma x1 y1 (* x2 y2)) (+ y1 y2)))))
    double code(double x1, double y1, double x2, double y2) {
    	double t_0 = (128.0 * 128.0) * 128.0;
    	double tmp;
    	if ((((((((x1 / t_0) * y1) + ((x2 / t_0) * y2)) / (y1 + y2)) * 128.0) * 128.0) * 128.0) <= 2e-265) {
    		tmp = (y1 / (y1 + y2)) * x1;
    	} else {
    		tmp = fma(x1, y1, (x2 * y2)) / (y1 + y2);
    	}
    	return tmp;
    }
    
    function code(x1, y1, x2, y2)
    	t_0 = Float64(Float64(128.0 * 128.0) * 128.0)
    	tmp = 0.0
    	if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(x1 / t_0) * y1) + Float64(Float64(x2 / t_0) * y2)) / Float64(y1 + y2)) * 128.0) * 128.0) * 128.0) <= 2e-265)
    		tmp = Float64(Float64(y1 / Float64(y1 + y2)) * x1);
    	else
    		tmp = Float64(fma(x1, y1, Float64(x2 * y2)) / Float64(y1 + y2));
    	end
    	return tmp
    end
    
    code[x1_, y1_, x2_, y2_] := Block[{t$95$0 = N[(N[(128.0 * 128.0), $MachinePrecision] * 128.0), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(N[(N[(x1 / t$95$0), $MachinePrecision] * y1), $MachinePrecision] + N[(N[(x2 / t$95$0), $MachinePrecision] * y2), $MachinePrecision]), $MachinePrecision] / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision] * 128.0), $MachinePrecision], 2e-265], N[(N[(y1 / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] * x1), $MachinePrecision], N[(N[(x1 * y1 + N[(x2 * y2), $MachinePrecision]), $MachinePrecision] / N[(y1 + y2), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    t_0 := \left(128 \cdot 128\right) \cdot 128\\
    \mathbf{if}\;\left(\left(\frac{\frac{x1}{t\_0} \cdot y1 + \frac{x2}{t\_0} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \leq 2 \cdot 10^{-265}:\\
    \;\;\;\;\frac{y1}{y1 + y2} \cdot x1\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\mathsf{fma}\left(x1, y1, x2 \cdot y2\right)}{y1 + y2}\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 (*.f64 (*.f64 (/.f64 (+.f64 (*.f64 (/.f64 x1 (*.f64 (*.f64 #s(literal 128 binary64) #s(literal 128 binary64)) #s(literal 128 binary64))) y1) (*.f64 (/.f64 x2 (*.f64 (*.f64 #s(literal 128 binary64) #s(literal 128 binary64)) #s(literal 128 binary64))) y2)) (+.f64 y1 y2)) #s(literal 128 binary64)) #s(literal 128 binary64)) #s(literal 128 binary64)) < 2e-265

      1. Initial program 77.8%

        \[\left(\left(\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \]
      2. Taylor expanded in x1 around inf

        \[\leadsto \color{blue}{\frac{x1 \cdot y1}{y1 + y2}} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{\color{blue}{y1 + y2}} \]
        2. lower-*.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{\color{blue}{y1} + y2} \]
        3. lower-+.f6442.1%

          \[\leadsto \frac{x1 \cdot y1}{y1 + \color{blue}{y2}} \]
      4. Applied rewrites42.1%

        \[\leadsto \color{blue}{\frac{x1 \cdot y1}{y1 + y2}} \]
      5. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{\color{blue}{y1 + y2}} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{\color{blue}{y1} + y2} \]
        3. associate-/l*N/A

          \[\leadsto x1 \cdot \color{blue}{\frac{y1}{y1 + y2}} \]
        4. lift-/.f64N/A

          \[\leadsto x1 \cdot \frac{y1}{\color{blue}{y1 + y2}} \]
        5. *-commutativeN/A

          \[\leadsto \frac{y1}{y1 + y2} \cdot \color{blue}{x1} \]
        6. lower-*.f6451.6%

          \[\leadsto \frac{y1}{y1 + y2} \cdot \color{blue}{x1} \]
      6. Applied rewrites51.6%

        \[\leadsto \frac{y1}{y1 + y2} \cdot \color{blue}{x1} \]

      if 2e-265 < (*.f64 (*.f64 (*.f64 (/.f64 (+.f64 (*.f64 (/.f64 x1 (*.f64 (*.f64 #s(literal 128 binary64) #s(literal 128 binary64)) #s(literal 128 binary64))) y1) (*.f64 (/.f64 x2 (*.f64 (*.f64 #s(literal 128 binary64) #s(literal 128 binary64)) #s(literal 128 binary64))) y2)) (+.f64 y1 y2)) #s(literal 128 binary64)) #s(literal 128 binary64)) #s(literal 128 binary64))

      1. Initial program 77.8%

        \[\left(\left(\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \]
      2. Taylor expanded in x1 around 0

        \[\leadsto \color{blue}{\frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot y2}{y1 + y2}} \]
      3. Step-by-step derivation
        1. lower-+.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{y1 + y2} + \color{blue}{\frac{x2 \cdot y2}{y1 + y2}} \]
        2. lower-/.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{y1 + y2} + \frac{\color{blue}{x2 \cdot y2}}{y1 + y2} \]
        3. lower-*.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{y1 + y2} + \frac{\color{blue}{x2} \cdot y2}{y1 + y2} \]
        4. lower-+.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot \color{blue}{y2}}{y1 + y2} \]
        5. lower-/.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot y2}{\color{blue}{y1 + y2}} \]
        6. lower-*.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot y2}{\color{blue}{y1} + y2} \]
        7. lower-+.f6479.5%

          \[\leadsto \frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot y2}{y1 + \color{blue}{y2}} \]
      4. Applied rewrites79.5%

        \[\leadsto \color{blue}{\frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot y2}{y1 + y2}} \]
      5. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{y1 + y2} + \color{blue}{\frac{x2 \cdot y2}{y1 + y2}} \]
        2. lift-/.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{y1 + y2} + \frac{\color{blue}{x2 \cdot y2}}{y1 + y2} \]
        3. lift-/.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{y1 + y2} + \frac{x2 \cdot y2}{\color{blue}{y1 + y2}} \]
        4. div-add-revN/A

          \[\leadsto \frac{x1 \cdot y1 + x2 \cdot y2}{\color{blue}{y1 + y2}} \]
        5. lower-/.f64N/A

          \[\leadsto \frac{x1 \cdot y1 + x2 \cdot y2}{\color{blue}{y1 + y2}} \]
        6. lift-*.f64N/A

          \[\leadsto \frac{x1 \cdot y1 + x2 \cdot y2}{y1 + y2} \]
        7. lower-fma.f6479.5%

          \[\leadsto \frac{\mathsf{fma}\left(x1, y1, x2 \cdot y2\right)}{\color{blue}{y1} + y2} \]
      6. Applied rewrites79.5%

        \[\leadsto \frac{\mathsf{fma}\left(x1, y1, x2 \cdot y2\right)}{\color{blue}{y1 + y2}} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 7: 71.6% accurate, 3.1× speedup?

    \[\begin{array}{l} \mathbf{if}\;y2 \leq 9.5 \cdot 10^{-140}:\\ \;\;\;\;x1 + y2 \cdot \frac{x2}{y1}\\ \mathbf{else}:\\ \;\;\;\;\frac{y2}{y1 + y2} \cdot x2\\ \end{array} \]
    (FPCore (x1 y1 x2 y2)
      :precision binary64
      (if (<= y2 9.5e-140) (+ x1 (* y2 (/ x2 y1))) (* (/ y2 (+ y1 y2)) x2)))
    double code(double x1, double y1, double x2, double y2) {
    	double tmp;
    	if (y2 <= 9.5e-140) {
    		tmp = x1 + (y2 * (x2 / y1));
    	} else {
    		tmp = (y2 / (y1 + y2)) * x2;
    	}
    	return tmp;
    }
    
    real(8) function code(x1, y1, x2, y2)
        real(8), intent (in) :: x1
        real(8), intent (in) :: y1
        real(8), intent (in) :: x2
        real(8), intent (in) :: y2
        real(8) :: tmp
        if (y2 <= 9.5d-140) then
            tmp = x1 + (y2 * (x2 / y1))
        else
            tmp = (y2 / (y1 + y2)) * x2
        end if
        code = tmp
    end function
    
    public static double code(double x1, double y1, double x2, double y2) {
    	double tmp;
    	if (y2 <= 9.5e-140) {
    		tmp = x1 + (y2 * (x2 / y1));
    	} else {
    		tmp = (y2 / (y1 + y2)) * x2;
    	}
    	return tmp;
    }
    
    def code(x1, y1, x2, y2):
    	tmp = 0
    	if y2 <= 9.5e-140:
    		tmp = x1 + (y2 * (x2 / y1))
    	else:
    		tmp = (y2 / (y1 + y2)) * x2
    	return tmp
    
    function code(x1, y1, x2, y2)
    	tmp = 0.0
    	if (y2 <= 9.5e-140)
    		tmp = Float64(x1 + Float64(y2 * Float64(x2 / y1)));
    	else
    		tmp = Float64(Float64(y2 / Float64(y1 + y2)) * x2);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x1, y1, x2, y2)
    	tmp = 0.0;
    	if (y2 <= 9.5e-140)
    		tmp = x1 + (y2 * (x2 / y1));
    	else
    		tmp = (y2 / (y1 + y2)) * x2;
    	end
    	tmp_2 = tmp;
    end
    
    code[x1_, y1_, x2_, y2_] := If[LessEqual[y2, 9.5e-140], N[(x1 + N[(y2 * N[(x2 / y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y2 / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] * x2), $MachinePrecision]]
    
    \begin{array}{l}
    \mathbf{if}\;y2 \leq 9.5 \cdot 10^{-140}:\\
    \;\;\;\;x1 + y2 \cdot \frac{x2}{y1}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{y2}{y1 + y2} \cdot x2\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y2 < 9.5000000000000002e-140

      1. Initial program 77.8%

        \[\left(\left(\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \]
      2. Taylor expanded in y1 around inf

        \[\leadsto \color{blue}{x1 + 2097152 \cdot \frac{\frac{1}{2097152} \cdot \left(x2 \cdot y2\right) - \frac{1}{2097152} \cdot \left(x1 \cdot y2\right)}{y1}} \]
      3. Step-by-step derivation
        1. metadata-evalN/A

          \[\leadsto x1 + \left(16384 \cdot 128\right) \cdot \frac{\color{blue}{\frac{1}{2097152} \cdot \left(x2 \cdot y2\right) - \frac{1}{2097152} \cdot \left(x1 \cdot y2\right)}}{y1} \]
        2. metadata-evalN/A

          \[\leadsto x1 + \left(\left(128 \cdot 128\right) \cdot 128\right) \cdot \frac{\color{blue}{\frac{1}{2097152} \cdot \left(x2 \cdot y2\right)} - \frac{1}{2097152} \cdot \left(x1 \cdot y2\right)}{y1} \]
        3. lower-+.f64N/A

          \[\leadsto x1 + \color{blue}{\left(\left(128 \cdot 128\right) \cdot 128\right) \cdot \frac{\frac{1}{2097152} \cdot \left(x2 \cdot y2\right) - \frac{1}{2097152} \cdot \left(x1 \cdot y2\right)}{y1}} \]
        4. lower-*.f64N/A

          \[\leadsto x1 + \left(\left(128 \cdot 128\right) \cdot 128\right) \cdot \color{blue}{\frac{\frac{1}{2097152} \cdot \left(x2 \cdot y2\right) - \frac{1}{2097152} \cdot \left(x1 \cdot y2\right)}{y1}} \]
        5. metadata-evalN/A

          \[\leadsto x1 + \left(16384 \cdot 128\right) \cdot \frac{\color{blue}{\frac{1}{2097152} \cdot \left(x2 \cdot y2\right)} - \frac{1}{2097152} \cdot \left(x1 \cdot y2\right)}{y1} \]
        6. metadata-evalN/A

          \[\leadsto x1 + 2097152 \cdot \frac{\color{blue}{\frac{1}{2097152} \cdot \left(x2 \cdot y2\right) - \frac{1}{2097152} \cdot \left(x1 \cdot y2\right)}}{y1} \]
        7. lower-/.f64N/A

          \[\leadsto x1 + 2097152 \cdot \frac{\frac{1}{2097152} \cdot \left(x2 \cdot y2\right) - \frac{1}{2097152} \cdot \left(x1 \cdot y2\right)}{\color{blue}{y1}} \]
      4. Applied rewrites47.0%

        \[\leadsto \color{blue}{x1 + 2097152 \cdot \frac{4.76837158203125 \cdot 10^{-7} \cdot \left(x2 \cdot y2\right) - 4.76837158203125 \cdot 10^{-7} \cdot \left(x1 \cdot y2\right)}{y1}} \]
      5. Taylor expanded in x1 around 0

        \[\leadsto x1 + \frac{x2 \cdot y2}{\color{blue}{y1}} \]
      6. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto x1 + \frac{x2 \cdot y2}{y1} \]
        2. lower-*.f6447.8%

          \[\leadsto x1 + \frac{x2 \cdot y2}{y1} \]
      7. Applied rewrites47.8%

        \[\leadsto x1 + \frac{x2 \cdot y2}{\color{blue}{y1}} \]
      8. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto x1 + \frac{x2 \cdot y2}{y1} \]
        2. lift-*.f64N/A

          \[\leadsto x1 + \frac{x2 \cdot y2}{y1} \]
        3. *-commutativeN/A

          \[\leadsto x1 + \frac{y2 \cdot x2}{y1} \]
        4. associate-/l*N/A

          \[\leadsto x1 + y2 \cdot \frac{x2}{\color{blue}{y1}} \]
        5. lift-/.f64N/A

          \[\leadsto x1 + y2 \cdot \frac{x2}{y1} \]
        6. lower-*.f6451.1%

          \[\leadsto x1 + y2 \cdot \frac{x2}{\color{blue}{y1}} \]
      9. Applied rewrites51.1%

        \[\leadsto x1 + y2 \cdot \frac{x2}{\color{blue}{y1}} \]

      if 9.5000000000000002e-140 < y2

      1. Initial program 77.8%

        \[\left(\left(\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \]
      2. Taylor expanded in x1 around 0

        \[\leadsto \color{blue}{\frac{x2 \cdot y2}{y1 + y2}} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \frac{x2 \cdot y2}{\color{blue}{y1 + y2}} \]
        2. lower-*.f64N/A

          \[\leadsto \frac{x2 \cdot y2}{\color{blue}{y1} + y2} \]
        3. lower-+.f6441.4%

          \[\leadsto \frac{x2 \cdot y2}{y1 + \color{blue}{y2}} \]
      4. Applied rewrites41.4%

        \[\leadsto \color{blue}{\frac{x2 \cdot y2}{y1 + y2}} \]
      5. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \frac{x2 \cdot y2}{\color{blue}{y1 + y2}} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{x2 \cdot y2}{\color{blue}{y1} + y2} \]
        3. associate-/l*N/A

          \[\leadsto x2 \cdot \color{blue}{\frac{y2}{y1 + y2}} \]
        4. lift-+.f64N/A

          \[\leadsto x2 \cdot \frac{y2}{y1 + \color{blue}{y2}} \]
        5. +-commutativeN/A

          \[\leadsto x2 \cdot \frac{y2}{y2 + \color{blue}{y1}} \]
        6. lift-+.f64N/A

          \[\leadsto x2 \cdot \frac{y2}{y2 + \color{blue}{y1}} \]
        7. lift-/.f64N/A

          \[\leadsto x2 \cdot \frac{y2}{\color{blue}{y2 + y1}} \]
        8. *-commutativeN/A

          \[\leadsto \frac{y2}{y2 + y1} \cdot \color{blue}{x2} \]
        9. lower-*.f6451.5%

          \[\leadsto \frac{y2}{y2 + y1} \cdot \color{blue}{x2} \]
        10. lift-+.f64N/A

          \[\leadsto \frac{y2}{y2 + y1} \cdot x2 \]
        11. +-commutativeN/A

          \[\leadsto \frac{y2}{y1 + y2} \cdot x2 \]
        12. lift-+.f6451.5%

          \[\leadsto \frac{y2}{y1 + y2} \cdot x2 \]
      6. Applied rewrites51.5%

        \[\leadsto \frac{y2}{y1 + y2} \cdot \color{blue}{x2} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 8: 68.2% accurate, 3.1× speedup?

    \[\begin{array}{l} \mathbf{if}\;y2 \leq 9.5 \cdot 10^{-140}:\\ \;\;\;\;\frac{y1}{y1 + y2} \cdot x1\\ \mathbf{else}:\\ \;\;\;\;\frac{y2}{y1 + y2} \cdot x2\\ \end{array} \]
    (FPCore (x1 y1 x2 y2)
      :precision binary64
      (if (<= y2 9.5e-140) (* (/ y1 (+ y1 y2)) x1) (* (/ y2 (+ y1 y2)) x2)))
    double code(double x1, double y1, double x2, double y2) {
    	double tmp;
    	if (y2 <= 9.5e-140) {
    		tmp = (y1 / (y1 + y2)) * x1;
    	} else {
    		tmp = (y2 / (y1 + y2)) * x2;
    	}
    	return tmp;
    }
    
    real(8) function code(x1, y1, x2, y2)
        real(8), intent (in) :: x1
        real(8), intent (in) :: y1
        real(8), intent (in) :: x2
        real(8), intent (in) :: y2
        real(8) :: tmp
        if (y2 <= 9.5d-140) then
            tmp = (y1 / (y1 + y2)) * x1
        else
            tmp = (y2 / (y1 + y2)) * x2
        end if
        code = tmp
    end function
    
    public static double code(double x1, double y1, double x2, double y2) {
    	double tmp;
    	if (y2 <= 9.5e-140) {
    		tmp = (y1 / (y1 + y2)) * x1;
    	} else {
    		tmp = (y2 / (y1 + y2)) * x2;
    	}
    	return tmp;
    }
    
    def code(x1, y1, x2, y2):
    	tmp = 0
    	if y2 <= 9.5e-140:
    		tmp = (y1 / (y1 + y2)) * x1
    	else:
    		tmp = (y2 / (y1 + y2)) * x2
    	return tmp
    
    function code(x1, y1, x2, y2)
    	tmp = 0.0
    	if (y2 <= 9.5e-140)
    		tmp = Float64(Float64(y1 / Float64(y1 + y2)) * x1);
    	else
    		tmp = Float64(Float64(y2 / Float64(y1 + y2)) * x2);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x1, y1, x2, y2)
    	tmp = 0.0;
    	if (y2 <= 9.5e-140)
    		tmp = (y1 / (y1 + y2)) * x1;
    	else
    		tmp = (y2 / (y1 + y2)) * x2;
    	end
    	tmp_2 = tmp;
    end
    
    code[x1_, y1_, x2_, y2_] := If[LessEqual[y2, 9.5e-140], N[(N[(y1 / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] * x1), $MachinePrecision], N[(N[(y2 / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] * x2), $MachinePrecision]]
    
    \begin{array}{l}
    \mathbf{if}\;y2 \leq 9.5 \cdot 10^{-140}:\\
    \;\;\;\;\frac{y1}{y1 + y2} \cdot x1\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{y2}{y1 + y2} \cdot x2\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y2 < 9.5000000000000002e-140

      1. Initial program 77.8%

        \[\left(\left(\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \]
      2. Taylor expanded in x1 around inf

        \[\leadsto \color{blue}{\frac{x1 \cdot y1}{y1 + y2}} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{\color{blue}{y1 + y2}} \]
        2. lower-*.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{\color{blue}{y1} + y2} \]
        3. lower-+.f6442.1%

          \[\leadsto \frac{x1 \cdot y1}{y1 + \color{blue}{y2}} \]
      4. Applied rewrites42.1%

        \[\leadsto \color{blue}{\frac{x1 \cdot y1}{y1 + y2}} \]
      5. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{\color{blue}{y1 + y2}} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{\color{blue}{y1} + y2} \]
        3. associate-/l*N/A

          \[\leadsto x1 \cdot \color{blue}{\frac{y1}{y1 + y2}} \]
        4. lift-/.f64N/A

          \[\leadsto x1 \cdot \frac{y1}{\color{blue}{y1 + y2}} \]
        5. *-commutativeN/A

          \[\leadsto \frac{y1}{y1 + y2} \cdot \color{blue}{x1} \]
        6. lower-*.f6451.6%

          \[\leadsto \frac{y1}{y1 + y2} \cdot \color{blue}{x1} \]
      6. Applied rewrites51.6%

        \[\leadsto \frac{y1}{y1 + y2} \cdot \color{blue}{x1} \]

      if 9.5000000000000002e-140 < y2

      1. Initial program 77.8%

        \[\left(\left(\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \]
      2. Taylor expanded in x1 around 0

        \[\leadsto \color{blue}{\frac{x2 \cdot y2}{y1 + y2}} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \frac{x2 \cdot y2}{\color{blue}{y1 + y2}} \]
        2. lower-*.f64N/A

          \[\leadsto \frac{x2 \cdot y2}{\color{blue}{y1} + y2} \]
        3. lower-+.f6441.4%

          \[\leadsto \frac{x2 \cdot y2}{y1 + \color{blue}{y2}} \]
      4. Applied rewrites41.4%

        \[\leadsto \color{blue}{\frac{x2 \cdot y2}{y1 + y2}} \]
      5. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \frac{x2 \cdot y2}{\color{blue}{y1 + y2}} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{x2 \cdot y2}{\color{blue}{y1} + y2} \]
        3. associate-/l*N/A

          \[\leadsto x2 \cdot \color{blue}{\frac{y2}{y1 + y2}} \]
        4. lift-+.f64N/A

          \[\leadsto x2 \cdot \frac{y2}{y1 + \color{blue}{y2}} \]
        5. +-commutativeN/A

          \[\leadsto x2 \cdot \frac{y2}{y2 + \color{blue}{y1}} \]
        6. lift-+.f64N/A

          \[\leadsto x2 \cdot \frac{y2}{y2 + \color{blue}{y1}} \]
        7. lift-/.f64N/A

          \[\leadsto x2 \cdot \frac{y2}{\color{blue}{y2 + y1}} \]
        8. *-commutativeN/A

          \[\leadsto \frac{y2}{y2 + y1} \cdot \color{blue}{x2} \]
        9. lower-*.f6451.5%

          \[\leadsto \frac{y2}{y2 + y1} \cdot \color{blue}{x2} \]
        10. lift-+.f64N/A

          \[\leadsto \frac{y2}{y2 + y1} \cdot x2 \]
        11. +-commutativeN/A

          \[\leadsto \frac{y2}{y1 + y2} \cdot x2 \]
        12. lift-+.f6451.5%

          \[\leadsto \frac{y2}{y1 + y2} \cdot x2 \]
      6. Applied rewrites51.5%

        \[\leadsto \frac{y2}{y1 + y2} \cdot \color{blue}{x2} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 9: 68.1% accurate, 3.1× speedup?

    \[\begin{array}{l} \mathbf{if}\;y2 \leq 9.5 \cdot 10^{-140}:\\ \;\;\;\;\frac{y1}{y1 + y2} \cdot x1\\ \mathbf{else}:\\ \;\;\;\;y2 \cdot \frac{x2}{y1 + y2}\\ \end{array} \]
    (FPCore (x1 y1 x2 y2)
      :precision binary64
      (if (<= y2 9.5e-140) (* (/ y1 (+ y1 y2)) x1) (* y2 (/ x2 (+ y1 y2)))))
    double code(double x1, double y1, double x2, double y2) {
    	double tmp;
    	if (y2 <= 9.5e-140) {
    		tmp = (y1 / (y1 + y2)) * x1;
    	} else {
    		tmp = y2 * (x2 / (y1 + y2));
    	}
    	return tmp;
    }
    
    real(8) function code(x1, y1, x2, y2)
        real(8), intent (in) :: x1
        real(8), intent (in) :: y1
        real(8), intent (in) :: x2
        real(8), intent (in) :: y2
        real(8) :: tmp
        if (y2 <= 9.5d-140) then
            tmp = (y1 / (y1 + y2)) * x1
        else
            tmp = y2 * (x2 / (y1 + y2))
        end if
        code = tmp
    end function
    
    public static double code(double x1, double y1, double x2, double y2) {
    	double tmp;
    	if (y2 <= 9.5e-140) {
    		tmp = (y1 / (y1 + y2)) * x1;
    	} else {
    		tmp = y2 * (x2 / (y1 + y2));
    	}
    	return tmp;
    }
    
    def code(x1, y1, x2, y2):
    	tmp = 0
    	if y2 <= 9.5e-140:
    		tmp = (y1 / (y1 + y2)) * x1
    	else:
    		tmp = y2 * (x2 / (y1 + y2))
    	return tmp
    
    function code(x1, y1, x2, y2)
    	tmp = 0.0
    	if (y2 <= 9.5e-140)
    		tmp = Float64(Float64(y1 / Float64(y1 + y2)) * x1);
    	else
    		tmp = Float64(y2 * Float64(x2 / Float64(y1 + y2)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x1, y1, x2, y2)
    	tmp = 0.0;
    	if (y2 <= 9.5e-140)
    		tmp = (y1 / (y1 + y2)) * x1;
    	else
    		tmp = y2 * (x2 / (y1 + y2));
    	end
    	tmp_2 = tmp;
    end
    
    code[x1_, y1_, x2_, y2_] := If[LessEqual[y2, 9.5e-140], N[(N[(y1 / N[(y1 + y2), $MachinePrecision]), $MachinePrecision] * x1), $MachinePrecision], N[(y2 * N[(x2 / N[(y1 + y2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    \mathbf{if}\;y2 \leq 9.5 \cdot 10^{-140}:\\
    \;\;\;\;\frac{y1}{y1 + y2} \cdot x1\\
    
    \mathbf{else}:\\
    \;\;\;\;y2 \cdot \frac{x2}{y1 + y2}\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y2 < 9.5000000000000002e-140

      1. Initial program 77.8%

        \[\left(\left(\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \]
      2. Taylor expanded in x1 around inf

        \[\leadsto \color{blue}{\frac{x1 \cdot y1}{y1 + y2}} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{\color{blue}{y1 + y2}} \]
        2. lower-*.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{\color{blue}{y1} + y2} \]
        3. lower-+.f6442.1%

          \[\leadsto \frac{x1 \cdot y1}{y1 + \color{blue}{y2}} \]
      4. Applied rewrites42.1%

        \[\leadsto \color{blue}{\frac{x1 \cdot y1}{y1 + y2}} \]
      5. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{\color{blue}{y1 + y2}} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{\color{blue}{y1} + y2} \]
        3. associate-/l*N/A

          \[\leadsto x1 \cdot \color{blue}{\frac{y1}{y1 + y2}} \]
        4. lift-/.f64N/A

          \[\leadsto x1 \cdot \frac{y1}{\color{blue}{y1 + y2}} \]
        5. *-commutativeN/A

          \[\leadsto \frac{y1}{y1 + y2} \cdot \color{blue}{x1} \]
        6. lower-*.f6451.6%

          \[\leadsto \frac{y1}{y1 + y2} \cdot \color{blue}{x1} \]
      6. Applied rewrites51.6%

        \[\leadsto \frac{y1}{y1 + y2} \cdot \color{blue}{x1} \]

      if 9.5000000000000002e-140 < y2

      1. Initial program 77.8%

        \[\left(\left(\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \]
      2. Taylor expanded in x1 around 0

        \[\leadsto \color{blue}{\frac{x2 \cdot y2}{y1 + y2}} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \frac{x2 \cdot y2}{\color{blue}{y1 + y2}} \]
        2. lower-*.f64N/A

          \[\leadsto \frac{x2 \cdot y2}{\color{blue}{y1} + y2} \]
        3. lower-+.f6441.4%

          \[\leadsto \frac{x2 \cdot y2}{y1 + \color{blue}{y2}} \]
      4. Applied rewrites41.4%

        \[\leadsto \color{blue}{\frac{x2 \cdot y2}{y1 + y2}} \]
      5. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \frac{x2 \cdot y2}{\color{blue}{y1 + y2}} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{x2 \cdot y2}{\color{blue}{y1} + y2} \]
        3. *-commutativeN/A

          \[\leadsto \frac{y2 \cdot x2}{\color{blue}{y1} + y2} \]
        4. associate-/l*N/A

          \[\leadsto y2 \cdot \color{blue}{\frac{x2}{y1 + y2}} \]
        5. lower-*.f64N/A

          \[\leadsto y2 \cdot \color{blue}{\frac{x2}{y1 + y2}} \]
        6. lower-/.f6451.4%

          \[\leadsto y2 \cdot \frac{x2}{\color{blue}{y1 + y2}} \]
      6. Applied rewrites51.4%

        \[\leadsto y2 \cdot \color{blue}{\frac{x2}{y1 + y2}} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 10: 68.1% accurate, 3.1× speedup?

    \[\begin{array}{l} \mathbf{if}\;y2 \leq 9.5 \cdot 10^{-140}:\\ \;\;\;\;y1 \cdot \frac{x1}{y1 + y2}\\ \mathbf{else}:\\ \;\;\;\;y2 \cdot \frac{x2}{y1 + y2}\\ \end{array} \]
    (FPCore (x1 y1 x2 y2)
      :precision binary64
      (if (<= y2 9.5e-140) (* y1 (/ x1 (+ y1 y2))) (* y2 (/ x2 (+ y1 y2)))))
    double code(double x1, double y1, double x2, double y2) {
    	double tmp;
    	if (y2 <= 9.5e-140) {
    		tmp = y1 * (x1 / (y1 + y2));
    	} else {
    		tmp = y2 * (x2 / (y1 + y2));
    	}
    	return tmp;
    }
    
    real(8) function code(x1, y1, x2, y2)
        real(8), intent (in) :: x1
        real(8), intent (in) :: y1
        real(8), intent (in) :: x2
        real(8), intent (in) :: y2
        real(8) :: tmp
        if (y2 <= 9.5d-140) then
            tmp = y1 * (x1 / (y1 + y2))
        else
            tmp = y2 * (x2 / (y1 + y2))
        end if
        code = tmp
    end function
    
    public static double code(double x1, double y1, double x2, double y2) {
    	double tmp;
    	if (y2 <= 9.5e-140) {
    		tmp = y1 * (x1 / (y1 + y2));
    	} else {
    		tmp = y2 * (x2 / (y1 + y2));
    	}
    	return tmp;
    }
    
    def code(x1, y1, x2, y2):
    	tmp = 0
    	if y2 <= 9.5e-140:
    		tmp = y1 * (x1 / (y1 + y2))
    	else:
    		tmp = y2 * (x2 / (y1 + y2))
    	return tmp
    
    function code(x1, y1, x2, y2)
    	tmp = 0.0
    	if (y2 <= 9.5e-140)
    		tmp = Float64(y1 * Float64(x1 / Float64(y1 + y2)));
    	else
    		tmp = Float64(y2 * Float64(x2 / Float64(y1 + y2)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x1, y1, x2, y2)
    	tmp = 0.0;
    	if (y2 <= 9.5e-140)
    		tmp = y1 * (x1 / (y1 + y2));
    	else
    		tmp = y2 * (x2 / (y1 + y2));
    	end
    	tmp_2 = tmp;
    end
    
    code[x1_, y1_, x2_, y2_] := If[LessEqual[y2, 9.5e-140], N[(y1 * N[(x1 / N[(y1 + y2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y2 * N[(x2 / N[(y1 + y2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    \mathbf{if}\;y2 \leq 9.5 \cdot 10^{-140}:\\
    \;\;\;\;y1 \cdot \frac{x1}{y1 + y2}\\
    
    \mathbf{else}:\\
    \;\;\;\;y2 \cdot \frac{x2}{y1 + y2}\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y2 < 9.5000000000000002e-140

      1. Initial program 77.8%

        \[\left(\left(\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \]
      2. Taylor expanded in x1 around inf

        \[\leadsto \color{blue}{\frac{x1 \cdot y1}{y1 + y2}} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{\color{blue}{y1 + y2}} \]
        2. lower-*.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{\color{blue}{y1} + y2} \]
        3. lower-+.f6442.1%

          \[\leadsto \frac{x1 \cdot y1}{y1 + \color{blue}{y2}} \]
      4. Applied rewrites42.1%

        \[\leadsto \color{blue}{\frac{x1 \cdot y1}{y1 + y2}} \]
      5. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{\color{blue}{y1 + y2}} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{\color{blue}{y1} + y2} \]
        3. *-commutativeN/A

          \[\leadsto \frac{y1 \cdot x1}{\color{blue}{y1} + y2} \]
        4. associate-/l*N/A

          \[\leadsto y1 \cdot \color{blue}{\frac{x1}{y1 + y2}} \]
        5. lower-*.f64N/A

          \[\leadsto y1 \cdot \color{blue}{\frac{x1}{y1 + y2}} \]
        6. lower-/.f6451.5%

          \[\leadsto y1 \cdot \frac{x1}{\color{blue}{y1 + y2}} \]
      6. Applied rewrites51.5%

        \[\leadsto y1 \cdot \color{blue}{\frac{x1}{y1 + y2}} \]

      if 9.5000000000000002e-140 < y2

      1. Initial program 77.8%

        \[\left(\left(\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \]
      2. Taylor expanded in x1 around 0

        \[\leadsto \color{blue}{\frac{x2 \cdot y2}{y1 + y2}} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \frac{x2 \cdot y2}{\color{blue}{y1 + y2}} \]
        2. lower-*.f64N/A

          \[\leadsto \frac{x2 \cdot y2}{\color{blue}{y1} + y2} \]
        3. lower-+.f6441.4%

          \[\leadsto \frac{x2 \cdot y2}{y1 + \color{blue}{y2}} \]
      4. Applied rewrites41.4%

        \[\leadsto \color{blue}{\frac{x2 \cdot y2}{y1 + y2}} \]
      5. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \frac{x2 \cdot y2}{\color{blue}{y1 + y2}} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{x2 \cdot y2}{\color{blue}{y1} + y2} \]
        3. *-commutativeN/A

          \[\leadsto \frac{y2 \cdot x2}{\color{blue}{y1} + y2} \]
        4. associate-/l*N/A

          \[\leadsto y2 \cdot \color{blue}{\frac{x2}{y1 + y2}} \]
        5. lower-*.f64N/A

          \[\leadsto y2 \cdot \color{blue}{\frac{x2}{y1 + y2}} \]
        6. lower-/.f6451.4%

          \[\leadsto y2 \cdot \frac{x2}{\color{blue}{y1 + y2}} \]
      6. Applied rewrites51.4%

        \[\leadsto y2 \cdot \color{blue}{\frac{x2}{y1 + y2}} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 11: 64.4% accurate, 3.1× speedup?

    \[\begin{array}{l} \mathbf{if}\;y2 \leq 4 \cdot 10^{-140}:\\ \;\;\;\;y1 \cdot \frac{x1}{y1 + y2}\\ \mathbf{else}:\\ \;\;\;\;x2\\ \end{array} \]
    (FPCore (x1 y1 x2 y2)
      :precision binary64
      (if (<= y2 4e-140) (* y1 (/ x1 (+ y1 y2))) x2))
    double code(double x1, double y1, double x2, double y2) {
    	double tmp;
    	if (y2 <= 4e-140) {
    		tmp = y1 * (x1 / (y1 + y2));
    	} else {
    		tmp = x2;
    	}
    	return tmp;
    }
    
    real(8) function code(x1, y1, x2, y2)
        real(8), intent (in) :: x1
        real(8), intent (in) :: y1
        real(8), intent (in) :: x2
        real(8), intent (in) :: y2
        real(8) :: tmp
        if (y2 <= 4d-140) then
            tmp = y1 * (x1 / (y1 + y2))
        else
            tmp = x2
        end if
        code = tmp
    end function
    
    public static double code(double x1, double y1, double x2, double y2) {
    	double tmp;
    	if (y2 <= 4e-140) {
    		tmp = y1 * (x1 / (y1 + y2));
    	} else {
    		tmp = x2;
    	}
    	return tmp;
    }
    
    def code(x1, y1, x2, y2):
    	tmp = 0
    	if y2 <= 4e-140:
    		tmp = y1 * (x1 / (y1 + y2))
    	else:
    		tmp = x2
    	return tmp
    
    function code(x1, y1, x2, y2)
    	tmp = 0.0
    	if (y2 <= 4e-140)
    		tmp = Float64(y1 * Float64(x1 / Float64(y1 + y2)));
    	else
    		tmp = x2;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x1, y1, x2, y2)
    	tmp = 0.0;
    	if (y2 <= 4e-140)
    		tmp = y1 * (x1 / (y1 + y2));
    	else
    		tmp = x2;
    	end
    	tmp_2 = tmp;
    end
    
    code[x1_, y1_, x2_, y2_] := If[LessEqual[y2, 4e-140], N[(y1 * N[(x1 / N[(y1 + y2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x2]
    
    \begin{array}{l}
    \mathbf{if}\;y2 \leq 4 \cdot 10^{-140}:\\
    \;\;\;\;y1 \cdot \frac{x1}{y1 + y2}\\
    
    \mathbf{else}:\\
    \;\;\;\;x2\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y2 < 3.9999999999999999e-140

      1. Initial program 77.8%

        \[\left(\left(\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \]
      2. Taylor expanded in x1 around inf

        \[\leadsto \color{blue}{\frac{x1 \cdot y1}{y1 + y2}} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{\color{blue}{y1 + y2}} \]
        2. lower-*.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{\color{blue}{y1} + y2} \]
        3. lower-+.f6442.1%

          \[\leadsto \frac{x1 \cdot y1}{y1 + \color{blue}{y2}} \]
      4. Applied rewrites42.1%

        \[\leadsto \color{blue}{\frac{x1 \cdot y1}{y1 + y2}} \]
      5. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{\color{blue}{y1 + y2}} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{x1 \cdot y1}{\color{blue}{y1} + y2} \]
        3. *-commutativeN/A

          \[\leadsto \frac{y1 \cdot x1}{\color{blue}{y1} + y2} \]
        4. associate-/l*N/A

          \[\leadsto y1 \cdot \color{blue}{\frac{x1}{y1 + y2}} \]
        5. lower-*.f64N/A

          \[\leadsto y1 \cdot \color{blue}{\frac{x1}{y1 + y2}} \]
        6. lower-/.f6451.5%

          \[\leadsto y1 \cdot \frac{x1}{\color{blue}{y1 + y2}} \]
      6. Applied rewrites51.5%

        \[\leadsto y1 \cdot \color{blue}{\frac{x1}{y1 + y2}} \]

      if 3.9999999999999999e-140 < y2

      1. Initial program 77.8%

        \[\left(\left(\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \]
      2. Taylor expanded in y1 around 0

        \[\leadsto \color{blue}{x2} \]
      3. Step-by-step derivation
        1. Applied rewrites40.4%

          \[\leadsto \color{blue}{x2} \]
      4. Recombined 2 regimes into one program.
      5. Add Preprocessing

      Alternative 12: 60.0% accurate, 4.1× speedup?

      \[\begin{array}{l} \mathbf{if}\;y2 \leq 2.2 \cdot 10^{-161}:\\ \;\;\;\;\left(0.0078125 \cdot x1\right) \cdot 128\\ \mathbf{else}:\\ \;\;\;\;x2\\ \end{array} \]
      (FPCore (x1 y1 x2 y2)
        :precision binary64
        (if (<= y2 2.2e-161) (* (* 0.0078125 x1) 128.0) x2))
      double code(double x1, double y1, double x2, double y2) {
      	double tmp;
      	if (y2 <= 2.2e-161) {
      		tmp = (0.0078125 * x1) * 128.0;
      	} else {
      		tmp = x2;
      	}
      	return tmp;
      }
      
      real(8) function code(x1, y1, x2, y2)
          real(8), intent (in) :: x1
          real(8), intent (in) :: y1
          real(8), intent (in) :: x2
          real(8), intent (in) :: y2
          real(8) :: tmp
          if (y2 <= 2.2d-161) then
              tmp = (0.0078125d0 * x1) * 128.0d0
          else
              tmp = x2
          end if
          code = tmp
      end function
      
      public static double code(double x1, double y1, double x2, double y2) {
      	double tmp;
      	if (y2 <= 2.2e-161) {
      		tmp = (0.0078125 * x1) * 128.0;
      	} else {
      		tmp = x2;
      	}
      	return tmp;
      }
      
      def code(x1, y1, x2, y2):
      	tmp = 0
      	if y2 <= 2.2e-161:
      		tmp = (0.0078125 * x1) * 128.0
      	else:
      		tmp = x2
      	return tmp
      
      function code(x1, y1, x2, y2)
      	tmp = 0.0
      	if (y2 <= 2.2e-161)
      		tmp = Float64(Float64(0.0078125 * x1) * 128.0);
      	else
      		tmp = x2;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x1, y1, x2, y2)
      	tmp = 0.0;
      	if (y2 <= 2.2e-161)
      		tmp = (0.0078125 * x1) * 128.0;
      	else
      		tmp = x2;
      	end
      	tmp_2 = tmp;
      end
      
      code[x1_, y1_, x2_, y2_] := If[LessEqual[y2, 2.2e-161], N[(N[(0.0078125 * x1), $MachinePrecision] * 128.0), $MachinePrecision], x2]
      
      \begin{array}{l}
      \mathbf{if}\;y2 \leq 2.2 \cdot 10^{-161}:\\
      \;\;\;\;\left(0.0078125 \cdot x1\right) \cdot 128\\
      
      \mathbf{else}:\\
      \;\;\;\;x2\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y2 < 2.2e-161

        1. Initial program 77.8%

          \[\left(\left(\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \]
        2. Taylor expanded in y1 around inf

          \[\leadsto \color{blue}{\left(\frac{1}{128} \cdot x1\right)} \cdot 128 \]
        3. Step-by-step derivation
          1. lower-*.f6440.4%

            \[\leadsto \left(0.0078125 \cdot \color{blue}{x1}\right) \cdot 128 \]
        4. Applied rewrites40.4%

          \[\leadsto \color{blue}{\left(0.0078125 \cdot x1\right)} \cdot 128 \]

        if 2.2e-161 < y2

        1. Initial program 77.8%

          \[\left(\left(\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \]
        2. Taylor expanded in y1 around 0

          \[\leadsto \color{blue}{x2} \]
        3. Step-by-step derivation
          1. Applied rewrites40.4%

            \[\leadsto \color{blue}{x2} \]
        4. Recombined 2 regimes into one program.
        5. Add Preprocessing

        Alternative 13: 40.4% accurate, 44.6× speedup?

        \[x2 \]
        (FPCore (x1 y1 x2 y2)
          :precision binary64
          x2)
        double code(double x1, double y1, double x2, double y2) {
        	return x2;
        }
        
        real(8) function code(x1, y1, x2, y2)
            real(8), intent (in) :: x1
            real(8), intent (in) :: y1
            real(8), intent (in) :: x2
            real(8), intent (in) :: y2
            code = x2
        end function
        
        public static double code(double x1, double y1, double x2, double y2) {
        	return x2;
        }
        
        def code(x1, y1, x2, y2):
        	return x2
        
        function code(x1, y1, x2, y2)
        	return x2
        end
        
        function tmp = code(x1, y1, x2, y2)
        	tmp = x2;
        end
        
        code[x1_, y1_, x2_, y2_] := x2
        
        x2
        
        Derivation
        1. Initial program 77.8%

          \[\left(\left(\frac{\frac{x1}{\left(128 \cdot 128\right) \cdot 128} \cdot y1 + \frac{x2}{\left(128 \cdot 128\right) \cdot 128} \cdot y2}{y1 + y2} \cdot 128\right) \cdot 128\right) \cdot 128 \]
        2. Taylor expanded in y1 around 0

          \[\leadsto \color{blue}{x2} \]
        3. Step-by-step derivation
          1. Applied rewrites40.4%

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

          Reproduce

          ?
          herbie shell --seed 1 
          (FPCore (x1 y1 x2 y2)
            :name "(x1 / (128*128*128) * y1 + x2 / (128*128*128) * y2) / (y1 + y2) * 128*128*128"
            :precision binary64
            :pre (and (and (and (and (<= 0.0 x1) (<= x1 1.0)) (and (<= 0.0 y1) (<= y1 10000.0))) (and (<= 0.0 x2) (<= x2 1.0))) (and (<= 0.0 y2) (<= y2 10000.0)))
            (* (* (* (/ (+ (* (/ x1 (* (* 128.0 128.0) 128.0)) y1) (* (/ x2 (* (* 128.0 128.0) 128.0)) y2)) (+ y1 y2)) 128.0) 128.0) 128.0))