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

Percentage Accurate: 99.9% → 99.9%
Time: 9.3s
Alternatives: 11
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 11 alternatives:

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

Initial Program: 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.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 + y \cdot \sqrt{x}\\ \mathbf{if}\;y \leq -5 \cdot 10^{+38}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{+84}:\\ \;\;\;\;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 -5e+38) t_0 (if (<= y 6.2e+84) (- 1.0 x) t_0))))
double code(double x, double y) {
	double t_0 = 1.0 + (y * sqrt(x));
	double tmp;
	if (y <= -5e+38) {
		tmp = t_0;
	} else if (y <= 6.2e+84) {
		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 <= (-5d+38)) then
        tmp = t_0
    else if (y <= 6.2d+84) 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 <= -5e+38) {
		tmp = t_0;
	} else if (y <= 6.2e+84) {
		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 <= -5e+38:
		tmp = t_0
	elif y <= 6.2e+84:
		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 <= -5e+38)
		tmp = t_0;
	elseif (y <= 6.2e+84)
		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 <= -5e+38)
		tmp = t_0;
	elseif (y <= 6.2e+84)
		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, -5e+38], t$95$0, If[LessEqual[y, 6.2e+84], 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 -5 \cdot 10^{+38}:\\
\;\;\;\;t\_0\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.9999999999999997e38 or 6.20000000000000006e84 < y

    1. Initial program 99.7%

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

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

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

    if -4.9999999999999997e38 < y < 6.20000000000000006e84

    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--.f6497.1%

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

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

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

Alternative 3: 92.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{+39}:\\
\;\;\;\;y \cdot \sqrt{x}\\

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

\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{\sqrt{x}}\\


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

    1. Initial program 99.7%

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

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

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

    if -3.30000000000000021e39 < y < 4.09999999999999978e85

    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--.f6497.1%

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

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

    if 4.09999999999999978e85 < y

    1. Initial program 99.6%

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

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

      \[\leadsto \color{blue}{\sqrt{x} \cdot y} \]
    6. Step-by-step derivation
      1. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{\frac{1}{2}}\right), y\right) \]
      2. sqr-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{\left(\frac{\frac{1}{2}}{2}\right)} \cdot {x}^{\left(\frac{\frac{1}{2}}{2}\right)}\right), y\right) \]
      3. pow-prod-downN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(x \cdot x\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}\right), y\right) \]
      4. pow-lowering-pow.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{\frac{1}{2}}{2}\right)\right), y\right) \]
      6. metadata-eval77.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(x, x\right), \frac{1}{4}\right), y\right) \]
    7. Applied egg-rr77.8%

      \[\leadsto \color{blue}{{\left(x \cdot x\right)}^{0.25}} \cdot y \]
    8. Step-by-step derivation
      1. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left({x}^{2}\right)}^{\frac{1}{4}}\right), y\right) \]
      2. pow-powN/A

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

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{\frac{1}{2}}\right), y\right) \]
      4. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{\left(-1 \cdot \frac{1}{2} + 1\right)}\right), y\right) \]
      6. pow-plusN/A

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{\left(-1 \cdot \frac{1}{2}\right)} \cdot x\right), y\right) \]
      7. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left({x}^{-1}\right)}^{\frac{1}{2}} \cdot x\right), y\right) \]
      8. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{1}{x}\right)}^{\frac{1}{2}} \cdot x\right), y\right) \]
      9. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{x}} \cdot x\right), y\right) \]
      10. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{1}}{\sqrt{x}} \cdot x\right), y\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{\sqrt{x}} \cdot x\right), y\right) \]
      12. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1 \cdot x}{\sqrt{x}}\right), y\right) \]
      13. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{x}{\sqrt{x}}\right), y\right) \]
      14. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{x}{{x}^{\frac{1}{2}}}\right), y\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{x}{{x}^{\left(\frac{-1}{2} + 1\right)}}\right), y\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{x}{{x}^{\left(-1 \cdot \frac{1}{2} + 1\right)}}\right), y\right) \]
      17. pow-plusN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{x}{{x}^{\left(-1 \cdot \frac{1}{2}\right)} \cdot x}\right), y\right) \]
      18. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{x}{{\left({x}^{-1}\right)}^{\frac{1}{2}} \cdot x}\right), y\right) \]
      19. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{x}{{\left(\frac{1}{x}\right)}^{\frac{1}{2}} \cdot x}\right), y\right) \]
      20. pow1/2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \left(\sqrt{\frac{1}{x}} \cdot x\right)\right), y\right) \]
      22. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \left({\left(\frac{1}{x}\right)}^{\frac{1}{2}} \cdot x\right)\right), y\right) \]
      23. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \left({\left({x}^{-1}\right)}^{\frac{1}{2}} \cdot x\right)\right), y\right) \]
      24. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \left({x}^{\left(-1 \cdot \frac{1}{2}\right)} \cdot x\right)\right), y\right) \]
      25. pow-plusN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \left({x}^{\left(\frac{-1}{2} + 1\right)}\right)\right), y\right) \]
      27. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \left({x}^{\frac{1}{2}}\right)\right), y\right) \]
      28. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \left(\sqrt{x}\right)\right), y\right) \]
      29. sqrt-lowering-sqrt.f6495.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{sqrt.f64}\left(x\right)\right), y\right) \]
    9. Applied egg-rr95.7%

      \[\leadsto \color{blue}{\frac{x}{\sqrt{x}}} \cdot y \]
  3. Recombined 3 regimes into one program.
  4. Final simplification95.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.3 \cdot 10^{+39}:\\ \;\;\;\;y \cdot \sqrt{x}\\ \mathbf{elif}\;y \leq 4.1 \cdot 10^{+85}:\\ \;\;\;\;1 - x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{\sqrt{x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 92.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \sqrt{x}\\ \mathbf{if}\;y \leq -3.3 \cdot 10^{+39}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 9.8 \cdot 10^{+84}:\\ \;\;\;\;1 - x\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* y (sqrt x))))
   (if (<= y -3.3e+39) t_0 (if (<= y 9.8e+84) (- 1.0 x) t_0))))
double code(double x, double y) {
	double t_0 = y * sqrt(x);
	double tmp;
	if (y <= -3.3e+39) {
		tmp = t_0;
	} else if (y <= 9.8e+84) {
		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 <= (-3.3d+39)) then
        tmp = t_0
    else if (y <= 9.8d+84) 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 <= -3.3e+39) {
		tmp = t_0;
	} else if (y <= 9.8e+84) {
		tmp = 1.0 - x;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = y * math.sqrt(x)
	tmp = 0
	if y <= -3.3e+39:
		tmp = t_0
	elif y <= 9.8e+84:
		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 <= -3.3e+39)
		tmp = t_0;
	elseif (y <= 9.8e+84)
		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 <= -3.3e+39)
		tmp = t_0;
	elseif (y <= 9.8e+84)
		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, -3.3e+39], t$95$0, If[LessEqual[y, 9.8e+84], N[(1.0 - x), $MachinePrecision], t$95$0]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.30000000000000021e39 or 9.8e84 < y

    1. Initial program 99.7%

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

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

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

    if -3.30000000000000021e39 < y < 9.8e84

    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--.f6497.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.3 \cdot 10^{+39}:\\ \;\;\;\;y \cdot \sqrt{x}\\ \mathbf{elif}\;y \leq 9.8 \cdot 10^{+84}:\\ \;\;\;\;1 - x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \sqrt{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 68.7% accurate, 5.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.9 \cdot 10^{+155}:\\
\;\;\;\;\frac{1 - x \cdot \left(x \cdot x\right)}{1 + \frac{x}{1 - x}}\\

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left(1 \cdot \color{blue}{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, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(1 + \left(\color{blue}{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(x \cdot x + 1 \cdot x\right)}\right)\right) \]
      10. 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, \left(x \cdot \color{blue}{\left(x + 1\right)}\right)\right)\right) \]
      11. +-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, \left(x \cdot \left(1 + \color{blue}{x}\right)\right)\right)\right) \]
      12. *-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(1 + x\right)}\right)\right)\right) \]
      13. +-lowering-+.f641.5%

        \[\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}{x}\right)\right)\right)\right) \]
    7. Applied egg-rr1.5%

      \[\leadsto \color{blue}{\frac{1 - x \cdot \left(x \cdot x\right)}{1 + x \cdot \left(1 + x\right)}} \]
    8. Step-by-step derivation
      1. /-rgt-identityN/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(x \cdot \frac{1 + x}{\color{blue}{1}}\right)\right)\right) \]
      2. clear-numN/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(x \cdot \frac{1}{\color{blue}{\frac{1}{1 + x}}}\right)\right)\right) \]
      3. un-div-invN/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(\frac{x}{\color{blue}{\frac{1}{1 + x}}}\right)\right)\right) \]
      4. /-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(\frac{1}{1 + x}\right)}\right)\right)\right) \]
      5. /-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(1 + x\right)}\right)\right)\right)\right) \]
      6. +-lowering-+.f641.5%

        \[\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(1, \color{blue}{x}\right)\right)\right)\right)\right) \]
    9. Applied egg-rr1.5%

      \[\leadsto \frac{1 - x \cdot \left(x \cdot x\right)}{1 + \color{blue}{\frac{x}{\frac{1}{1 + x}}}} \]
    10. 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), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(x, \color{blue}{\left(1 + -1 \cdot x\right)}\right)\right)\right) \]
    11. 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), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(x\right)\right)\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), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(x, \left(1 - \color{blue}{x}\right)\right)\right)\right) \]
      3. --lowering--.f6425.8%

        \[\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}{x}\right)\right)\right)\right) \]
    12. Simplified25.8%

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

    if -4.8999999999999997e155 < y < 2.24999999999999996e86

    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--.f6488.3%

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

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

    if 2.24999999999999996e86 < y

    1. Initial program 99.6%

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

        \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
    5. Simplified5.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. /-lowering-/.f64N/A

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left(1 \cdot \color{blue}{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, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(1 + \left(\color{blue}{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(x \cdot x + 1 \cdot x\right)}\right)\right) \]
      10. 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, \left(x \cdot \color{blue}{\left(x + 1\right)}\right)\right)\right) \]
      11. +-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, \left(x \cdot \left(1 + \color{blue}{x}\right)\right)\right)\right) \]
      12. *-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(1 + x\right)}\right)\right)\right) \]
      13. +-lowering-+.f645.8%

        \[\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}{x}\right)\right)\right)\right) \]
    7. Applied egg-rr5.8%

      \[\leadsto \color{blue}{\frac{1 - x \cdot \left(x \cdot x\right)}{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), \mathsf{+.f64}\left(1, \color{blue}{x}\right)\right) \]
    9. Step-by-step derivation
      1. Simplified5.8%

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

        \[\leadsto \color{blue}{1 + x \cdot \left(x - 1\right)} \]
      3. Step-by-step derivation
        1. +-lowering-+.f64N/A

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

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

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

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

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

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

    Alternative 6: 68.0% accurate, 6.3× speedup?

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

      1. Initial program 99.8%

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left(1 \cdot \color{blue}{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, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)\right)\right) \]
        8. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(1 + \left(\color{blue}{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(x \cdot x + 1 \cdot x\right)}\right)\right) \]
        10. 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, \left(x \cdot \color{blue}{\left(x + 1\right)}\right)\right)\right) \]
        11. +-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, \left(x \cdot \left(1 + \color{blue}{x}\right)\right)\right)\right) \]
        12. *-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(1 + x\right)}\right)\right)\right) \]
        13. +-lowering-+.f641.5%

          \[\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}{x}\right)\right)\right)\right) \]
      7. Applied egg-rr1.5%

        \[\leadsto \color{blue}{\frac{1 - x \cdot \left(x \cdot x\right)}{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), \mathsf{+.f64}\left(1, \color{blue}{x}\right)\right) \]
      9. Step-by-step derivation
        1. Simplified21.9%

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

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

            \[\leadsto {x}^{2} \cdot \left(\left(\frac{1}{x} - 1\right) - \color{blue}{\frac{1}{{x}^{2}}}\right) \]
          2. sub-negN/A

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

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

            \[\leadsto \left(\frac{1}{x} - 1\right) \cdot {x}^{2} + \left(\mathsf{neg}\left(\frac{1}{{x}^{2}} \cdot {x}^{2}\right)\right) \]
          5. unpow2N/A

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

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

            \[\leadsto \left(\frac{1}{x} - 1\right) \cdot {x}^{2} + \left(\mathsf{neg}\left(\frac{\frac{1}{x}}{x \cdot 1} \cdot {x}^{2}\right)\right) \]
          8. rgt-mult-inverseN/A

            \[\leadsto \left(\frac{1}{x} - 1\right) \cdot {x}^{2} + \left(\mathsf{neg}\left(\frac{\frac{1}{x}}{x \cdot \left(x \cdot \frac{1}{x}\right)} \cdot {x}^{2}\right)\right) \]
          9. associate-*l*N/A

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

            \[\leadsto \left(\frac{1}{x} - 1\right) \cdot {x}^{2} + \left(\mathsf{neg}\left(\frac{\frac{1}{x}}{{x}^{2} \cdot \frac{1}{x}} \cdot {x}^{2}\right)\right) \]
          11. associate-*r/N/A

            \[\leadsto \left(\frac{1}{x} - 1\right) \cdot {x}^{2} + \left(\mathsf{neg}\left(\frac{\frac{1}{x}}{\frac{{x}^{2} \cdot 1}{x}} \cdot {x}^{2}\right)\right) \]
          12. *-rgt-identityN/A

            \[\leadsto \left(\frac{1}{x} - 1\right) \cdot {x}^{2} + \left(\mathsf{neg}\left(\frac{\frac{1}{x}}{\frac{{x}^{2}}{x}} \cdot {x}^{2}\right)\right) \]
          13. associate-/r/N/A

            \[\leadsto \left(\frac{1}{x} - 1\right) \cdot {x}^{2} + \left(\mathsf{neg}\left(\left(\frac{\frac{1}{x}}{{x}^{2}} \cdot x\right) \cdot {x}^{2}\right)\right) \]
          14. associate-/r*N/A

            \[\leadsto \left(\frac{1}{x} - 1\right) \cdot {x}^{2} + \left(\mathsf{neg}\left(\left(\frac{1}{x \cdot {x}^{2}} \cdot x\right) \cdot {x}^{2}\right)\right) \]
          15. unpow2N/A

            \[\leadsto \left(\frac{1}{x} - 1\right) \cdot {x}^{2} + \left(\mathsf{neg}\left(\left(\frac{1}{x \cdot \left(x \cdot x\right)} \cdot x\right) \cdot {x}^{2}\right)\right) \]
          16. cube-multN/A

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

            \[\leadsto \left(\frac{1}{x} - 1\right) \cdot {x}^{2} + \left(\mathsf{neg}\left(\frac{1}{{x}^{3}} \cdot \left(x \cdot {x}^{2}\right)\right)\right) \]
          18. unpow2N/A

            \[\leadsto \left(\frac{1}{x} - 1\right) \cdot {x}^{2} + \left(\mathsf{neg}\left(\frac{1}{{x}^{3}} \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right) \]
          19. cube-multN/A

            \[\leadsto \left(\frac{1}{x} - 1\right) \cdot {x}^{2} + \left(\mathsf{neg}\left(\frac{1}{{x}^{3}} \cdot {x}^{3}\right)\right) \]
        4. Simplified24.1%

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

        if -5.20000000000000024e129 < y < 2.24999999999999996e86

        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--.f6489.8%

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

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

        if 2.24999999999999996e86 < y

        1. Initial program 99.6%

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

            \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
        5. Simplified5.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. /-lowering-/.f64N/A

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left(1 \cdot \color{blue}{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, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)\right)\right) \]
          8. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(1 + \left(\color{blue}{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(x \cdot x + 1 \cdot x\right)}\right)\right) \]
          10. 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, \left(x \cdot \color{blue}{\left(x + 1\right)}\right)\right)\right) \]
          11. +-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, \left(x \cdot \left(1 + \color{blue}{x}\right)\right)\right)\right) \]
          12. *-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(1 + x\right)}\right)\right)\right) \]
          13. +-lowering-+.f645.8%

            \[\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}{x}\right)\right)\right)\right) \]
        7. Applied egg-rr5.8%

          \[\leadsto \color{blue}{\frac{1 - x \cdot \left(x \cdot x\right)}{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), \mathsf{+.f64}\left(1, \color{blue}{x}\right)\right) \]
        9. Step-by-step derivation
          1. Simplified5.8%

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

            \[\leadsto \color{blue}{1 + x \cdot \left(x - 1\right)} \]
          3. Step-by-step derivation
            1. +-lowering-+.f64N/A

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

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

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

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

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

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

        Alternative 7: 65.6% accurate, 8.9× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.5 \cdot 10^{+131}:\\ \;\;\;\;-1 + x \cdot \left(1 - x\right)\\ \mathbf{else}:\\ \;\;\;\;1 - x\\ \end{array} \end{array} \]
        (FPCore (x y)
         :precision binary64
         (if (<= y -1.5e+131) (+ -1.0 (* x (- 1.0 x))) (- 1.0 x)))
        double code(double x, double y) {
        	double tmp;
        	if (y <= -1.5e+131) {
        		tmp = -1.0 + (x * (1.0 - x));
        	} else {
        		tmp = 1.0 - 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.5d+131)) then
                tmp = (-1.0d0) + (x * (1.0d0 - x))
            else
                tmp = 1.0d0 - x
            end if
            code = tmp
        end function
        
        public static double code(double x, double y) {
        	double tmp;
        	if (y <= -1.5e+131) {
        		tmp = -1.0 + (x * (1.0 - x));
        	} else {
        		tmp = 1.0 - x;
        	}
        	return tmp;
        }
        
        def code(x, y):
        	tmp = 0
        	if y <= -1.5e+131:
        		tmp = -1.0 + (x * (1.0 - x))
        	else:
        		tmp = 1.0 - x
        	return tmp
        
        function code(x, y)
        	tmp = 0.0
        	if (y <= -1.5e+131)
        		tmp = Float64(-1.0 + Float64(x * Float64(1.0 - x)));
        	else
        		tmp = Float64(1.0 - x);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y)
        	tmp = 0.0;
        	if (y <= -1.5e+131)
        		tmp = -1.0 + (x * (1.0 - x));
        	else
        		tmp = 1.0 - x;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_] := If[LessEqual[y, -1.5e+131], N[(-1.0 + N[(x * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - x), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;y \leq -1.5 \cdot 10^{+131}:\\
        \;\;\;\;-1 + x \cdot \left(1 - x\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;1 - x\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < -1.5000000000000001e131

          1. Initial program 99.8%

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

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

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left(1 \cdot \color{blue}{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, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)\right)\right) \]
            8. metadata-evalN/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(1 + \left(\color{blue}{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(x \cdot x + 1 \cdot x\right)}\right)\right) \]
            10. 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, \left(x \cdot \color{blue}{\left(x + 1\right)}\right)\right)\right) \]
            11. +-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, \left(x \cdot \left(1 + \color{blue}{x}\right)\right)\right)\right) \]
            12. *-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(1 + x\right)}\right)\right)\right) \]
            13. +-lowering-+.f641.5%

              \[\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}{x}\right)\right)\right)\right) \]
          7. Applied egg-rr1.5%

            \[\leadsto \color{blue}{\frac{1 - x \cdot \left(x \cdot x\right)}{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), \mathsf{+.f64}\left(1, \color{blue}{x}\right)\right) \]
          9. Step-by-step derivation
            1. Simplified21.9%

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

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

                \[\leadsto {x}^{2} \cdot \left(\left(\frac{1}{x} - 1\right) - \color{blue}{\frac{1}{{x}^{2}}}\right) \]
              2. sub-negN/A

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

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

                \[\leadsto \left(\frac{1}{x} - 1\right) \cdot {x}^{2} + \left(\mathsf{neg}\left(\frac{1}{{x}^{2}} \cdot {x}^{2}\right)\right) \]
              5. unpow2N/A

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

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

                \[\leadsto \left(\frac{1}{x} - 1\right) \cdot {x}^{2} + \left(\mathsf{neg}\left(\frac{\frac{1}{x}}{x \cdot 1} \cdot {x}^{2}\right)\right) \]
              8. rgt-mult-inverseN/A

                \[\leadsto \left(\frac{1}{x} - 1\right) \cdot {x}^{2} + \left(\mathsf{neg}\left(\frac{\frac{1}{x}}{x \cdot \left(x \cdot \frac{1}{x}\right)} \cdot {x}^{2}\right)\right) \]
              9. associate-*l*N/A

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

                \[\leadsto \left(\frac{1}{x} - 1\right) \cdot {x}^{2} + \left(\mathsf{neg}\left(\frac{\frac{1}{x}}{{x}^{2} \cdot \frac{1}{x}} \cdot {x}^{2}\right)\right) \]
              11. associate-*r/N/A

                \[\leadsto \left(\frac{1}{x} - 1\right) \cdot {x}^{2} + \left(\mathsf{neg}\left(\frac{\frac{1}{x}}{\frac{{x}^{2} \cdot 1}{x}} \cdot {x}^{2}\right)\right) \]
              12. *-rgt-identityN/A

                \[\leadsto \left(\frac{1}{x} - 1\right) \cdot {x}^{2} + \left(\mathsf{neg}\left(\frac{\frac{1}{x}}{\frac{{x}^{2}}{x}} \cdot {x}^{2}\right)\right) \]
              13. associate-/r/N/A

                \[\leadsto \left(\frac{1}{x} - 1\right) \cdot {x}^{2} + \left(\mathsf{neg}\left(\left(\frac{\frac{1}{x}}{{x}^{2}} \cdot x\right) \cdot {x}^{2}\right)\right) \]
              14. associate-/r*N/A

                \[\leadsto \left(\frac{1}{x} - 1\right) \cdot {x}^{2} + \left(\mathsf{neg}\left(\left(\frac{1}{x \cdot {x}^{2}} \cdot x\right) \cdot {x}^{2}\right)\right) \]
              15. unpow2N/A

                \[\leadsto \left(\frac{1}{x} - 1\right) \cdot {x}^{2} + \left(\mathsf{neg}\left(\left(\frac{1}{x \cdot \left(x \cdot x\right)} \cdot x\right) \cdot {x}^{2}\right)\right) \]
              16. cube-multN/A

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

                \[\leadsto \left(\frac{1}{x} - 1\right) \cdot {x}^{2} + \left(\mathsf{neg}\left(\frac{1}{{x}^{3}} \cdot \left(x \cdot {x}^{2}\right)\right)\right) \]
              18. unpow2N/A

                \[\leadsto \left(\frac{1}{x} - 1\right) \cdot {x}^{2} + \left(\mathsf{neg}\left(\frac{1}{{x}^{3}} \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right) \]
              19. cube-multN/A

                \[\leadsto \left(\frac{1}{x} - 1\right) \cdot {x}^{2} + \left(\mathsf{neg}\left(\frac{1}{{x}^{3}} \cdot {x}^{3}\right)\right) \]
            4. Simplified24.1%

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

            if -1.5000000000000001e131 < 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--.f6472.6%

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

              \[\leadsto \color{blue}{1 - x} \]
          10. Recombined 2 regimes into one program.
          11. Add Preprocessing

          Alternative 8: 65.6% accurate, 10.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.7 \cdot 10^{+135}:\\ \;\;\;\;0 - x \cdot x\\ \mathbf{else}:\\ \;\;\;\;1 - x\\ \end{array} \end{array} \]
          (FPCore (x y)
           :precision binary64
           (if (<= y -4.7e+135) (- 0.0 (* x x)) (- 1.0 x)))
          double code(double x, double y) {
          	double tmp;
          	if (y <= -4.7e+135) {
          		tmp = 0.0 - (x * x);
          	} else {
          		tmp = 1.0 - 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.7d+135)) then
                  tmp = 0.0d0 - (x * x)
              else
                  tmp = 1.0d0 - x
              end if
              code = tmp
          end function
          
          public static double code(double x, double y) {
          	double tmp;
          	if (y <= -4.7e+135) {
          		tmp = 0.0 - (x * x);
          	} else {
          		tmp = 1.0 - x;
          	}
          	return tmp;
          }
          
          def code(x, y):
          	tmp = 0
          	if y <= -4.7e+135:
          		tmp = 0.0 - (x * x)
          	else:
          		tmp = 1.0 - x
          	return tmp
          
          function code(x, y)
          	tmp = 0.0
          	if (y <= -4.7e+135)
          		tmp = Float64(0.0 - Float64(x * x));
          	else
          		tmp = Float64(1.0 - x);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y)
          	tmp = 0.0;
          	if (y <= -4.7e+135)
          		tmp = 0.0 - (x * x);
          	else
          		tmp = 1.0 - x;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_] := If[LessEqual[y, -4.7e+135], N[(0.0 - N[(x * x), $MachinePrecision]), $MachinePrecision], N[(1.0 - x), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq -4.7 \cdot 10^{+135}:\\
          \;\;\;\;0 - x \cdot x\\
          
          \mathbf{else}:\\
          \;\;\;\;1 - x\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < -4.6999999999999998e135

            1. Initial program 99.8%

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

                \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{x}\right) \]
            5. Simplified3.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. /-lowering-/.f64N/A

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

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

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

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

                \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left(1 \cdot \color{blue}{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, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)\right)\right) \]
              8. metadata-evalN/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(1 + \left(\color{blue}{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(x \cdot x + 1 \cdot x\right)}\right)\right) \]
              10. 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, \left(x \cdot \color{blue}{\left(x + 1\right)}\right)\right)\right) \]
              11. +-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, \left(x \cdot \left(1 + \color{blue}{x}\right)\right)\right)\right) \]
              12. *-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(1 + x\right)}\right)\right)\right) \]
              13. +-lowering-+.f641.5%

                \[\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}{x}\right)\right)\right)\right) \]
            7. Applied egg-rr1.5%

              \[\leadsto \color{blue}{\frac{1 - x \cdot \left(x \cdot x\right)}{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), \mathsf{+.f64}\left(1, \color{blue}{x}\right)\right) \]
            9. Step-by-step derivation
              1. Simplified22.8%

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

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

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

                  \[\leadsto 0 - \color{blue}{{x}^{2}} \]
                3. --lowering--.f64N/A

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

                  \[\leadsto \mathsf{\_.f64}\left(0, \left(x \cdot \color{blue}{x}\right)\right) \]
                5. *-lowering-*.f6423.6%

                  \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right) \]
              4. Simplified23.6%

                \[\leadsto \color{blue}{0 - x \cdot x} \]

              if -4.6999999999999998e135 < 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--.f6472.0%

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

                \[\leadsto \color{blue}{1 - x} \]
            10. Recombined 2 regimes into one program.
            11. Add Preprocessing

            Alternative 9: 62.4% accurate, 13.3× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;0 - x\\ \end{array} \end{array} \]
            (FPCore (x y) :precision binary64 (if (<= x 1.0) 1.0 (- 0.0 x)))
            double code(double x, double y) {
            	double tmp;
            	if (x <= 1.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 <= 1.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 <= 1.0) {
            		tmp = 1.0;
            	} else {
            		tmp = 0.0 - x;
            	}
            	return tmp;
            }
            
            def code(x, y):
            	tmp = 0
            	if x <= 1.0:
            		tmp = 1.0
            	else:
            		tmp = 0.0 - x
            	return tmp
            
            function code(x, y)
            	tmp = 0.0
            	if (x <= 1.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 <= 1.0)
            		tmp = 1.0;
            	else
            		tmp = 0.0 - x;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_] := If[LessEqual[x, 1.0], 1.0, N[(0.0 - x), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;x \leq 1:\\
            \;\;\;\;1\\
            
            \mathbf{else}:\\
            \;\;\;\;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 y around 0

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

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

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

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

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

                if 1 < 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--.f6463.5%

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

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

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

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

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

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

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

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

              Alternative 10: 63.5% 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--.f6461.5%

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

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

              Alternative 11: 32.3% 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--.f6461.5%

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

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

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

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

                Reproduce

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