Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, E

Percentage Accurate: 99.9% → 99.9%
Time: 10.2s
Alternatives: 15
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \left(1 - x\right) + y \cdot \sqrt{x} \end{array} \]
(FPCore (x y) :precision binary64 (+ (- 1.0 x) (* y (sqrt x))))
double code(double x, double y) {
	return (1.0 - x) + (y * sqrt(x));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (1.0d0 - x) + (y * sqrt(x))
end function
public static double code(double x, double y) {
	return (1.0 - x) + (y * Math.sqrt(x));
}
def code(x, y):
	return (1.0 - x) + (y * math.sqrt(x))
function code(x, y)
	return Float64(Float64(1.0 - x) + Float64(y * sqrt(x)))
end
function tmp = code(x, y)
	tmp = (1.0 - x) + (y * sqrt(x));
end
code[x_, y_] := N[(N[(1.0 - x), $MachinePrecision] + N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(1 - x\right) + y \cdot \sqrt{x}
\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 15 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: 99.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(1 - x\right) + y \cdot \sqrt{x} \end{array} \]
(FPCore (x y) :precision binary64 (+ (- 1.0 x) (* y (sqrt x))))
double code(double x, double y) {
	return (1.0 - x) + (y * sqrt(x));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (1.0d0 - x) + (y * sqrt(x))
end function
public static double code(double x, double y) {
	return (1.0 - x) + (y * Math.sqrt(x));
}
def code(x, y):
	return (1.0 - x) + (y * math.sqrt(x))
function code(x, y)
	return Float64(Float64(1.0 - x) + Float64(y * sqrt(x)))
end
function tmp = code(x, y)
	tmp = (1.0 - x) + (y * sqrt(x));
end
code[x_, y_] := N[(N[(1.0 - x), $MachinePrecision] + N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(1 - x\right) + y \cdot \sqrt{x}
\end{array}

Alternative 1: 99.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(1 - x\right) + y \cdot \sqrt{x} \end{array} \]
(FPCore (x y) :precision binary64 (+ (- 1.0 x) (* y (sqrt x))))
double code(double x, double y) {
	return (1.0 - x) + (y * sqrt(x));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (1.0d0 - x) + (y * sqrt(x))
end function
public static double code(double x, double y) {
	return (1.0 - x) + (y * Math.sqrt(x));
}
def code(x, y):
	return (1.0 - x) + (y * math.sqrt(x))
function code(x, y)
	return Float64(Float64(1.0 - x) + Float64(y * sqrt(x)))
end
function tmp = code(x, y)
	tmp = (1.0 - x) + (y * sqrt(x));
end
code[x_, y_] := N[(N[(1.0 - x), $MachinePrecision] + N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(1 - x\right) + y \cdot \sqrt{x}
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(1 - x\right) + y \cdot \sqrt{x} \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 2: 94.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 + y \cdot \sqrt{x}\\ \mathbf{if}\;y \leq -8.5 \cdot 10^{+28}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 2.75 \cdot 10^{+32}:\\ \;\;\;\;1 - x\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (+ 1.0 (* y (sqrt x)))))
   (if (<= y -8.5e+28) t_0 (if (<= y 2.75e+32) (- 1.0 x) t_0))))
double code(double x, double y) {
	double t_0 = 1.0 + (y * sqrt(x));
	double tmp;
	if (y <= -8.5e+28) {
		tmp = t_0;
	} else if (y <= 2.75e+32) {
		tmp = 1.0 - x;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 1.0d0 + (y * sqrt(x))
    if (y <= (-8.5d+28)) then
        tmp = t_0
    else if (y <= 2.75d+32) then
        tmp = 1.0d0 - x
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 1.0 + (y * Math.sqrt(x));
	double tmp;
	if (y <= -8.5e+28) {
		tmp = t_0;
	} else if (y <= 2.75e+32) {
		tmp = 1.0 - x;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = 1.0 + (y * math.sqrt(x))
	tmp = 0
	if y <= -8.5e+28:
		tmp = t_0
	elif y <= 2.75e+32:
		tmp = 1.0 - x
	else:
		tmp = t_0
	return tmp
function code(x, y)
	t_0 = Float64(1.0 + Float64(y * sqrt(x)))
	tmp = 0.0
	if (y <= -8.5e+28)
		tmp = t_0;
	elseif (y <= 2.75e+32)
		tmp = Float64(1.0 - x);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 1.0 + (y * sqrt(x));
	tmp = 0.0;
	if (y <= -8.5e+28)
		tmp = t_0;
	elseif (y <= 2.75e+32)
		tmp = 1.0 - x;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.5e+28], t$95$0, If[LessEqual[y, 2.75e+32], N[(1.0 - x), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 1 + y \cdot \sqrt{x}\\
\mathbf{if}\;y \leq -8.5 \cdot 10^{+28}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq 2.75 \cdot 10^{+32}:\\
\;\;\;\;1 - x\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.49999999999999954e28 or 2.74999999999999992e32 < y

    1. Initial program 99.9%

      \[\left(1 - x\right) + y \cdot \sqrt{x} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{1 + \sqrt{x} \cdot y} \]
    4. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(\sqrt{x} \cdot y\right)}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{y}\right)\right) \]
      3. sqrt-lowering-sqrt.f6494.9%

        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), y\right)\right) \]
    5. Simplified94.9%

      \[\leadsto \color{blue}{1 + \sqrt{x} \cdot y} \]

    if -8.49999999999999954e28 < y < 2.74999999999999992e32

    1. Initial program 100.0%

      \[\left(1 - x\right) + y \cdot \sqrt{x} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{1 - x} \]
    4. Step-by-step derivation
      1. --lowering--.f6499.1%

        \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
    5. Simplified99.1%

      \[\leadsto \color{blue}{1 - x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.5 \cdot 10^{+28}:\\ \;\;\;\;1 + y \cdot \sqrt{x}\\ \mathbf{elif}\;y \leq 2.75 \cdot 10^{+32}:\\ \;\;\;\;1 - x\\ \mathbf{else}:\\ \;\;\;\;1 + y \cdot \sqrt{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 93.0% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \sqrt{x}\\ \mathbf{if}\;y \leq -5.2 \cdot 10^{+73}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{+97}:\\ \;\;\;\;1 - x\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* y (sqrt x))))
   (if (<= y -5.2e+73) t_0 (if (<= y 1.15e+97) (- 1.0 x) t_0))))
double code(double x, double y) {
	double t_0 = y * sqrt(x);
	double tmp;
	if (y <= -5.2e+73) {
		tmp = t_0;
	} else if (y <= 1.15e+97) {
		tmp = 1.0 - x;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = y * sqrt(x)
    if (y <= (-5.2d+73)) then
        tmp = t_0
    else if (y <= 1.15d+97) then
        tmp = 1.0d0 - x
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = y * Math.sqrt(x);
	double tmp;
	if (y <= -5.2e+73) {
		tmp = t_0;
	} else if (y <= 1.15e+97) {
		tmp = 1.0 - x;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = y * math.sqrt(x)
	tmp = 0
	if y <= -5.2e+73:
		tmp = t_0
	elif y <= 1.15e+97:
		tmp = 1.0 - x
	else:
		tmp = t_0
	return tmp
function code(x, y)
	t_0 = Float64(y * sqrt(x))
	tmp = 0.0
	if (y <= -5.2e+73)
		tmp = t_0;
	elseif (y <= 1.15e+97)
		tmp = Float64(1.0 - x);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = y * sqrt(x);
	tmp = 0.0;
	if (y <= -5.2e+73)
		tmp = t_0;
	elseif (y <= 1.15e+97)
		tmp = 1.0 - x;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.2e+73], t$95$0, If[LessEqual[y, 1.15e+97], N[(1.0 - x), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y \cdot \sqrt{x}\\
\mathbf{if}\;y \leq -5.2 \cdot 10^{+73}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq 1.15 \cdot 10^{+97}:\\
\;\;\;\;1 - x\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.2000000000000001e73 or 1.15000000000000003e97 < y

    1. Initial program 99.9%

      \[\left(1 - x\right) + y \cdot \sqrt{x} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{\sqrt{x} \cdot y} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{y}\right) \]
      2. sqrt-lowering-sqrt.f6491.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), y\right) \]
    5. Simplified91.9%

      \[\leadsto \color{blue}{\sqrt{x} \cdot y} \]

    if -5.2000000000000001e73 < y < 1.15000000000000003e97

    1. Initial program 100.0%

      \[\left(1 - x\right) + y \cdot \sqrt{x} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{1 - x} \]
    4. Step-by-step derivation
      1. --lowering--.f6496.8%

        \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
    5. Simplified96.8%

      \[\leadsto \color{blue}{1 - x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification94.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.2 \cdot 10^{+73}:\\ \;\;\;\;y \cdot \sqrt{x}\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{+97}:\\ \;\;\;\;1 - x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \sqrt{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 98.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \sqrt{x}\\ \mathbf{if}\;x \leq 1:\\ \;\;\;\;1 + t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_0 - x\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* y (sqrt x)))) (if (<= x 1.0) (+ 1.0 t_0) (- t_0 x))))
double code(double x, double y) {
	double t_0 = y * sqrt(x);
	double tmp;
	if (x <= 1.0) {
		tmp = 1.0 + t_0;
	} else {
		tmp = t_0 - x;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = y * sqrt(x)
    if (x <= 1.0d0) then
        tmp = 1.0d0 + t_0
    else
        tmp = t_0 - x
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = y * Math.sqrt(x);
	double tmp;
	if (x <= 1.0) {
		tmp = 1.0 + t_0;
	} else {
		tmp = t_0 - x;
	}
	return tmp;
}
def code(x, y):
	t_0 = y * math.sqrt(x)
	tmp = 0
	if x <= 1.0:
		tmp = 1.0 + t_0
	else:
		tmp = t_0 - x
	return tmp
function code(x, y)
	t_0 = Float64(y * sqrt(x))
	tmp = 0.0
	if (x <= 1.0)
		tmp = Float64(1.0 + t_0);
	else
		tmp = Float64(t_0 - x);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = y * sqrt(x);
	tmp = 0.0;
	if (x <= 1.0)
		tmp = 1.0 + t_0;
	else
		tmp = t_0 - x;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.0], N[(1.0 + t$95$0), $MachinePrecision], N[(t$95$0 - x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y \cdot \sqrt{x}\\
\mathbf{if}\;x \leq 1:\\
\;\;\;\;1 + t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_0 - x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 1

    1. Initial program 99.9%

      \[\left(1 - x\right) + y \cdot \sqrt{x} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{1 + \sqrt{x} \cdot y} \]
    4. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(\sqrt{x} \cdot y\right)}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{y}\right)\right) \]
      3. sqrt-lowering-sqrt.f6497.8%

        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), y\right)\right) \]
    5. Simplified97.8%

      \[\leadsto \color{blue}{1 + \sqrt{x} \cdot y} \]

    if 1 < x

    1. Initial program 99.9%

      \[\left(1 - x\right) + y \cdot \sqrt{x} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(\sqrt{\frac{1}{x}} \cdot y - 1\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot \left(\sqrt{\frac{1}{x}} \cdot y + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \]
      2. remove-double-negN/A

        \[\leadsto x \cdot \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sqrt{\frac{1}{x}} \cdot y\right)\right)\right)\right) + \left(\mathsf{neg}\left(\color{blue}{1}\right)\right)\right) \]
      3. distribute-rgt-neg-outN/A

        \[\leadsto x \cdot \left(\left(\mathsf{neg}\left(\sqrt{\frac{1}{x}} \cdot \left(\mathsf{neg}\left(y\right)\right)\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right) \]
      4. mul-1-negN/A

        \[\leadsto x \cdot \left(\left(\mathsf{neg}\left(\sqrt{\frac{1}{x}} \cdot \left(-1 \cdot y\right)\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right) \]
      5. rem-square-sqrtN/A

        \[\leadsto x \cdot \left(\left(\mathsf{neg}\left(\sqrt{\frac{1}{x}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot y\right)\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto x \cdot \left(\left(\mathsf{neg}\left(\sqrt{\frac{1}{x}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot y\right)\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto x \cdot \left(\left(\mathsf{neg}\left(\sqrt{\frac{1}{x}} \cdot \left(y \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right) \]
      8. distribute-neg-inN/A

        \[\leadsto x \cdot \left(\mathsf{neg}\left(\left(\sqrt{\frac{1}{x}} \cdot \left(y \cdot {\left(\sqrt{-1}\right)}^{2}\right) + 1\right)\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto x \cdot \left(\mathsf{neg}\left(\left(1 + \sqrt{\frac{1}{x}} \cdot \left(y \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\left(1 + \sqrt{\frac{1}{x}} \cdot \left(y \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)\right)\right)}\right) \]
      11. distribute-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(1\right)\right) + \color{blue}{\left(\mathsf{neg}\left(\sqrt{\frac{1}{x}} \cdot \left(y \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)\right)}\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(-1 + \left(\mathsf{neg}\left(\color{blue}{\sqrt{\frac{1}{x}} \cdot \left(y \cdot {\left(\sqrt{-1}\right)}^{2}\right)}\right)\right)\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(-1 + \left(\mathsf{neg}\left(\sqrt{\frac{1}{x}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot y\right)\right)\right)\right)\right) \]
      14. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(-1 + \left(\mathsf{neg}\left(\sqrt{\frac{1}{x}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot y\right)\right)\right)\right)\right) \]
      15. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(-1 + \left(\mathsf{neg}\left(\sqrt{\frac{1}{x}} \cdot \left(-1 \cdot y\right)\right)\right)\right)\right) \]
    5. Simplified98.7%

      \[\leadsto \color{blue}{x \cdot \left(-1 + y \cdot \sqrt{\frac{1}{x}}\right)} \]
    6. Taylor expanded in x around 0

      \[\leadsto \color{blue}{-1 \cdot x + \sqrt{x} \cdot y} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \sqrt{x} \cdot y + \color{blue}{-1 \cdot x} \]
      2. mul-1-negN/A

        \[\leadsto \sqrt{x} \cdot y + \left(\mathsf{neg}\left(x\right)\right) \]
      3. sub-negN/A

        \[\leadsto \sqrt{x} \cdot y - \color{blue}{x} \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\sqrt{x} \cdot y\right), \color{blue}{x}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{x}\right), y\right), x\right) \]
      6. sqrt-lowering-sqrt.f6498.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), y\right), x\right) \]
    8. Simplified98.8%

      \[\leadsto \color{blue}{\sqrt{x} \cdot y - x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;1 + y \cdot \sqrt{x}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \sqrt{x} - x\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 69.6% accurate, 3.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(x \cdot x\right)\\ \mathbf{if}\;y \leq -6 \cdot 10^{+152}:\\ \;\;\;\;1 - t\_0 \cdot \left(t\_0 \cdot t\_0\right)\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{+125}:\\ \;\;\;\;1 - x\\ \mathbf{else}:\\ \;\;\;\;\left(1 - t\_0\right) \cdot \left(1 + x \cdot \left(-1 + x \cdot \left(x \cdot \left(1 - x\right)\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* x (* x x))))
   (if (<= y -6e+152)
     (- 1.0 (* t_0 (* t_0 t_0)))
     (if (<= y 4.8e+125)
       (- 1.0 x)
       (* (- 1.0 t_0) (+ 1.0 (* x (+ -1.0 (* x (* x (- 1.0 x)))))))))))
double code(double x, double y) {
	double t_0 = x * (x * x);
	double tmp;
	if (y <= -6e+152) {
		tmp = 1.0 - (t_0 * (t_0 * t_0));
	} else if (y <= 4.8e+125) {
		tmp = 1.0 - x;
	} else {
		tmp = (1.0 - t_0) * (1.0 + (x * (-1.0 + (x * (x * (1.0 - x))))));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x * (x * x)
    if (y <= (-6d+152)) then
        tmp = 1.0d0 - (t_0 * (t_0 * t_0))
    else if (y <= 4.8d+125) then
        tmp = 1.0d0 - x
    else
        tmp = (1.0d0 - t_0) * (1.0d0 + (x * ((-1.0d0) + (x * (x * (1.0d0 - x))))))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = x * (x * x);
	double tmp;
	if (y <= -6e+152) {
		tmp = 1.0 - (t_0 * (t_0 * t_0));
	} else if (y <= 4.8e+125) {
		tmp = 1.0 - x;
	} else {
		tmp = (1.0 - t_0) * (1.0 + (x * (-1.0 + (x * (x * (1.0 - x))))));
	}
	return tmp;
}
def code(x, y):
	t_0 = x * (x * x)
	tmp = 0
	if y <= -6e+152:
		tmp = 1.0 - (t_0 * (t_0 * t_0))
	elif y <= 4.8e+125:
		tmp = 1.0 - x
	else:
		tmp = (1.0 - t_0) * (1.0 + (x * (-1.0 + (x * (x * (1.0 - x))))))
	return tmp
function code(x, y)
	t_0 = Float64(x * Float64(x * x))
	tmp = 0.0
	if (y <= -6e+152)
		tmp = Float64(1.0 - Float64(t_0 * Float64(t_0 * t_0)));
	elseif (y <= 4.8e+125)
		tmp = Float64(1.0 - x);
	else
		tmp = Float64(Float64(1.0 - t_0) * Float64(1.0 + Float64(x * Float64(-1.0 + Float64(x * Float64(x * Float64(1.0 - x)))))));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = x * (x * x);
	tmp = 0.0;
	if (y <= -6e+152)
		tmp = 1.0 - (t_0 * (t_0 * t_0));
	elseif (y <= 4.8e+125)
		tmp = 1.0 - x;
	else
		tmp = (1.0 - t_0) * (1.0 + (x * (-1.0 + (x * (x * (1.0 - x))))));
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6e+152], N[(1.0 - N[(t$95$0 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e+125], N[(1.0 - x), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] * N[(1.0 + N[(x * N[(-1.0 + N[(x * N[(x * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
\mathbf{if}\;y \leq -6 \cdot 10^{+152}:\\
\;\;\;\;1 - t\_0 \cdot \left(t\_0 \cdot t\_0\right)\\

\mathbf{elif}\;y \leq 4.8 \cdot 10^{+125}:\\
\;\;\;\;1 - x\\

\mathbf{else}:\\
\;\;\;\;\left(1 - t\_0\right) \cdot \left(1 + x \cdot \left(-1 + x \cdot \left(x \cdot \left(1 - x\right)\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.99999999999999981e152

    1. Initial program 99.7%

      \[\left(1 - x\right) + y \cdot \sqrt{x} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{1 - x} \]
    4. Step-by-step derivation
      1. --lowering--.f643.9%

        \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
    5. Simplified3.9%

      \[\leadsto \color{blue}{1 - x} \]
    6. Step-by-step derivation
      1. flip3--N/A

        \[\leadsto \frac{{1}^{3} - {x}^{3}}{\color{blue}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}} \]
      2. div-invN/A

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

        \[\leadsto \left(1 - {x}^{3}\right) \cdot \frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)} \]
      4. flip3--N/A

        \[\leadsto \frac{{1}^{3} - {\left({x}^{3}\right)}^{3}}{1 \cdot 1 + \left({x}^{3} \cdot {x}^{3} + 1 \cdot {x}^{3}\right)} \cdot \frac{\color{blue}{1}}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)} \]
      5. frac-timesN/A

        \[\leadsto \frac{\left({1}^{3} - {\left({x}^{3}\right)}^{3}\right) \cdot 1}{\color{blue}{\left(1 \cdot 1 + \left({x}^{3} \cdot {x}^{3} + 1 \cdot {x}^{3}\right)\right) \cdot \left(1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)\right)}} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left({1}^{3} - {\left({x}^{3}\right)}^{3}\right) \cdot 1\right), \color{blue}{\left(\left(1 \cdot 1 + \left({x}^{3} \cdot {x}^{3} + 1 \cdot {x}^{3}\right)\right) \cdot \left(1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)\right)\right)}\right) \]
    7. Applied egg-rr1.0%

      \[\leadsto \color{blue}{\frac{\left(1 - \left(x \cdot \left(x \cdot x\right)\right) \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right) \cdot 1}{\left(1 + \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot \left(x \cdot x\right)\right) + x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(1 + x \cdot \left(1 + x\right)\right)}} \]
    8. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right)\right), 1\right), \color{blue}{1}\right) \]
    9. Step-by-step derivation
      1. Simplified21.7%

        \[\leadsto \frac{\left(1 - \left(x \cdot \left(x \cdot x\right)\right) \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right) \cdot 1}{\color{blue}{1}} \]

      if -5.99999999999999981e152 < y < 4.7999999999999999e125

      1. Initial program 100.0%

        \[\left(1 - x\right) + y \cdot \sqrt{x} \]
      2. Add Preprocessing
      3. Taylor expanded in y around 0

        \[\leadsto \color{blue}{1 - x} \]
      4. Step-by-step derivation
        1. --lowering--.f6486.2%

          \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
      5. Simplified86.2%

        \[\leadsto \color{blue}{1 - x} \]

      if 4.7999999999999999e125 < y

      1. Initial program 99.9%

        \[\left(1 - x\right) + y \cdot \sqrt{x} \]
      2. Add Preprocessing
      3. Taylor expanded in y around 0

        \[\leadsto \color{blue}{1 - x} \]
      4. Step-by-step derivation
        1. --lowering--.f642.0%

          \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
      5. Simplified2.0%

        \[\leadsto \color{blue}{1 - x} \]
      6. Step-by-step derivation
        1. flip3--N/A

          \[\leadsto \frac{{1}^{3} - {x}^{3}}{\color{blue}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}} \]
        2. div-invN/A

          \[\leadsto \left({1}^{3} - {x}^{3}\right) \cdot \color{blue}{\frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}} \]
        3. *-lowering-*.f64N/A

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \left({x}^{3}\right)\right), \left(\frac{\color{blue}{1}}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)\right) \]
        6. cube-multN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left(\frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)\right) \]
        8. *-lowering-*.f64N/A

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\left(1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)\right)}\right)\right) \]
        10. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \left(1 + \left(\color{blue}{x \cdot x} + 1 \cdot x\right)\right)\right)\right) \]
        11. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(x \cdot x + 1 \cdot x\right)}\right)\right)\right) \]
        12. distribute-rgt-outN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \color{blue}{\left(x + 1\right)}\right)\right)\right)\right) \]
        13. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \left(1 + \color{blue}{x}\right)\right)\right)\right)\right) \]
        14. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{\left(1 + x\right)}\right)\right)\right)\right) \]
        15. +-lowering-+.f641.9%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(1, \color{blue}{x}\right)\right)\right)\right)\right) \]
      7. Applied egg-rr1.9%

        \[\leadsto \color{blue}{\left(1 - x \cdot \left(x \cdot x\right)\right) \cdot \frac{1}{1 + x \cdot \left(1 + x\right)}} \]
      8. Taylor expanded in x around 0

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(x \cdot \left({x}^{2} \cdot \left(1 + -1 \cdot x\right) - 1\right)\right)}\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{\left({x}^{2} \cdot \left(1 + -1 \cdot x\right) - 1\right)}\right)\right)\right) \]
        3. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left({x}^{2} \cdot \left(1 + -1 \cdot x\right) + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right)\right)\right) \]
        4. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left({x}^{2} \cdot \left(1 + -1 \cdot x\right) + -1\right)\right)\right)\right) \]
        5. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(-1 + \color{blue}{{x}^{2} \cdot \left(1 + -1 \cdot x\right)}\right)\right)\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \color{blue}{\left({x}^{2} \cdot \left(1 + -1 \cdot x\right)\right)}\right)\right)\right)\right) \]
        7. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \left(\left(x \cdot x\right) \cdot \left(\color{blue}{1} + -1 \cdot x\right)\right)\right)\right)\right)\right) \]
        8. associate-*l*N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \left(x \cdot \color{blue}{\left(x \cdot \left(1 + -1 \cdot x\right)\right)}\right)\right)\right)\right)\right) \]
        9. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(x, \color{blue}{\left(x \cdot \left(1 + -1 \cdot x\right)\right)}\right)\right)\right)\right)\right) \]
        10. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(1 + -1 \cdot x\right)}\right)\right)\right)\right)\right)\right) \]
        11. mul-1-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(x\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
        12. unsub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(1 - \color{blue}{x}\right)\right)\right)\right)\right)\right)\right) \]
        13. --lowering--.f6428.3%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{x}\right)\right)\right)\right)\right)\right)\right) \]
      10. Simplified28.3%

        \[\leadsto \left(1 - x \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{\left(1 + x \cdot \left(-1 + x \cdot \left(x \cdot \left(1 - x\right)\right)\right)\right)} \]
    10. Recombined 3 regimes into one program.
    11. Final simplification69.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6 \cdot 10^{+152}:\\ \;\;\;\;1 - \left(x \cdot \left(x \cdot x\right)\right) \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{+125}:\\ \;\;\;\;1 - x\\ \mathbf{else}:\\ \;\;\;\;\left(1 - x \cdot \left(x \cdot x\right)\right) \cdot \left(1 + x \cdot \left(-1 + x \cdot \left(x \cdot \left(1 - x\right)\right)\right)\right)\\ \end{array} \]
    12. Add Preprocessing

    Alternative 6: 69.5% accurate, 3.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 - x \cdot \left(x \cdot x\right)\\ \mathbf{if}\;y \leq -9 \cdot 10^{+152}:\\ \;\;\;\;t\_0 \cdot \left(1 + x \cdot \left(x \cdot x + -1\right)\right)\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+125}:\\ \;\;\;\;1 - x\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \left(1 + x \cdot \left(-1 + x \cdot \left(x \cdot \left(1 - x\right)\right)\right)\right)\\ \end{array} \end{array} \]
    (FPCore (x y)
     :precision binary64
     (let* ((t_0 (- 1.0 (* x (* x x)))))
       (if (<= y -9e+152)
         (* t_0 (+ 1.0 (* x (+ (* x x) -1.0))))
         (if (<= y 2e+125)
           (- 1.0 x)
           (* t_0 (+ 1.0 (* x (+ -1.0 (* x (* x (- 1.0 x)))))))))))
    double code(double x, double y) {
    	double t_0 = 1.0 - (x * (x * x));
    	double tmp;
    	if (y <= -9e+152) {
    		tmp = t_0 * (1.0 + (x * ((x * x) + -1.0)));
    	} else if (y <= 2e+125) {
    		tmp = 1.0 - x;
    	} else {
    		tmp = t_0 * (1.0 + (x * (-1.0 + (x * (x * (1.0 - x))))));
    	}
    	return tmp;
    }
    
    real(8) function code(x, y)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8) :: t_0
        real(8) :: tmp
        t_0 = 1.0d0 - (x * (x * x))
        if (y <= (-9d+152)) then
            tmp = t_0 * (1.0d0 + (x * ((x * x) + (-1.0d0))))
        else if (y <= 2d+125) then
            tmp = 1.0d0 - x
        else
            tmp = t_0 * (1.0d0 + (x * ((-1.0d0) + (x * (x * (1.0d0 - x))))))
        end if
        code = tmp
    end function
    
    public static double code(double x, double y) {
    	double t_0 = 1.0 - (x * (x * x));
    	double tmp;
    	if (y <= -9e+152) {
    		tmp = t_0 * (1.0 + (x * ((x * x) + -1.0)));
    	} else if (y <= 2e+125) {
    		tmp = 1.0 - x;
    	} else {
    		tmp = t_0 * (1.0 + (x * (-1.0 + (x * (x * (1.0 - x))))));
    	}
    	return tmp;
    }
    
    def code(x, y):
    	t_0 = 1.0 - (x * (x * x))
    	tmp = 0
    	if y <= -9e+152:
    		tmp = t_0 * (1.0 + (x * ((x * x) + -1.0)))
    	elif y <= 2e+125:
    		tmp = 1.0 - x
    	else:
    		tmp = t_0 * (1.0 + (x * (-1.0 + (x * (x * (1.0 - x))))))
    	return tmp
    
    function code(x, y)
    	t_0 = Float64(1.0 - Float64(x * Float64(x * x)))
    	tmp = 0.0
    	if (y <= -9e+152)
    		tmp = Float64(t_0 * Float64(1.0 + Float64(x * Float64(Float64(x * x) + -1.0))));
    	elseif (y <= 2e+125)
    		tmp = Float64(1.0 - x);
    	else
    		tmp = Float64(t_0 * Float64(1.0 + Float64(x * Float64(-1.0 + Float64(x * Float64(x * Float64(1.0 - x)))))));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y)
    	t_0 = 1.0 - (x * (x * x));
    	tmp = 0.0;
    	if (y <= -9e+152)
    		tmp = t_0 * (1.0 + (x * ((x * x) + -1.0)));
    	elseif (y <= 2e+125)
    		tmp = 1.0 - x;
    	else
    		tmp = t_0 * (1.0 + (x * (-1.0 + (x * (x * (1.0 - x))))));
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_] := Block[{t$95$0 = N[(1.0 - N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9e+152], N[(t$95$0 * N[(1.0 + N[(x * N[(N[(x * x), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e+125], N[(1.0 - x), $MachinePrecision], N[(t$95$0 * N[(1.0 + N[(x * N[(-1.0 + N[(x * N[(x * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := 1 - x \cdot \left(x \cdot x\right)\\
    \mathbf{if}\;y \leq -9 \cdot 10^{+152}:\\
    \;\;\;\;t\_0 \cdot \left(1 + x \cdot \left(x \cdot x + -1\right)\right)\\
    
    \mathbf{elif}\;y \leq 2 \cdot 10^{+125}:\\
    \;\;\;\;1 - x\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0 \cdot \left(1 + x \cdot \left(-1 + x \cdot \left(x \cdot \left(1 - x\right)\right)\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y < -9.0000000000000002e152

      1. Initial program 99.7%

        \[\left(1 - x\right) + y \cdot \sqrt{x} \]
      2. Add Preprocessing
      3. Taylor expanded in y around 0

        \[\leadsto \color{blue}{1 - x} \]
      4. Step-by-step derivation
        1. --lowering--.f643.9%

          \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
      5. Simplified3.9%

        \[\leadsto \color{blue}{1 - x} \]
      6. Step-by-step derivation
        1. flip3--N/A

          \[\leadsto \frac{{1}^{3} - {x}^{3}}{\color{blue}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}} \]
        2. div-invN/A

          \[\leadsto \left({1}^{3} - {x}^{3}\right) \cdot \color{blue}{\frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}} \]
        3. *-lowering-*.f64N/A

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \left({x}^{3}\right)\right), \left(\frac{\color{blue}{1}}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)\right) \]
        6. cube-multN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left(\frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)\right) \]
        8. *-lowering-*.f64N/A

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\left(1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)\right)}\right)\right) \]
        10. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \left(1 + \left(\color{blue}{x \cdot x} + 1 \cdot x\right)\right)\right)\right) \]
        11. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(x \cdot x + 1 \cdot x\right)}\right)\right)\right) \]
        12. distribute-rgt-outN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \color{blue}{\left(x + 1\right)}\right)\right)\right)\right) \]
        13. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \left(1 + \color{blue}{x}\right)\right)\right)\right)\right) \]
        14. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{\left(1 + x\right)}\right)\right)\right)\right) \]
        15. +-lowering-+.f6413.1%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(1, \color{blue}{x}\right)\right)\right)\right)\right) \]
      7. Applied egg-rr13.1%

        \[\leadsto \color{blue}{\left(1 - x \cdot \left(x \cdot x\right)\right) \cdot \frac{1}{1 + x \cdot \left(1 + x\right)}} \]
      8. Taylor expanded in x around 0

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(x \cdot \left({x}^{2} - 1\right)\right)}\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{\left({x}^{2} - 1\right)}\right)\right)\right) \]
        3. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left({x}^{2} + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right)\right)\right) \]
        4. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left({x}^{2} + -1\right)\right)\right)\right) \]
        5. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(-1 + \color{blue}{{x}^{2}}\right)\right)\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \color{blue}{\left({x}^{2}\right)}\right)\right)\right)\right) \]
        7. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \left(x \cdot \color{blue}{x}\right)\right)\right)\right)\right) \]
        8. *-lowering-*.f6421.7%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right)\right)\right) \]
      10. Simplified21.7%

        \[\leadsto \left(1 - x \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{\left(1 + x \cdot \left(-1 + x \cdot x\right)\right)} \]

      if -9.0000000000000002e152 < y < 1.9999999999999998e125

      1. Initial program 100.0%

        \[\left(1 - x\right) + y \cdot \sqrt{x} \]
      2. Add Preprocessing
      3. Taylor expanded in y around 0

        \[\leadsto \color{blue}{1 - x} \]
      4. Step-by-step derivation
        1. --lowering--.f6486.2%

          \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
      5. Simplified86.2%

        \[\leadsto \color{blue}{1 - x} \]

      if 1.9999999999999998e125 < y

      1. Initial program 99.9%

        \[\left(1 - x\right) + y \cdot \sqrt{x} \]
      2. Add Preprocessing
      3. Taylor expanded in y around 0

        \[\leadsto \color{blue}{1 - x} \]
      4. Step-by-step derivation
        1. --lowering--.f642.0%

          \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
      5. Simplified2.0%

        \[\leadsto \color{blue}{1 - x} \]
      6. Step-by-step derivation
        1. flip3--N/A

          \[\leadsto \frac{{1}^{3} - {x}^{3}}{\color{blue}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}} \]
        2. div-invN/A

          \[\leadsto \left({1}^{3} - {x}^{3}\right) \cdot \color{blue}{\frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}} \]
        3. *-lowering-*.f64N/A

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \left({x}^{3}\right)\right), \left(\frac{\color{blue}{1}}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)\right) \]
        6. cube-multN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left(\frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)\right) \]
        8. *-lowering-*.f64N/A

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\left(1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)\right)}\right)\right) \]
        10. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \left(1 + \left(\color{blue}{x \cdot x} + 1 \cdot x\right)\right)\right)\right) \]
        11. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(x \cdot x + 1 \cdot x\right)}\right)\right)\right) \]
        12. distribute-rgt-outN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \color{blue}{\left(x + 1\right)}\right)\right)\right)\right) \]
        13. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \left(1 + \color{blue}{x}\right)\right)\right)\right)\right) \]
        14. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{\left(1 + x\right)}\right)\right)\right)\right) \]
        15. +-lowering-+.f641.9%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(1, \color{blue}{x}\right)\right)\right)\right)\right) \]
      7. Applied egg-rr1.9%

        \[\leadsto \color{blue}{\left(1 - x \cdot \left(x \cdot x\right)\right) \cdot \frac{1}{1 + x \cdot \left(1 + x\right)}} \]
      8. Taylor expanded in x around 0

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(x \cdot \left({x}^{2} \cdot \left(1 + -1 \cdot x\right) - 1\right)\right)}\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{\left({x}^{2} \cdot \left(1 + -1 \cdot x\right) - 1\right)}\right)\right)\right) \]
        3. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left({x}^{2} \cdot \left(1 + -1 \cdot x\right) + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right)\right)\right) \]
        4. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left({x}^{2} \cdot \left(1 + -1 \cdot x\right) + -1\right)\right)\right)\right) \]
        5. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(-1 + \color{blue}{{x}^{2} \cdot \left(1 + -1 \cdot x\right)}\right)\right)\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \color{blue}{\left({x}^{2} \cdot \left(1 + -1 \cdot x\right)\right)}\right)\right)\right)\right) \]
        7. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \left(\left(x \cdot x\right) \cdot \left(\color{blue}{1} + -1 \cdot x\right)\right)\right)\right)\right)\right) \]
        8. associate-*l*N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \left(x \cdot \color{blue}{\left(x \cdot \left(1 + -1 \cdot x\right)\right)}\right)\right)\right)\right)\right) \]
        9. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(x, \color{blue}{\left(x \cdot \left(1 + -1 \cdot x\right)\right)}\right)\right)\right)\right)\right) \]
        10. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(1 + -1 \cdot x\right)}\right)\right)\right)\right)\right)\right) \]
        11. mul-1-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(x\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
        12. unsub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(1 - \color{blue}{x}\right)\right)\right)\right)\right)\right)\right) \]
        13. --lowering--.f6428.3%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{x}\right)\right)\right)\right)\right)\right)\right) \]
      10. Simplified28.3%

        \[\leadsto \left(1 - x \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{\left(1 + x \cdot \left(-1 + x \cdot \left(x \cdot \left(1 - x\right)\right)\right)\right)} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification69.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{+152}:\\ \;\;\;\;\left(1 - x \cdot \left(x \cdot x\right)\right) \cdot \left(1 + x \cdot \left(x \cdot x + -1\right)\right)\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+125}:\\ \;\;\;\;1 - x\\ \mathbf{else}:\\ \;\;\;\;\left(1 - x \cdot \left(x \cdot x\right)\right) \cdot \left(1 + x \cdot \left(-1 + x \cdot \left(x \cdot \left(1 - x\right)\right)\right)\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 7: 69.5% accurate, 4.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.26 \cdot 10^{+151}:\\ \;\;\;\;\left(1 - x \cdot \left(x \cdot x\right)\right) \cdot \left(1 + x \cdot \left(x \cdot x + -1\right)\right)\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{+124}:\\ \;\;\;\;1 - x\\ \mathbf{else}:\\ \;\;\;\;\left(1 + x \cdot \left(-1 + x \cdot \left(1 - x\right)\right)\right) \cdot \left(1 - x \cdot x\right)\\ \end{array} \end{array} \]
    (FPCore (x y)
     :precision binary64
     (if (<= y -1.26e+151)
       (* (- 1.0 (* x (* x x))) (+ 1.0 (* x (+ (* x x) -1.0))))
       (if (<= y 4.2e+124)
         (- 1.0 x)
         (* (+ 1.0 (* x (+ -1.0 (* x (- 1.0 x))))) (- 1.0 (* x x))))))
    double code(double x, double y) {
    	double tmp;
    	if (y <= -1.26e+151) {
    		tmp = (1.0 - (x * (x * x))) * (1.0 + (x * ((x * x) + -1.0)));
    	} else if (y <= 4.2e+124) {
    		tmp = 1.0 - x;
    	} else {
    		tmp = (1.0 + (x * (-1.0 + (x * (1.0 - x))))) * (1.0 - (x * x));
    	}
    	return tmp;
    }
    
    real(8) function code(x, y)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8) :: tmp
        if (y <= (-1.26d+151)) then
            tmp = (1.0d0 - (x * (x * x))) * (1.0d0 + (x * ((x * x) + (-1.0d0))))
        else if (y <= 4.2d+124) then
            tmp = 1.0d0 - x
        else
            tmp = (1.0d0 + (x * ((-1.0d0) + (x * (1.0d0 - x))))) * (1.0d0 - (x * x))
        end if
        code = tmp
    end function
    
    public static double code(double x, double y) {
    	double tmp;
    	if (y <= -1.26e+151) {
    		tmp = (1.0 - (x * (x * x))) * (1.0 + (x * ((x * x) + -1.0)));
    	} else if (y <= 4.2e+124) {
    		tmp = 1.0 - x;
    	} else {
    		tmp = (1.0 + (x * (-1.0 + (x * (1.0 - x))))) * (1.0 - (x * x));
    	}
    	return tmp;
    }
    
    def code(x, y):
    	tmp = 0
    	if y <= -1.26e+151:
    		tmp = (1.0 - (x * (x * x))) * (1.0 + (x * ((x * x) + -1.0)))
    	elif y <= 4.2e+124:
    		tmp = 1.0 - x
    	else:
    		tmp = (1.0 + (x * (-1.0 + (x * (1.0 - x))))) * (1.0 - (x * x))
    	return tmp
    
    function code(x, y)
    	tmp = 0.0
    	if (y <= -1.26e+151)
    		tmp = Float64(Float64(1.0 - Float64(x * Float64(x * x))) * Float64(1.0 + Float64(x * Float64(Float64(x * x) + -1.0))));
    	elseif (y <= 4.2e+124)
    		tmp = Float64(1.0 - x);
    	else
    		tmp = Float64(Float64(1.0 + Float64(x * Float64(-1.0 + Float64(x * Float64(1.0 - x))))) * Float64(1.0 - Float64(x * x)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y)
    	tmp = 0.0;
    	if (y <= -1.26e+151)
    		tmp = (1.0 - (x * (x * x))) * (1.0 + (x * ((x * x) + -1.0)));
    	elseif (y <= 4.2e+124)
    		tmp = 1.0 - x;
    	else
    		tmp = (1.0 + (x * (-1.0 + (x * (1.0 - x))))) * (1.0 - (x * x));
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_] := If[LessEqual[y, -1.26e+151], N[(N[(1.0 - N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(x * N[(N[(x * x), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e+124], N[(1.0 - x), $MachinePrecision], N[(N[(1.0 + N[(x * N[(-1.0 + N[(x * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq -1.26 \cdot 10^{+151}:\\
    \;\;\;\;\left(1 - x \cdot \left(x \cdot x\right)\right) \cdot \left(1 + x \cdot \left(x \cdot x + -1\right)\right)\\
    
    \mathbf{elif}\;y \leq 4.2 \cdot 10^{+124}:\\
    \;\;\;\;1 - x\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(1 + x \cdot \left(-1 + x \cdot \left(1 - x\right)\right)\right) \cdot \left(1 - x \cdot x\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y < -1.26000000000000006e151

      1. Initial program 99.7%

        \[\left(1 - x\right) + y \cdot \sqrt{x} \]
      2. Add Preprocessing
      3. Taylor expanded in y around 0

        \[\leadsto \color{blue}{1 - x} \]
      4. Step-by-step derivation
        1. --lowering--.f643.9%

          \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
      5. Simplified3.9%

        \[\leadsto \color{blue}{1 - x} \]
      6. Step-by-step derivation
        1. flip3--N/A

          \[\leadsto \frac{{1}^{3} - {x}^{3}}{\color{blue}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}} \]
        2. div-invN/A

          \[\leadsto \left({1}^{3} - {x}^{3}\right) \cdot \color{blue}{\frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}} \]
        3. *-lowering-*.f64N/A

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \left({x}^{3}\right)\right), \left(\frac{\color{blue}{1}}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)\right) \]
        6. cube-multN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left(\frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)\right) \]
        8. *-lowering-*.f64N/A

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\left(1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)\right)}\right)\right) \]
        10. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \left(1 + \left(\color{blue}{x \cdot x} + 1 \cdot x\right)\right)\right)\right) \]
        11. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(x \cdot x + 1 \cdot x\right)}\right)\right)\right) \]
        12. distribute-rgt-outN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \color{blue}{\left(x + 1\right)}\right)\right)\right)\right) \]
        13. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \left(1 + \color{blue}{x}\right)\right)\right)\right)\right) \]
        14. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{\left(1 + x\right)}\right)\right)\right)\right) \]
        15. +-lowering-+.f6413.1%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(1, \color{blue}{x}\right)\right)\right)\right)\right) \]
      7. Applied egg-rr13.1%

        \[\leadsto \color{blue}{\left(1 - x \cdot \left(x \cdot x\right)\right) \cdot \frac{1}{1 + x \cdot \left(1 + x\right)}} \]
      8. Taylor expanded in x around 0

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(x \cdot \left({x}^{2} - 1\right)\right)}\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{\left({x}^{2} - 1\right)}\right)\right)\right) \]
        3. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left({x}^{2} + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right)\right)\right) \]
        4. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left({x}^{2} + -1\right)\right)\right)\right) \]
        5. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(-1 + \color{blue}{{x}^{2}}\right)\right)\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \color{blue}{\left({x}^{2}\right)}\right)\right)\right)\right) \]
        7. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \left(x \cdot \color{blue}{x}\right)\right)\right)\right)\right) \]
        8. *-lowering-*.f6421.7%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right)\right)\right) \]
      10. Simplified21.7%

        \[\leadsto \left(1 - x \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{\left(1 + x \cdot \left(-1 + x \cdot x\right)\right)} \]

      if -1.26000000000000006e151 < y < 4.20000000000000023e124

      1. Initial program 100.0%

        \[\left(1 - x\right) + y \cdot \sqrt{x} \]
      2. Add Preprocessing
      3. Taylor expanded in y around 0

        \[\leadsto \color{blue}{1 - x} \]
      4. Step-by-step derivation
        1. --lowering--.f6486.2%

          \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
      5. Simplified86.2%

        \[\leadsto \color{blue}{1 - x} \]

      if 4.20000000000000023e124 < y

      1. Initial program 99.9%

        \[\left(1 - x\right) + y \cdot \sqrt{x} \]
      2. Add Preprocessing
      3. Taylor expanded in y around 0

        \[\leadsto \color{blue}{1 - x} \]
      4. Step-by-step derivation
        1. --lowering--.f642.0%

          \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
      5. Simplified2.0%

        \[\leadsto \color{blue}{1 - x} \]
      6. Step-by-step derivation
        1. flip--N/A

          \[\leadsto \frac{1 \cdot 1 - x \cdot x}{\color{blue}{1 + x}} \]
        2. /-lowering-/.f64N/A

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

          \[\leadsto \mathsf{/.f64}\left(\left(1 - x \cdot x\right), \left(1 + x\right)\right) \]
        4. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(x \cdot x\right)\right), \left(\color{blue}{1} + x\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right), \left(1 + x\right)\right) \]
        6. +-lowering-+.f641.9%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right), \mathsf{+.f64}\left(1, \color{blue}{x}\right)\right) \]
      7. Applied egg-rr1.9%

        \[\leadsto \color{blue}{\frac{1 - x \cdot x}{1 + x}} \]
      8. Step-by-step derivation
        1. clear-numN/A

          \[\leadsto \frac{1}{\color{blue}{\frac{1 + x}{1 - x \cdot x}}} \]
        2. associate-/r/N/A

          \[\leadsto \frac{1}{1 + x} \cdot \color{blue}{\left(1 - x \cdot x\right)} \]
        3. *-lowering-*.f64N/A

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(1 + x\right)\right), \left(\color{blue}{1} - x \cdot x\right)\right) \]
        5. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(x + 1\right)\right), \left(1 - x \cdot x\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, 1\right)\right), \left(1 - x \cdot x\right)\right) \]
        7. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, 1\right)\right), \mathsf{\_.f64}\left(1, \color{blue}{\left(x \cdot x\right)}\right)\right) \]
        8. *-lowering-*.f641.9%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, 1\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right) \]
      9. Applied egg-rr1.9%

        \[\leadsto \color{blue}{\frac{1}{x + 1} \cdot \left(1 - x \cdot x\right)} \]
      10. Taylor expanded in x around 0

        \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + x \cdot \left(x \cdot \left(1 + -1 \cdot x\right) - 1\right)\right)}, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
      11. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(x \cdot \left(x \cdot \left(1 + -1 \cdot x\right) - 1\right)\right)\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(1 + -1 \cdot x\right) - 1\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        3. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(1 + -1 \cdot x\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        4. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(1 + -1 \cdot x\right) + -1\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        5. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(-1 + x \cdot \left(1 + -1 \cdot x\right)\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \left(x \cdot \left(1 + -1 \cdot x\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(x, \left(1 + -1 \cdot x\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        8. mul-1-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(x\right)\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        9. unsub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(x, \left(1 - x\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        10. --lowering--.f6428.2%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, x\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
      12. Simplified28.2%

        \[\leadsto \color{blue}{\left(1 + x \cdot \left(-1 + x \cdot \left(1 - x\right)\right)\right)} \cdot \left(1 - x \cdot x\right) \]
    3. Recombined 3 regimes into one program.
    4. Final simplification69.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.26 \cdot 10^{+151}:\\ \;\;\;\;\left(1 - x \cdot \left(x \cdot x\right)\right) \cdot \left(1 + x \cdot \left(x \cdot x + -1\right)\right)\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{+124}:\\ \;\;\;\;1 - x\\ \mathbf{else}:\\ \;\;\;\;\left(1 + x \cdot \left(-1 + x \cdot \left(1 - x\right)\right)\right) \cdot \left(1 - x \cdot x\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 8: 69.4% accurate, 4.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 - x \cdot x\\ \mathbf{if}\;y \leq -2.7 \cdot 10^{+151}:\\ \;\;\;\;t\_0 \cdot \left(1 + x \cdot \left(x + -1\right)\right)\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+124}:\\ \;\;\;\;1 - x\\ \mathbf{else}:\\ \;\;\;\;\left(1 + x \cdot \left(-1 + x \cdot \left(1 - x\right)\right)\right) \cdot t\_0\\ \end{array} \end{array} \]
    (FPCore (x y)
     :precision binary64
     (let* ((t_0 (- 1.0 (* x x))))
       (if (<= y -2.7e+151)
         (* t_0 (+ 1.0 (* x (+ x -1.0))))
         (if (<= y 7.5e+124)
           (- 1.0 x)
           (* (+ 1.0 (* x (+ -1.0 (* x (- 1.0 x))))) t_0)))))
    double code(double x, double y) {
    	double t_0 = 1.0 - (x * x);
    	double tmp;
    	if (y <= -2.7e+151) {
    		tmp = t_0 * (1.0 + (x * (x + -1.0)));
    	} else if (y <= 7.5e+124) {
    		tmp = 1.0 - x;
    	} else {
    		tmp = (1.0 + (x * (-1.0 + (x * (1.0 - x))))) * t_0;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8) :: t_0
        real(8) :: tmp
        t_0 = 1.0d0 - (x * x)
        if (y <= (-2.7d+151)) then
            tmp = t_0 * (1.0d0 + (x * (x + (-1.0d0))))
        else if (y <= 7.5d+124) then
            tmp = 1.0d0 - x
        else
            tmp = (1.0d0 + (x * ((-1.0d0) + (x * (1.0d0 - x))))) * t_0
        end if
        code = tmp
    end function
    
    public static double code(double x, double y) {
    	double t_0 = 1.0 - (x * x);
    	double tmp;
    	if (y <= -2.7e+151) {
    		tmp = t_0 * (1.0 + (x * (x + -1.0)));
    	} else if (y <= 7.5e+124) {
    		tmp = 1.0 - x;
    	} else {
    		tmp = (1.0 + (x * (-1.0 + (x * (1.0 - x))))) * t_0;
    	}
    	return tmp;
    }
    
    def code(x, y):
    	t_0 = 1.0 - (x * x)
    	tmp = 0
    	if y <= -2.7e+151:
    		tmp = t_0 * (1.0 + (x * (x + -1.0)))
    	elif y <= 7.5e+124:
    		tmp = 1.0 - x
    	else:
    		tmp = (1.0 + (x * (-1.0 + (x * (1.0 - x))))) * t_0
    	return tmp
    
    function code(x, y)
    	t_0 = Float64(1.0 - Float64(x * x))
    	tmp = 0.0
    	if (y <= -2.7e+151)
    		tmp = Float64(t_0 * Float64(1.0 + Float64(x * Float64(x + -1.0))));
    	elseif (y <= 7.5e+124)
    		tmp = Float64(1.0 - x);
    	else
    		tmp = Float64(Float64(1.0 + Float64(x * Float64(-1.0 + Float64(x * Float64(1.0 - x))))) * t_0);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y)
    	t_0 = 1.0 - (x * x);
    	tmp = 0.0;
    	if (y <= -2.7e+151)
    		tmp = t_0 * (1.0 + (x * (x + -1.0)));
    	elseif (y <= 7.5e+124)
    		tmp = 1.0 - x;
    	else
    		tmp = (1.0 + (x * (-1.0 + (x * (1.0 - x))))) * t_0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_] := Block[{t$95$0 = N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.7e+151], N[(t$95$0 * N[(1.0 + N[(x * N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e+124], N[(1.0 - x), $MachinePrecision], N[(N[(1.0 + N[(x * N[(-1.0 + N[(x * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := 1 - x \cdot x\\
    \mathbf{if}\;y \leq -2.7 \cdot 10^{+151}:\\
    \;\;\;\;t\_0 \cdot \left(1 + x \cdot \left(x + -1\right)\right)\\
    
    \mathbf{elif}\;y \leq 7.5 \cdot 10^{+124}:\\
    \;\;\;\;1 - x\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(1 + x \cdot \left(-1 + x \cdot \left(1 - x\right)\right)\right) \cdot t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y < -2.7000000000000001e151

      1. Initial program 99.7%

        \[\left(1 - x\right) + y \cdot \sqrt{x} \]
      2. Add Preprocessing
      3. Taylor expanded in y around 0

        \[\leadsto \color{blue}{1 - x} \]
      4. Step-by-step derivation
        1. --lowering--.f643.9%

          \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
      5. Simplified3.9%

        \[\leadsto \color{blue}{1 - x} \]
      6. Step-by-step derivation
        1. flip--N/A

          \[\leadsto \frac{1 \cdot 1 - x \cdot x}{\color{blue}{1 + x}} \]
        2. /-lowering-/.f64N/A

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

          \[\leadsto \mathsf{/.f64}\left(\left(1 - x \cdot x\right), \left(1 + x\right)\right) \]
        4. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(x \cdot x\right)\right), \left(\color{blue}{1} + x\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right), \left(1 + x\right)\right) \]
        6. +-lowering-+.f6410.4%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right), \mathsf{+.f64}\left(1, \color{blue}{x}\right)\right) \]
      7. Applied egg-rr10.4%

        \[\leadsto \color{blue}{\frac{1 - x \cdot x}{1 + x}} \]
      8. Step-by-step derivation
        1. clear-numN/A

          \[\leadsto \frac{1}{\color{blue}{\frac{1 + x}{1 - x \cdot x}}} \]
        2. associate-/r/N/A

          \[\leadsto \frac{1}{1 + x} \cdot \color{blue}{\left(1 - x \cdot x\right)} \]
        3. *-lowering-*.f64N/A

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(1 + x\right)\right), \left(\color{blue}{1} - x \cdot x\right)\right) \]
        5. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(x + 1\right)\right), \left(1 - x \cdot x\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, 1\right)\right), \left(1 - x \cdot x\right)\right) \]
        7. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, 1\right)\right), \mathsf{\_.f64}\left(1, \color{blue}{\left(x \cdot x\right)}\right)\right) \]
        8. *-lowering-*.f6410.4%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, 1\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right) \]
      9. Applied egg-rr10.4%

        \[\leadsto \color{blue}{\frac{1}{x + 1} \cdot \left(1 - x \cdot x\right)} \]
      10. Taylor expanded in x around 0

        \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + x \cdot \left(x - 1\right)\right)}, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
      11. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(x \cdot \left(x - 1\right)\right)\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x - 1\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        3. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        4. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x + -1\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        5. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(-1 + x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        6. +-lowering-+.f6421.5%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
      12. Simplified21.5%

        \[\leadsto \color{blue}{\left(1 + x \cdot \left(-1 + x\right)\right)} \cdot \left(1 - x \cdot x\right) \]

      if -2.7000000000000001e151 < y < 7.50000000000000038e124

      1. Initial program 100.0%

        \[\left(1 - x\right) + y \cdot \sqrt{x} \]
      2. Add Preprocessing
      3. Taylor expanded in y around 0

        \[\leadsto \color{blue}{1 - x} \]
      4. Step-by-step derivation
        1. --lowering--.f6486.2%

          \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
      5. Simplified86.2%

        \[\leadsto \color{blue}{1 - x} \]

      if 7.50000000000000038e124 < y

      1. Initial program 99.9%

        \[\left(1 - x\right) + y \cdot \sqrt{x} \]
      2. Add Preprocessing
      3. Taylor expanded in y around 0

        \[\leadsto \color{blue}{1 - x} \]
      4. Step-by-step derivation
        1. --lowering--.f642.0%

          \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
      5. Simplified2.0%

        \[\leadsto \color{blue}{1 - x} \]
      6. Step-by-step derivation
        1. flip--N/A

          \[\leadsto \frac{1 \cdot 1 - x \cdot x}{\color{blue}{1 + x}} \]
        2. /-lowering-/.f64N/A

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

          \[\leadsto \mathsf{/.f64}\left(\left(1 - x \cdot x\right), \left(1 + x\right)\right) \]
        4. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(x \cdot x\right)\right), \left(\color{blue}{1} + x\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right), \left(1 + x\right)\right) \]
        6. +-lowering-+.f641.9%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right), \mathsf{+.f64}\left(1, \color{blue}{x}\right)\right) \]
      7. Applied egg-rr1.9%

        \[\leadsto \color{blue}{\frac{1 - x \cdot x}{1 + x}} \]
      8. Step-by-step derivation
        1. clear-numN/A

          \[\leadsto \frac{1}{\color{blue}{\frac{1 + x}{1 - x \cdot x}}} \]
        2. associate-/r/N/A

          \[\leadsto \frac{1}{1 + x} \cdot \color{blue}{\left(1 - x \cdot x\right)} \]
        3. *-lowering-*.f64N/A

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(1 + x\right)\right), \left(\color{blue}{1} - x \cdot x\right)\right) \]
        5. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(x + 1\right)\right), \left(1 - x \cdot x\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, 1\right)\right), \left(1 - x \cdot x\right)\right) \]
        7. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, 1\right)\right), \mathsf{\_.f64}\left(1, \color{blue}{\left(x \cdot x\right)}\right)\right) \]
        8. *-lowering-*.f641.9%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, 1\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right) \]
      9. Applied egg-rr1.9%

        \[\leadsto \color{blue}{\frac{1}{x + 1} \cdot \left(1 - x \cdot x\right)} \]
      10. Taylor expanded in x around 0

        \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + x \cdot \left(x \cdot \left(1 + -1 \cdot x\right) - 1\right)\right)}, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
      11. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(x \cdot \left(x \cdot \left(1 + -1 \cdot x\right) - 1\right)\right)\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(1 + -1 \cdot x\right) - 1\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        3. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(1 + -1 \cdot x\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        4. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(1 + -1 \cdot x\right) + -1\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        5. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(-1 + x \cdot \left(1 + -1 \cdot x\right)\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \left(x \cdot \left(1 + -1 \cdot x\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(x, \left(1 + -1 \cdot x\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        8. mul-1-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(x\right)\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        9. unsub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(x, \left(1 - x\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        10. --lowering--.f6428.2%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, x\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
      12. Simplified28.2%

        \[\leadsto \color{blue}{\left(1 + x \cdot \left(-1 + x \cdot \left(1 - x\right)\right)\right)} \cdot \left(1 - x \cdot x\right) \]
    3. Recombined 3 regimes into one program.
    4. Final simplification69.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.7 \cdot 10^{+151}:\\ \;\;\;\;\left(1 - x \cdot x\right) \cdot \left(1 + x \cdot \left(x + -1\right)\right)\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+124}:\\ \;\;\;\;1 - x\\ \mathbf{else}:\\ \;\;\;\;\left(1 + x \cdot \left(-1 + x \cdot \left(1 - x\right)\right)\right) \cdot \left(1 - x \cdot x\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 9: 69.3% accurate, 5.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{+152}:\\ \;\;\;\;\left(1 - x \cdot x\right) \cdot \left(1 + x \cdot \left(x + -1\right)\right)\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{+125}:\\ \;\;\;\;1 - x\\ \mathbf{else}:\\ \;\;\;\;\left(1 - x\right) \cdot \left(1 - x \cdot \left(x \cdot x\right)\right)\\ \end{array} \end{array} \]
    (FPCore (x y)
     :precision binary64
     (if (<= y -2.6e+152)
       (* (- 1.0 (* x x)) (+ 1.0 (* x (+ x -1.0))))
       (if (<= y 4.8e+125) (- 1.0 x) (* (- 1.0 x) (- 1.0 (* x (* x x)))))))
    double code(double x, double y) {
    	double tmp;
    	if (y <= -2.6e+152) {
    		tmp = (1.0 - (x * x)) * (1.0 + (x * (x + -1.0)));
    	} else if (y <= 4.8e+125) {
    		tmp = 1.0 - x;
    	} else {
    		tmp = (1.0 - x) * (1.0 - (x * (x * x)));
    	}
    	return tmp;
    }
    
    real(8) function code(x, y)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8) :: tmp
        if (y <= (-2.6d+152)) then
            tmp = (1.0d0 - (x * x)) * (1.0d0 + (x * (x + (-1.0d0))))
        else if (y <= 4.8d+125) then
            tmp = 1.0d0 - x
        else
            tmp = (1.0d0 - x) * (1.0d0 - (x * (x * x)))
        end if
        code = tmp
    end function
    
    public static double code(double x, double y) {
    	double tmp;
    	if (y <= -2.6e+152) {
    		tmp = (1.0 - (x * x)) * (1.0 + (x * (x + -1.0)));
    	} else if (y <= 4.8e+125) {
    		tmp = 1.0 - x;
    	} else {
    		tmp = (1.0 - x) * (1.0 - (x * (x * x)));
    	}
    	return tmp;
    }
    
    def code(x, y):
    	tmp = 0
    	if y <= -2.6e+152:
    		tmp = (1.0 - (x * x)) * (1.0 + (x * (x + -1.0)))
    	elif y <= 4.8e+125:
    		tmp = 1.0 - x
    	else:
    		tmp = (1.0 - x) * (1.0 - (x * (x * x)))
    	return tmp
    
    function code(x, y)
    	tmp = 0.0
    	if (y <= -2.6e+152)
    		tmp = Float64(Float64(1.0 - Float64(x * x)) * Float64(1.0 + Float64(x * Float64(x + -1.0))));
    	elseif (y <= 4.8e+125)
    		tmp = Float64(1.0 - x);
    	else
    		tmp = Float64(Float64(1.0 - x) * Float64(1.0 - Float64(x * Float64(x * x))));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y)
    	tmp = 0.0;
    	if (y <= -2.6e+152)
    		tmp = (1.0 - (x * x)) * (1.0 + (x * (x + -1.0)));
    	elseif (y <= 4.8e+125)
    		tmp = 1.0 - x;
    	else
    		tmp = (1.0 - x) * (1.0 - (x * (x * x)));
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_] := If[LessEqual[y, -2.6e+152], N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(x * N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e+125], N[(1.0 - x), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] * N[(1.0 - N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq -2.6 \cdot 10^{+152}:\\
    \;\;\;\;\left(1 - x \cdot x\right) \cdot \left(1 + x \cdot \left(x + -1\right)\right)\\
    
    \mathbf{elif}\;y \leq 4.8 \cdot 10^{+125}:\\
    \;\;\;\;1 - x\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(1 - x\right) \cdot \left(1 - x \cdot \left(x \cdot x\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y < -2.6000000000000001e152

      1. Initial program 99.7%

        \[\left(1 - x\right) + y \cdot \sqrt{x} \]
      2. Add Preprocessing
      3. Taylor expanded in y around 0

        \[\leadsto \color{blue}{1 - x} \]
      4. Step-by-step derivation
        1. --lowering--.f643.9%

          \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
      5. Simplified3.9%

        \[\leadsto \color{blue}{1 - x} \]
      6. Step-by-step derivation
        1. flip--N/A

          \[\leadsto \frac{1 \cdot 1 - x \cdot x}{\color{blue}{1 + x}} \]
        2. /-lowering-/.f64N/A

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

          \[\leadsto \mathsf{/.f64}\left(\left(1 - x \cdot x\right), \left(1 + x\right)\right) \]
        4. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(x \cdot x\right)\right), \left(\color{blue}{1} + x\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right), \left(1 + x\right)\right) \]
        6. +-lowering-+.f6410.4%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right), \mathsf{+.f64}\left(1, \color{blue}{x}\right)\right) \]
      7. Applied egg-rr10.4%

        \[\leadsto \color{blue}{\frac{1 - x \cdot x}{1 + x}} \]
      8. Step-by-step derivation
        1. clear-numN/A

          \[\leadsto \frac{1}{\color{blue}{\frac{1 + x}{1 - x \cdot x}}} \]
        2. associate-/r/N/A

          \[\leadsto \frac{1}{1 + x} \cdot \color{blue}{\left(1 - x \cdot x\right)} \]
        3. *-lowering-*.f64N/A

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(1 + x\right)\right), \left(\color{blue}{1} - x \cdot x\right)\right) \]
        5. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(x + 1\right)\right), \left(1 - x \cdot x\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, 1\right)\right), \left(1 - x \cdot x\right)\right) \]
        7. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, 1\right)\right), \mathsf{\_.f64}\left(1, \color{blue}{\left(x \cdot x\right)}\right)\right) \]
        8. *-lowering-*.f6410.4%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, 1\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right) \]
      9. Applied egg-rr10.4%

        \[\leadsto \color{blue}{\frac{1}{x + 1} \cdot \left(1 - x \cdot x\right)} \]
      10. Taylor expanded in x around 0

        \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + x \cdot \left(x - 1\right)\right)}, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
      11. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(x \cdot \left(x - 1\right)\right)\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x - 1\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        3. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        4. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x + -1\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        5. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(-1 + x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
        6. +-lowering-+.f6421.5%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
      12. Simplified21.5%

        \[\leadsto \color{blue}{\left(1 + x \cdot \left(-1 + x\right)\right)} \cdot \left(1 - x \cdot x\right) \]

      if -2.6000000000000001e152 < y < 4.7999999999999999e125

      1. Initial program 100.0%

        \[\left(1 - x\right) + y \cdot \sqrt{x} \]
      2. Add Preprocessing
      3. Taylor expanded in y around 0

        \[\leadsto \color{blue}{1 - x} \]
      4. Step-by-step derivation
        1. --lowering--.f6486.2%

          \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
      5. Simplified86.2%

        \[\leadsto \color{blue}{1 - x} \]

      if 4.7999999999999999e125 < y

      1. Initial program 99.9%

        \[\left(1 - x\right) + y \cdot \sqrt{x} \]
      2. Add Preprocessing
      3. Taylor expanded in y around 0

        \[\leadsto \color{blue}{1 - x} \]
      4. Step-by-step derivation
        1. --lowering--.f642.0%

          \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
      5. Simplified2.0%

        \[\leadsto \color{blue}{1 - x} \]
      6. Step-by-step derivation
        1. flip3--N/A

          \[\leadsto \frac{{1}^{3} - {x}^{3}}{\color{blue}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}} \]
        2. div-invN/A

          \[\leadsto \left({1}^{3} - {x}^{3}\right) \cdot \color{blue}{\frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}} \]
        3. *-lowering-*.f64N/A

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \left({x}^{3}\right)\right), \left(\frac{\color{blue}{1}}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)\right) \]
        6. cube-multN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left(\frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)\right) \]
        8. *-lowering-*.f64N/A

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\left(1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)\right)}\right)\right) \]
        10. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \left(1 + \left(\color{blue}{x \cdot x} + 1 \cdot x\right)\right)\right)\right) \]
        11. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(x \cdot x + 1 \cdot x\right)}\right)\right)\right) \]
        12. distribute-rgt-outN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \color{blue}{\left(x + 1\right)}\right)\right)\right)\right) \]
        13. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \left(1 + \color{blue}{x}\right)\right)\right)\right)\right) \]
        14. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{\left(1 + x\right)}\right)\right)\right)\right) \]
        15. +-lowering-+.f641.9%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(1, \color{blue}{x}\right)\right)\right)\right)\right) \]
      7. Applied egg-rr1.9%

        \[\leadsto \color{blue}{\left(1 - x \cdot \left(x \cdot x\right)\right) \cdot \frac{1}{1 + x \cdot \left(1 + x\right)}} \]
      8. Taylor expanded in x around 0

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \color{blue}{\left(1 + -1 \cdot x\right)}\right) \]
      9. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(1 + \left(\mathsf{neg}\left(x\right)\right)\right)\right) \]
        2. unsub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(1 - \color{blue}{x}\right)\right) \]
        3. --lowering--.f6426.3%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{\_.f64}\left(1, \color{blue}{x}\right)\right) \]
      10. Simplified26.3%

        \[\leadsto \left(1 - x \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{\left(1 - x\right)} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification68.8%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{+152}:\\ \;\;\;\;\left(1 - x \cdot x\right) \cdot \left(1 + x \cdot \left(x + -1\right)\right)\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{+125}:\\ \;\;\;\;1 - x\\ \mathbf{else}:\\ \;\;\;\;\left(1 - x\right) \cdot \left(1 - x \cdot \left(x \cdot x\right)\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 10: 69.2% accurate, 5.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 - x \cdot \left(x \cdot x\right)\\ \mathbf{if}\;y \leq -2.5 \cdot 10^{+151}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{+125}:\\ \;\;\;\;1 - x\\ \mathbf{else}:\\ \;\;\;\;\left(1 - x\right) \cdot t\_0\\ \end{array} \end{array} \]
    (FPCore (x y)
     :precision binary64
     (let* ((t_0 (- 1.0 (* x (* x x)))))
       (if (<= y -2.5e+151) t_0 (if (<= y 3.2e+125) (- 1.0 x) (* (- 1.0 x) t_0)))))
    double code(double x, double y) {
    	double t_0 = 1.0 - (x * (x * x));
    	double tmp;
    	if (y <= -2.5e+151) {
    		tmp = t_0;
    	} else if (y <= 3.2e+125) {
    		tmp = 1.0 - x;
    	} else {
    		tmp = (1.0 - x) * t_0;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8) :: t_0
        real(8) :: tmp
        t_0 = 1.0d0 - (x * (x * x))
        if (y <= (-2.5d+151)) then
            tmp = t_0
        else if (y <= 3.2d+125) then
            tmp = 1.0d0 - x
        else
            tmp = (1.0d0 - x) * t_0
        end if
        code = tmp
    end function
    
    public static double code(double x, double y) {
    	double t_0 = 1.0 - (x * (x * x));
    	double tmp;
    	if (y <= -2.5e+151) {
    		tmp = t_0;
    	} else if (y <= 3.2e+125) {
    		tmp = 1.0 - x;
    	} else {
    		tmp = (1.0 - x) * t_0;
    	}
    	return tmp;
    }
    
    def code(x, y):
    	t_0 = 1.0 - (x * (x * x))
    	tmp = 0
    	if y <= -2.5e+151:
    		tmp = t_0
    	elif y <= 3.2e+125:
    		tmp = 1.0 - x
    	else:
    		tmp = (1.0 - x) * t_0
    	return tmp
    
    function code(x, y)
    	t_0 = Float64(1.0 - Float64(x * Float64(x * x)))
    	tmp = 0.0
    	if (y <= -2.5e+151)
    		tmp = t_0;
    	elseif (y <= 3.2e+125)
    		tmp = Float64(1.0 - x);
    	else
    		tmp = Float64(Float64(1.0 - x) * t_0);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y)
    	t_0 = 1.0 - (x * (x * x));
    	tmp = 0.0;
    	if (y <= -2.5e+151)
    		tmp = t_0;
    	elseif (y <= 3.2e+125)
    		tmp = 1.0 - x;
    	else
    		tmp = (1.0 - x) * t_0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_] := Block[{t$95$0 = N[(1.0 - N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.5e+151], t$95$0, If[LessEqual[y, 3.2e+125], N[(1.0 - x), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] * t$95$0), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := 1 - x \cdot \left(x \cdot x\right)\\
    \mathbf{if}\;y \leq -2.5 \cdot 10^{+151}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;y \leq 3.2 \cdot 10^{+125}:\\
    \;\;\;\;1 - x\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(1 - x\right) \cdot t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y < -2.5000000000000001e151

      1. Initial program 99.7%

        \[\left(1 - x\right) + y \cdot \sqrt{x} \]
      2. Add Preprocessing
      3. Taylor expanded in y around 0

        \[\leadsto \color{blue}{1 - x} \]
      4. Step-by-step derivation
        1. --lowering--.f643.9%

          \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
      5. Simplified3.9%

        \[\leadsto \color{blue}{1 - x} \]
      6. Step-by-step derivation
        1. flip3--N/A

          \[\leadsto \frac{{1}^{3} - {x}^{3}}{\color{blue}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}} \]
        2. div-invN/A

          \[\leadsto \left({1}^{3} - {x}^{3}\right) \cdot \color{blue}{\frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}} \]
        3. *-lowering-*.f64N/A

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \left({x}^{3}\right)\right), \left(\frac{\color{blue}{1}}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)\right) \]
        6. cube-multN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left(\frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)\right) \]
        8. *-lowering-*.f64N/A

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\left(1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)\right)}\right)\right) \]
        10. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \left(1 + \left(\color{blue}{x \cdot x} + 1 \cdot x\right)\right)\right)\right) \]
        11. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(x \cdot x + 1 \cdot x\right)}\right)\right)\right) \]
        12. distribute-rgt-outN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \color{blue}{\left(x + 1\right)}\right)\right)\right)\right) \]
        13. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \left(1 + \color{blue}{x}\right)\right)\right)\right)\right) \]
        14. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{\left(1 + x\right)}\right)\right)\right)\right) \]
        15. +-lowering-+.f6413.1%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(1, \color{blue}{x}\right)\right)\right)\right)\right) \]
      7. Applied egg-rr13.1%

        \[\leadsto \color{blue}{\left(1 - x \cdot \left(x \cdot x\right)\right) \cdot \frac{1}{1 + x \cdot \left(1 + x\right)}} \]
      8. Taylor expanded in x around 0

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \color{blue}{1}\right) \]
      9. Step-by-step derivation
        1. Simplified21.2%

          \[\leadsto \left(1 - x \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{1} \]

        if -2.5000000000000001e151 < y < 3.19999999999999983e125

        1. Initial program 100.0%

          \[\left(1 - x\right) + y \cdot \sqrt{x} \]
        2. Add Preprocessing
        3. Taylor expanded in y around 0

          \[\leadsto \color{blue}{1 - x} \]
        4. Step-by-step derivation
          1. --lowering--.f6486.2%

            \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
        5. Simplified86.2%

          \[\leadsto \color{blue}{1 - x} \]

        if 3.19999999999999983e125 < y

        1. Initial program 99.9%

          \[\left(1 - x\right) + y \cdot \sqrt{x} \]
        2. Add Preprocessing
        3. Taylor expanded in y around 0

          \[\leadsto \color{blue}{1 - x} \]
        4. Step-by-step derivation
          1. --lowering--.f642.0%

            \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
        5. Simplified2.0%

          \[\leadsto \color{blue}{1 - x} \]
        6. Step-by-step derivation
          1. flip3--N/A

            \[\leadsto \frac{{1}^{3} - {x}^{3}}{\color{blue}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}} \]
          2. div-invN/A

            \[\leadsto \left({1}^{3} - {x}^{3}\right) \cdot \color{blue}{\frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}} \]
          3. *-lowering-*.f64N/A

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \left({x}^{3}\right)\right), \left(\frac{\color{blue}{1}}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)\right) \]
          6. cube-multN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left(\frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)\right) \]
          8. *-lowering-*.f64N/A

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\left(1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)\right)}\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \left(1 + \left(\color{blue}{x \cdot x} + 1 \cdot x\right)\right)\right)\right) \]
          11. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(x \cdot x + 1 \cdot x\right)}\right)\right)\right) \]
          12. distribute-rgt-outN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \color{blue}{\left(x + 1\right)}\right)\right)\right)\right) \]
          13. +-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \left(1 + \color{blue}{x}\right)\right)\right)\right)\right) \]
          14. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{\left(1 + x\right)}\right)\right)\right)\right) \]
          15. +-lowering-+.f641.9%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(1, \color{blue}{x}\right)\right)\right)\right)\right) \]
        7. Applied egg-rr1.9%

          \[\leadsto \color{blue}{\left(1 - x \cdot \left(x \cdot x\right)\right) \cdot \frac{1}{1 + x \cdot \left(1 + x\right)}} \]
        8. Taylor expanded in x around 0

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \color{blue}{\left(1 + -1 \cdot x\right)}\right) \]
        9. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(1 + \left(\mathsf{neg}\left(x\right)\right)\right)\right) \]
          2. unsub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(1 - \color{blue}{x}\right)\right) \]
          3. --lowering--.f6426.3%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{\_.f64}\left(1, \color{blue}{x}\right)\right) \]
        10. Simplified26.3%

          \[\leadsto \left(1 - x \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{\left(1 - x\right)} \]
      10. Recombined 3 regimes into one program.
      11. Final simplification68.8%

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.5 \cdot 10^{+151}:\\ \;\;\;\;1 - x \cdot \left(x \cdot x\right)\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{+125}:\\ \;\;\;\;1 - x\\ \mathbf{else}:\\ \;\;\;\;\left(1 - x\right) \cdot \left(1 - x \cdot \left(x \cdot x\right)\right)\\ \end{array} \]
      12. Add Preprocessing

      Alternative 11: 69.0% accurate, 5.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{+151}:\\ \;\;\;\;1 - x \cdot \left(x \cdot x\right)\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{+125}:\\ \;\;\;\;1 - x\\ \mathbf{else}:\\ \;\;\;\;\left(1 - x\right) \cdot \left(1 - x \cdot x\right)\\ \end{array} \end{array} \]
      (FPCore (x y)
       :precision binary64
       (if (<= y -8e+151)
         (- 1.0 (* x (* x x)))
         (if (<= y 4.8e+125) (- 1.0 x) (* (- 1.0 x) (- 1.0 (* x x))))))
      double code(double x, double y) {
      	double tmp;
      	if (y <= -8e+151) {
      		tmp = 1.0 - (x * (x * x));
      	} else if (y <= 4.8e+125) {
      		tmp = 1.0 - x;
      	} else {
      		tmp = (1.0 - x) * (1.0 - (x * x));
      	}
      	return tmp;
      }
      
      real(8) function code(x, y)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8) :: tmp
          if (y <= (-8d+151)) then
              tmp = 1.0d0 - (x * (x * x))
          else if (y <= 4.8d+125) then
              tmp = 1.0d0 - x
          else
              tmp = (1.0d0 - x) * (1.0d0 - (x * x))
          end if
          code = tmp
      end function
      
      public static double code(double x, double y) {
      	double tmp;
      	if (y <= -8e+151) {
      		tmp = 1.0 - (x * (x * x));
      	} else if (y <= 4.8e+125) {
      		tmp = 1.0 - x;
      	} else {
      		tmp = (1.0 - x) * (1.0 - (x * x));
      	}
      	return tmp;
      }
      
      def code(x, y):
      	tmp = 0
      	if y <= -8e+151:
      		tmp = 1.0 - (x * (x * x))
      	elif y <= 4.8e+125:
      		tmp = 1.0 - x
      	else:
      		tmp = (1.0 - x) * (1.0 - (x * x))
      	return tmp
      
      function code(x, y)
      	tmp = 0.0
      	if (y <= -8e+151)
      		tmp = Float64(1.0 - Float64(x * Float64(x * x)));
      	elseif (y <= 4.8e+125)
      		tmp = Float64(1.0 - x);
      	else
      		tmp = Float64(Float64(1.0 - x) * Float64(1.0 - Float64(x * x)));
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y)
      	tmp = 0.0;
      	if (y <= -8e+151)
      		tmp = 1.0 - (x * (x * x));
      	elseif (y <= 4.8e+125)
      		tmp = 1.0 - x;
      	else
      		tmp = (1.0 - x) * (1.0 - (x * x));
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_] := If[LessEqual[y, -8e+151], N[(1.0 - N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e+125], N[(1.0 - x), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] * N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y \leq -8 \cdot 10^{+151}:\\
      \;\;\;\;1 - x \cdot \left(x \cdot x\right)\\
      
      \mathbf{elif}\;y \leq 4.8 \cdot 10^{+125}:\\
      \;\;\;\;1 - x\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(1 - x\right) \cdot \left(1 - x \cdot x\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if y < -8.00000000000000014e151

        1. Initial program 99.7%

          \[\left(1 - x\right) + y \cdot \sqrt{x} \]
        2. Add Preprocessing
        3. Taylor expanded in y around 0

          \[\leadsto \color{blue}{1 - x} \]
        4. Step-by-step derivation
          1. --lowering--.f643.9%

            \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
        5. Simplified3.9%

          \[\leadsto \color{blue}{1 - x} \]
        6. Step-by-step derivation
          1. flip3--N/A

            \[\leadsto \frac{{1}^{3} - {x}^{3}}{\color{blue}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}} \]
          2. div-invN/A

            \[\leadsto \left({1}^{3} - {x}^{3}\right) \cdot \color{blue}{\frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}} \]
          3. *-lowering-*.f64N/A

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \left({x}^{3}\right)\right), \left(\frac{\color{blue}{1}}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)\right) \]
          6. cube-multN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \left(x \cdot \left(x \cdot x\right)\right)\right), \left(\frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left(\frac{1}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}\right)\right) \]
          8. *-lowering-*.f64N/A

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\left(1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)\right)}\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \left(1 + \left(\color{blue}{x \cdot x} + 1 \cdot x\right)\right)\right)\right) \]
          11. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(x \cdot x + 1 \cdot x\right)}\right)\right)\right) \]
          12. distribute-rgt-outN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \color{blue}{\left(x + 1\right)}\right)\right)\right)\right) \]
          13. +-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \left(1 + \color{blue}{x}\right)\right)\right)\right)\right) \]
          14. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{\left(1 + x\right)}\right)\right)\right)\right) \]
          15. +-lowering-+.f6413.1%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(1, \color{blue}{x}\right)\right)\right)\right)\right) \]
        7. Applied egg-rr13.1%

          \[\leadsto \color{blue}{\left(1 - x \cdot \left(x \cdot x\right)\right) \cdot \frac{1}{1 + x \cdot \left(1 + x\right)}} \]
        8. Taylor expanded in x around 0

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \color{blue}{1}\right) \]
        9. Step-by-step derivation
          1. Simplified21.2%

            \[\leadsto \left(1 - x \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{1} \]

          if -8.00000000000000014e151 < y < 4.7999999999999999e125

          1. Initial program 100.0%

            \[\left(1 - x\right) + y \cdot \sqrt{x} \]
          2. Add Preprocessing
          3. Taylor expanded in y around 0

            \[\leadsto \color{blue}{1 - x} \]
          4. Step-by-step derivation
            1. --lowering--.f6486.2%

              \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
          5. Simplified86.2%

            \[\leadsto \color{blue}{1 - x} \]

          if 4.7999999999999999e125 < y

          1. Initial program 99.9%

            \[\left(1 - x\right) + y \cdot \sqrt{x} \]
          2. Add Preprocessing
          3. Taylor expanded in y around 0

            \[\leadsto \color{blue}{1 - x} \]
          4. Step-by-step derivation
            1. --lowering--.f642.0%

              \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
          5. Simplified2.0%

            \[\leadsto \color{blue}{1 - x} \]
          6. Step-by-step derivation
            1. flip--N/A

              \[\leadsto \frac{1 \cdot 1 - x \cdot x}{\color{blue}{1 + x}} \]
            2. /-lowering-/.f64N/A

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

              \[\leadsto \mathsf{/.f64}\left(\left(1 - x \cdot x\right), \left(1 + x\right)\right) \]
            4. --lowering--.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(x \cdot x\right)\right), \left(\color{blue}{1} + x\right)\right) \]
            5. *-lowering-*.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right), \left(1 + x\right)\right) \]
            6. +-lowering-+.f641.9%

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right), \mathsf{+.f64}\left(1, \color{blue}{x}\right)\right) \]
          7. Applied egg-rr1.9%

            \[\leadsto \color{blue}{\frac{1 - x \cdot x}{1 + x}} \]
          8. Step-by-step derivation
            1. clear-numN/A

              \[\leadsto \frac{1}{\color{blue}{\frac{1 + x}{1 - x \cdot x}}} \]
            2. associate-/r/N/A

              \[\leadsto \frac{1}{1 + x} \cdot \color{blue}{\left(1 - x \cdot x\right)} \]
            3. *-lowering-*.f64N/A

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(1 + x\right)\right), \left(\color{blue}{1} - x \cdot x\right)\right) \]
            5. +-commutativeN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(x + 1\right)\right), \left(1 - x \cdot x\right)\right) \]
            6. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, 1\right)\right), \left(1 - x \cdot x\right)\right) \]
            7. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, 1\right)\right), \mathsf{\_.f64}\left(1, \color{blue}{\left(x \cdot x\right)}\right)\right) \]
            8. *-lowering-*.f641.9%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, 1\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right) \]
          9. Applied egg-rr1.9%

            \[\leadsto \color{blue}{\frac{1}{x + 1} \cdot \left(1 - x \cdot x\right)} \]
          10. Taylor expanded in x around 0

            \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + -1 \cdot x\right)}, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
          11. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\left(1 + \left(\mathsf{neg}\left(x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
            2. unsub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\left(1 - x\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
            3. --lowering--.f6425.9%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, x\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
          12. Simplified25.9%

            \[\leadsto \color{blue}{\left(1 - x\right)} \cdot \left(1 - x \cdot x\right) \]
        10. Recombined 3 regimes into one program.
        11. Final simplification68.7%

          \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{+151}:\\ \;\;\;\;1 - x \cdot \left(x \cdot x\right)\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{+125}:\\ \;\;\;\;1 - x\\ \mathbf{else}:\\ \;\;\;\;\left(1 - x\right) \cdot \left(1 - x \cdot x\right)\\ \end{array} \]
        12. Add Preprocessing

        Alternative 12: 66.6% accurate, 7.6× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 4.4 \cdot 10^{+125}:\\ \;\;\;\;1 - x\\ \mathbf{else}:\\ \;\;\;\;\left(1 - x\right) \cdot \left(1 - x \cdot x\right)\\ \end{array} \end{array} \]
        (FPCore (x y)
         :precision binary64
         (if (<= y 4.4e+125) (- 1.0 x) (* (- 1.0 x) (- 1.0 (* x x)))))
        double code(double x, double y) {
        	double tmp;
        	if (y <= 4.4e+125) {
        		tmp = 1.0 - x;
        	} else {
        		tmp = (1.0 - x) * (1.0 - (x * x));
        	}
        	return tmp;
        }
        
        real(8) function code(x, y)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8) :: tmp
            if (y <= 4.4d+125) then
                tmp = 1.0d0 - x
            else
                tmp = (1.0d0 - x) * (1.0d0 - (x * x))
            end if
            code = tmp
        end function
        
        public static double code(double x, double y) {
        	double tmp;
        	if (y <= 4.4e+125) {
        		tmp = 1.0 - x;
        	} else {
        		tmp = (1.0 - x) * (1.0 - (x * x));
        	}
        	return tmp;
        }
        
        def code(x, y):
        	tmp = 0
        	if y <= 4.4e+125:
        		tmp = 1.0 - x
        	else:
        		tmp = (1.0 - x) * (1.0 - (x * x))
        	return tmp
        
        function code(x, y)
        	tmp = 0.0
        	if (y <= 4.4e+125)
        		tmp = Float64(1.0 - x);
        	else
        		tmp = Float64(Float64(1.0 - x) * Float64(1.0 - Float64(x * x)));
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y)
        	tmp = 0.0;
        	if (y <= 4.4e+125)
        		tmp = 1.0 - x;
        	else
        		tmp = (1.0 - x) * (1.0 - (x * x));
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_] := If[LessEqual[y, 4.4e+125], N[(1.0 - x), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] * N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;y \leq 4.4 \cdot 10^{+125}:\\
        \;\;\;\;1 - x\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(1 - x\right) \cdot \left(1 - x \cdot x\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < 4.39999999999999982e125

          1. Initial program 99.9%

            \[\left(1 - x\right) + y \cdot \sqrt{x} \]
          2. Add Preprocessing
          3. Taylor expanded in y around 0

            \[\leadsto \color{blue}{1 - x} \]
          4. Step-by-step derivation
            1. --lowering--.f6475.0%

              \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
          5. Simplified75.0%

            \[\leadsto \color{blue}{1 - x} \]

          if 4.39999999999999982e125 < y

          1. Initial program 99.9%

            \[\left(1 - x\right) + y \cdot \sqrt{x} \]
          2. Add Preprocessing
          3. Taylor expanded in y around 0

            \[\leadsto \color{blue}{1 - x} \]
          4. Step-by-step derivation
            1. --lowering--.f642.0%

              \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
          5. Simplified2.0%

            \[\leadsto \color{blue}{1 - x} \]
          6. Step-by-step derivation
            1. flip--N/A

              \[\leadsto \frac{1 \cdot 1 - x \cdot x}{\color{blue}{1 + x}} \]
            2. /-lowering-/.f64N/A

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

              \[\leadsto \mathsf{/.f64}\left(\left(1 - x \cdot x\right), \left(1 + x\right)\right) \]
            4. --lowering--.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(x \cdot x\right)\right), \left(\color{blue}{1} + x\right)\right) \]
            5. *-lowering-*.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right), \left(1 + x\right)\right) \]
            6. +-lowering-+.f641.9%

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right), \mathsf{+.f64}\left(1, \color{blue}{x}\right)\right) \]
          7. Applied egg-rr1.9%

            \[\leadsto \color{blue}{\frac{1 - x \cdot x}{1 + x}} \]
          8. Step-by-step derivation
            1. clear-numN/A

              \[\leadsto \frac{1}{\color{blue}{\frac{1 + x}{1 - x \cdot x}}} \]
            2. associate-/r/N/A

              \[\leadsto \frac{1}{1 + x} \cdot \color{blue}{\left(1 - x \cdot x\right)} \]
            3. *-lowering-*.f64N/A

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(1 + x\right)\right), \left(\color{blue}{1} - x \cdot x\right)\right) \]
            5. +-commutativeN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(x + 1\right)\right), \left(1 - x \cdot x\right)\right) \]
            6. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, 1\right)\right), \left(1 - x \cdot x\right)\right) \]
            7. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, 1\right)\right), \mathsf{\_.f64}\left(1, \color{blue}{\left(x \cdot x\right)}\right)\right) \]
            8. *-lowering-*.f641.9%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, 1\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right) \]
          9. Applied egg-rr1.9%

            \[\leadsto \color{blue}{\frac{1}{x + 1} \cdot \left(1 - x \cdot x\right)} \]
          10. Taylor expanded in x around 0

            \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + -1 \cdot x\right)}, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
          11. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \mathsf{*.f64}\left(\left(1 + \left(\mathsf{neg}\left(x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
            2. unsub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\left(1 - x\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
            3. --lowering--.f6425.9%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, x\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(x, x\right)\right)\right) \]
          12. Simplified25.9%

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

        Alternative 13: 62.4% accurate, 13.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2600:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;0 - x\\ \end{array} \end{array} \]
        (FPCore (x y) :precision binary64 (if (<= x 2600.0) 1.0 (- 0.0 x)))
        double code(double x, double y) {
        	double tmp;
        	if (x <= 2600.0) {
        		tmp = 1.0;
        	} else {
        		tmp = 0.0 - x;
        	}
        	return tmp;
        }
        
        real(8) function code(x, y)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8) :: tmp
            if (x <= 2600.0d0) then
                tmp = 1.0d0
            else
                tmp = 0.0d0 - x
            end if
            code = tmp
        end function
        
        public static double code(double x, double y) {
        	double tmp;
        	if (x <= 2600.0) {
        		tmp = 1.0;
        	} else {
        		tmp = 0.0 - x;
        	}
        	return tmp;
        }
        
        def code(x, y):
        	tmp = 0
        	if x <= 2600.0:
        		tmp = 1.0
        	else:
        		tmp = 0.0 - x
        	return tmp
        
        function code(x, y)
        	tmp = 0.0
        	if (x <= 2600.0)
        		tmp = 1.0;
        	else
        		tmp = Float64(0.0 - x);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y)
        	tmp = 0.0;
        	if (x <= 2600.0)
        		tmp = 1.0;
        	else
        		tmp = 0.0 - x;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_] := If[LessEqual[x, 2600.0], 1.0, N[(0.0 - x), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;x \leq 2600:\\
        \;\;\;\;1\\
        
        \mathbf{else}:\\
        \;\;\;\;0 - x\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if x < 2600

          1. Initial program 99.9%

            \[\left(1 - x\right) + y \cdot \sqrt{x} \]
          2. Add Preprocessing
          3. Taylor expanded in y around 0

            \[\leadsto \color{blue}{1 - x} \]
          4. Step-by-step derivation
            1. --lowering--.f6466.4%

              \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
          5. Simplified66.4%

            \[\leadsto \color{blue}{1 - x} \]
          6. Taylor expanded in x around 0

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

              \[\leadsto \color{blue}{1} \]

            if 2600 < x

            1. Initial program 99.9%

              \[\left(1 - x\right) + y \cdot \sqrt{x} \]
            2. Add Preprocessing
            3. Taylor expanded in y around 0

              \[\leadsto \color{blue}{1 - x} \]
            4. Step-by-step derivation
              1. --lowering--.f6459.7%

                \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
            5. Simplified59.7%

              \[\leadsto \color{blue}{1 - x} \]
            6. Taylor expanded in x around inf

              \[\leadsto \color{blue}{-1 \cdot x} \]
            7. Step-by-step derivation
              1. mul-1-negN/A

                \[\leadsto \mathsf{neg}\left(x\right) \]
              2. neg-sub0N/A

                \[\leadsto 0 - \color{blue}{x} \]
              3. --lowering--.f6458.5%

                \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{x}\right) \]
            8. Simplified58.5%

              \[\leadsto \color{blue}{0 - x} \]
            9. Step-by-step derivation
              1. sub0-negN/A

                \[\leadsto \mathsf{neg}\left(x\right) \]
              2. neg-lowering-neg.f6458.5%

                \[\leadsto \mathsf{neg.f64}\left(x\right) \]
            10. Applied egg-rr58.5%

              \[\leadsto \color{blue}{-x} \]
          8. Recombined 2 regimes into one program.
          9. Final simplification61.2%

            \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2600:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;0 - x\\ \end{array} \]
          10. Add Preprocessing

          Alternative 14: 63.7% accurate, 35.7× speedup?

          \[\begin{array}{l} \\ 1 - x \end{array} \]
          (FPCore (x y) :precision binary64 (- 1.0 x))
          double code(double x, double y) {
          	return 1.0 - x;
          }
          
          real(8) function code(x, y)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              code = 1.0d0 - x
          end function
          
          public static double code(double x, double y) {
          	return 1.0 - x;
          }
          
          def code(x, y):
          	return 1.0 - x
          
          function code(x, y)
          	return Float64(1.0 - x)
          end
          
          function tmp = code(x, y)
          	tmp = 1.0 - x;
          end
          
          code[x_, y_] := N[(1.0 - x), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          1 - x
          \end{array}
          
          Derivation
          1. Initial program 99.9%

            \[\left(1 - x\right) + y \cdot \sqrt{x} \]
          2. Add Preprocessing
          3. Taylor expanded in y around 0

            \[\leadsto \color{blue}{1 - x} \]
          4. Step-by-step derivation
            1. --lowering--.f6462.8%

              \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
          5. Simplified62.8%

            \[\leadsto \color{blue}{1 - x} \]
          6. Add Preprocessing

          Alternative 15: 31.8% accurate, 107.0× speedup?

          \[\begin{array}{l} \\ 1 \end{array} \]
          (FPCore (x y) :precision binary64 1.0)
          double code(double x, double y) {
          	return 1.0;
          }
          
          real(8) function code(x, y)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              code = 1.0d0
          end function
          
          public static double code(double x, double y) {
          	return 1.0;
          }
          
          def code(x, y):
          	return 1.0
          
          function code(x, y)
          	return 1.0
          end
          
          function tmp = code(x, y)
          	tmp = 1.0;
          end
          
          code[x_, y_] := 1.0
          
          \begin{array}{l}
          
          \\
          1
          \end{array}
          
          Derivation
          1. Initial program 99.9%

            \[\left(1 - x\right) + y \cdot \sqrt{x} \]
          2. Add Preprocessing
          3. Taylor expanded in y around 0

            \[\leadsto \color{blue}{1 - x} \]
          4. Step-by-step derivation
            1. --lowering--.f6462.8%

              \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
          5. Simplified62.8%

            \[\leadsto \color{blue}{1 - x} \]
          6. Taylor expanded in x around 0

            \[\leadsto \color{blue}{1} \]
          7. Step-by-step derivation
            1. Simplified30.5%

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

            Reproduce

            ?
            herbie shell --seed 2024160 
            (FPCore (x y)
              :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, E"
              :precision binary64
              (+ (- 1.0 x) (* y (sqrt x))))