Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, C

Percentage Accurate: 58.9% → 97.8%
Time: 16.3s
Alternatives: 23
Speedup: 2.8×

Specification

?
\[\begin{array}{l} \\ \frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (/
  (*
   (- x 2.0)
   (+
    (*
     (+ (* (+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416) x) y)
     x)
    z))
  (+
   (* (+ (* (+ (* (+ x 43.3400022514) x) 263.505074721) x) 313.399215894) x)
   47.066876606)))
double code(double x, double y, double z) {
	return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = ((x - 2.0d0) * ((((((((x * 4.16438922228d0) + 78.6994924154d0) * x) + 137.519416416d0) * x) + y) * x) + z)) / (((((((x + 43.3400022514d0) * x) + 263.505074721d0) * x) + 313.399215894d0) * x) + 47.066876606d0)
end function
public static double code(double x, double y, double z) {
	return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
}
def code(x, y, z):
	return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)
function code(x, y, z)
	return Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606))
end
function tmp = code(x, y, z)
	tmp = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
end
code[x_, y_, z_] := N[(N[(N[(x - 2.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision] * x), $MachinePrecision] + 137.519416416), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 43.3400022514), $MachinePrecision] * x), $MachinePrecision] + 263.505074721), $MachinePrecision] * x), $MachinePrecision] + 313.399215894), $MachinePrecision] * x), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\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 23 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: 58.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (/
  (*
   (- x 2.0)
   (+
    (*
     (+ (* (+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416) x) y)
     x)
    z))
  (+
   (* (+ (* (+ (* (+ x 43.3400022514) x) 263.505074721) x) 313.399215894) x)
   47.066876606)))
double code(double x, double y, double z) {
	return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = ((x - 2.0d0) * ((((((((x * 4.16438922228d0) + 78.6994924154d0) * x) + 137.519416416d0) * x) + y) * x) + z)) / (((((((x + 43.3400022514d0) * x) + 263.505074721d0) * x) + 313.399215894d0) * x) + 47.066876606d0)
end function
public static double code(double x, double y, double z) {
	return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
}
def code(x, y, z):
	return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)
function code(x, y, z)
	return Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606))
end
function tmp = code(x, y, z)
	tmp = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
end
code[x_, y_, z_] := N[(N[(N[(x - 2.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision] * x), $MachinePrecision] + 137.519416416), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 43.3400022514), $MachinePrecision] * x), $MachinePrecision] + 263.505074721), $MachinePrecision] * x), $MachinePrecision] + 313.399215894), $MachinePrecision] * x), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\end{array}

Alternative 1: 97.8% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)\\ t_1 := x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\right)\\ t_2 := \frac{z}{t\_0}\\ \mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(t\_1 + z\right)}{t\_0} \leq 2 \cdot 10^{+253}:\\ \;\;\;\;\left(\frac{{x}^{2}}{x + 2} - \frac{4}{x + 2}\right) \cdot \left(t\_2 + \frac{t\_1}{t\_0}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + t\_2\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0
         (+
          47.066876606
          (*
           x
           (+
            313.399215894
            (* x (+ 263.505074721 (* x (+ x 43.3400022514))))))))
        (t_1
         (*
          x
          (+
           (* x (+ (* x (+ (* x 4.16438922228) 78.6994924154)) 137.519416416))
           y)))
        (t_2 (/ z t_0)))
   (if (<= (/ (* (- x 2.0) (+ t_1 z)) t_0) 2e+253)
     (* (- (/ (pow x 2.0) (+ x 2.0)) (/ 4.0 (+ x 2.0))) (+ t_2 (/ t_1 t_0)))
     (* (+ x -2.0) (+ 4.16438922228 t_2)))))
double code(double x, double y, double z) {
	double t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))));
	double t_1 = x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y);
	double t_2 = z / t_0;
	double tmp;
	if ((((x - 2.0) * (t_1 + z)) / t_0) <= 2e+253) {
		tmp = ((pow(x, 2.0) / (x + 2.0)) - (4.0 / (x + 2.0))) * (t_2 + (t_1 / t_0));
	} else {
		tmp = (x + -2.0) * (4.16438922228 + t_2);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = 47.066876606d0 + (x * (313.399215894d0 + (x * (263.505074721d0 + (x * (x + 43.3400022514d0))))))
    t_1 = x * ((x * ((x * ((x * 4.16438922228d0) + 78.6994924154d0)) + 137.519416416d0)) + y)
    t_2 = z / t_0
    if ((((x - 2.0d0) * (t_1 + z)) / t_0) <= 2d+253) then
        tmp = (((x ** 2.0d0) / (x + 2.0d0)) - (4.0d0 / (x + 2.0d0))) * (t_2 + (t_1 / t_0))
    else
        tmp = (x + (-2.0d0)) * (4.16438922228d0 + t_2)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))));
	double t_1 = x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y);
	double t_2 = z / t_0;
	double tmp;
	if ((((x - 2.0) * (t_1 + z)) / t_0) <= 2e+253) {
		tmp = ((Math.pow(x, 2.0) / (x + 2.0)) - (4.0 / (x + 2.0))) * (t_2 + (t_1 / t_0));
	} else {
		tmp = (x + -2.0) * (4.16438922228 + t_2);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))))
	t_1 = x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y)
	t_2 = z / t_0
	tmp = 0
	if (((x - 2.0) * (t_1 + z)) / t_0) <= 2e+253:
		tmp = ((math.pow(x, 2.0) / (x + 2.0)) - (4.0 / (x + 2.0))) * (t_2 + (t_1 / t_0))
	else:
		tmp = (x + -2.0) * (4.16438922228 + t_2)
	return tmp
function code(x, y, z)
	t_0 = Float64(47.066876606 + Float64(x * Float64(313.399215894 + Float64(x * Float64(263.505074721 + Float64(x * Float64(x + 43.3400022514)))))))
	t_1 = Float64(x * Float64(Float64(x * Float64(Float64(x * Float64(Float64(x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y))
	t_2 = Float64(z / t_0)
	tmp = 0.0
	if (Float64(Float64(Float64(x - 2.0) * Float64(t_1 + z)) / t_0) <= 2e+253)
		tmp = Float64(Float64(Float64((x ^ 2.0) / Float64(x + 2.0)) - Float64(4.0 / Float64(x + 2.0))) * Float64(t_2 + Float64(t_1 / t_0)));
	else
		tmp = Float64(Float64(x + -2.0) * Float64(4.16438922228 + t_2));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))));
	t_1 = x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y);
	t_2 = z / t_0;
	tmp = 0.0;
	if ((((x - 2.0) * (t_1 + z)) / t_0) <= 2e+253)
		tmp = (((x ^ 2.0) / (x + 2.0)) - (4.0 / (x + 2.0))) * (t_2 + (t_1 / t_0));
	else
		tmp = (x + -2.0) * (4.16438922228 + t_2);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(47.066876606 + N[(x * N[(313.399215894 + N[(x * N[(263.505074721 + N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(N[(x * N[(N[(x * N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision]), $MachinePrecision] + 137.519416416), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z / t$95$0), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x - 2.0), $MachinePrecision] * N[(t$95$1 + z), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], 2e+253], N[(N[(N[(N[Power[x, 2.0], $MachinePrecision] / N[(x + 2.0), $MachinePrecision]), $MachinePrecision] - N[(4.0 / N[(x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 + N[(t$95$1 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] * N[(4.16438922228 + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)\\
t_1 := x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\right)\\
t_2 := \frac{z}{t\_0}\\
\mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(t\_1 + z\right)}{t\_0} \leq 2 \cdot 10^{+253}:\\
\;\;\;\;\left(\frac{{x}^{2}}{x + 2} - \frac{4}{x + 2}\right) \cdot \left(t\_2 + \frac{t\_1}{t\_0}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + t\_2\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < 1.9999999999999999e253

    1. Initial program 96.9%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*98.8%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg98.8%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval98.8%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define98.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define98.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define98.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define98.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define98.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define98.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define98.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified98.8%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 98.8%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right)} \]
    6. Step-by-step derivation
      1. metadata-eval98.8%

        \[\leadsto \left(x + \color{blue}{\left(-2\right)}\right) \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right) \]
      2. sub-neg98.8%

        \[\leadsto \color{blue}{\left(x - 2\right)} \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right) \]
      3. flip--98.9%

        \[\leadsto \color{blue}{\frac{x \cdot x - 2 \cdot 2}{x + 2}} \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right) \]
      4. metadata-eval98.9%

        \[\leadsto \frac{x \cdot x - \color{blue}{4}}{x + 2} \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right) \]
      5. metadata-eval98.9%

        \[\leadsto \frac{x \cdot x - \color{blue}{-2 \cdot -2}}{x + 2} \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right) \]
      6. div-sub98.9%

        \[\leadsto \color{blue}{\left(\frac{x \cdot x}{x + 2} - \frac{-2 \cdot -2}{x + 2}\right)} \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right) \]
      7. pow298.9%

        \[\leadsto \left(\frac{\color{blue}{{x}^{2}}}{x + 2} - \frac{-2 \cdot -2}{x + 2}\right) \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right) \]
      8. metadata-eval98.9%

        \[\leadsto \left(\frac{{x}^{2}}{x + 2} - \frac{\color{blue}{4}}{x + 2}\right) \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right) \]
    7. Applied egg-rr98.9%

      \[\leadsto \color{blue}{\left(\frac{{x}^{2}}{x + 2} - \frac{4}{x + 2}\right)} \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right) \]

    if 1.9999999999999999e253 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64)))

    1. Initial program 10.2%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*15.3%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg15.3%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval15.3%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified15.3%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 15.3%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right)} \]
    6. Taylor expanded in x around inf 98.4%

      \[\leadsto \left(x + -2\right) \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \color{blue}{4.16438922228}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\right) + z\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)} \leq 2 \cdot 10^{+253}:\\ \;\;\;\;\left(\frac{{x}^{2}}{x + 2} - \frac{4}{x + 2}\right) \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)} + \frac{x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 97.8% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)\\ t_1 := \frac{z}{t\_0}\\ t_2 := x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\right)\\ \mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(t\_2 + z\right)}{t\_0} \leq 2 \cdot 10^{+253}:\\ \;\;\;\;\left(t\_1 + \frac{t\_2}{t\_0}\right) \cdot \frac{1}{\frac{x + 2}{\mathsf{fma}\left(x, x, -4\right)}}\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + t\_1\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0
         (+
          47.066876606
          (*
           x
           (+
            313.399215894
            (* x (+ 263.505074721 (* x (+ x 43.3400022514))))))))
        (t_1 (/ z t_0))
        (t_2
         (*
          x
          (+
           (* x (+ (* x (+ (* x 4.16438922228) 78.6994924154)) 137.519416416))
           y))))
   (if (<= (/ (* (- x 2.0) (+ t_2 z)) t_0) 2e+253)
     (* (+ t_1 (/ t_2 t_0)) (/ 1.0 (/ (+ x 2.0) (fma x x -4.0))))
     (* (+ x -2.0) (+ 4.16438922228 t_1)))))
double code(double x, double y, double z) {
	double t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))));
	double t_1 = z / t_0;
	double t_2 = x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y);
	double tmp;
	if ((((x - 2.0) * (t_2 + z)) / t_0) <= 2e+253) {
		tmp = (t_1 + (t_2 / t_0)) * (1.0 / ((x + 2.0) / fma(x, x, -4.0)));
	} else {
		tmp = (x + -2.0) * (4.16438922228 + t_1);
	}
	return tmp;
}
function code(x, y, z)
	t_0 = Float64(47.066876606 + Float64(x * Float64(313.399215894 + Float64(x * Float64(263.505074721 + Float64(x * Float64(x + 43.3400022514)))))))
	t_1 = Float64(z / t_0)
	t_2 = Float64(x * Float64(Float64(x * Float64(Float64(x * Float64(Float64(x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y))
	tmp = 0.0
	if (Float64(Float64(Float64(x - 2.0) * Float64(t_2 + z)) / t_0) <= 2e+253)
		tmp = Float64(Float64(t_1 + Float64(t_2 / t_0)) * Float64(1.0 / Float64(Float64(x + 2.0) / fma(x, x, -4.0))));
	else
		tmp = Float64(Float64(x + -2.0) * Float64(4.16438922228 + t_1));
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[(47.066876606 + N[(x * N[(313.399215894 + N[(x * N[(263.505074721 + N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z / t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(x * N[(N[(x * N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision]), $MachinePrecision] + 137.519416416), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x - 2.0), $MachinePrecision] * N[(t$95$2 + z), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], 2e+253], N[(N[(t$95$1 + N[(t$95$2 / t$95$0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[(x + 2.0), $MachinePrecision] / N[(x * x + -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] * N[(4.16438922228 + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)\\
t_1 := \frac{z}{t\_0}\\
t_2 := x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\right)\\
\mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(t\_2 + z\right)}{t\_0} \leq 2 \cdot 10^{+253}:\\
\;\;\;\;\left(t\_1 + \frac{t\_2}{t\_0}\right) \cdot \frac{1}{\frac{x + 2}{\mathsf{fma}\left(x, x, -4\right)}}\\

\mathbf{else}:\\
\;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + t\_1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < 1.9999999999999999e253

    1. Initial program 96.9%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*98.8%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg98.8%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval98.8%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define98.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define98.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define98.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define98.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define98.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define98.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define98.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified98.8%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 98.8%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right)} \]
    6. Step-by-step derivation
      1. metadata-eval98.8%

        \[\leadsto \left(x + \color{blue}{\left(-2\right)}\right) \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right) \]
      2. sub-neg98.8%

        \[\leadsto \color{blue}{\left(x - 2\right)} \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right) \]
      3. flip--98.9%

        \[\leadsto \color{blue}{\frac{x \cdot x - 2 \cdot 2}{x + 2}} \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right) \]
      4. metadata-eval98.9%

        \[\leadsto \frac{x \cdot x - \color{blue}{4}}{x + 2} \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right) \]
      5. metadata-eval98.9%

        \[\leadsto \frac{x \cdot x - \color{blue}{-2 \cdot -2}}{x + 2} \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right) \]
      6. clear-num98.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{x + 2}{x \cdot x - -2 \cdot -2}}} \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right) \]
      7. fma-neg98.9%

        \[\leadsto \frac{1}{\frac{x + 2}{\color{blue}{\mathsf{fma}\left(x, x, --2 \cdot -2\right)}}} \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right) \]
      8. metadata-eval98.9%

        \[\leadsto \frac{1}{\frac{x + 2}{\mathsf{fma}\left(x, x, -\color{blue}{4}\right)}} \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right) \]
      9. metadata-eval98.9%

        \[\leadsto \frac{1}{\frac{x + 2}{\mathsf{fma}\left(x, x, \color{blue}{-4}\right)}} \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right) \]
    7. Applied egg-rr98.9%

      \[\leadsto \color{blue}{\frac{1}{\frac{x + 2}{\mathsf{fma}\left(x, x, -4\right)}}} \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right) \]

    if 1.9999999999999999e253 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64)))

    1. Initial program 10.2%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*15.3%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg15.3%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval15.3%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified15.3%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 15.3%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right)} \]
    6. Taylor expanded in x around inf 98.4%

      \[\leadsto \left(x + -2\right) \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \color{blue}{4.16438922228}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\right) + z\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)} \leq 2 \cdot 10^{+253}:\\ \;\;\;\;\left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)} + \frac{x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\right) \cdot \frac{1}{\frac{x + 2}{\mathsf{fma}\left(x, x, -4\right)}}\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 97.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)\\ t_1 := \frac{z}{t\_0}\\ t_2 := x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\right)\\ \mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(t\_2 + z\right)}{t\_0} \leq 2 \cdot 10^{+253}:\\ \;\;\;\;\left(t\_1 + \frac{t\_2}{t\_0}\right) \cdot \left(x + -2\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + t\_1\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0
         (+
          47.066876606
          (*
           x
           (+
            313.399215894
            (* x (+ 263.505074721 (* x (+ x 43.3400022514))))))))
        (t_1 (/ z t_0))
        (t_2
         (*
          x
          (+
           (* x (+ (* x (+ (* x 4.16438922228) 78.6994924154)) 137.519416416))
           y))))
   (if (<= (/ (* (- x 2.0) (+ t_2 z)) t_0) 2e+253)
     (* (+ t_1 (/ t_2 t_0)) (+ x -2.0))
     (* (+ x -2.0) (+ 4.16438922228 t_1)))))
double code(double x, double y, double z) {
	double t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))));
	double t_1 = z / t_0;
	double t_2 = x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y);
	double tmp;
	if ((((x - 2.0) * (t_2 + z)) / t_0) <= 2e+253) {
		tmp = (t_1 + (t_2 / t_0)) * (x + -2.0);
	} else {
		tmp = (x + -2.0) * (4.16438922228 + t_1);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = 47.066876606d0 + (x * (313.399215894d0 + (x * (263.505074721d0 + (x * (x + 43.3400022514d0))))))
    t_1 = z / t_0
    t_2 = x * ((x * ((x * ((x * 4.16438922228d0) + 78.6994924154d0)) + 137.519416416d0)) + y)
    if ((((x - 2.0d0) * (t_2 + z)) / t_0) <= 2d+253) then
        tmp = (t_1 + (t_2 / t_0)) * (x + (-2.0d0))
    else
        tmp = (x + (-2.0d0)) * (4.16438922228d0 + t_1)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))));
	double t_1 = z / t_0;
	double t_2 = x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y);
	double tmp;
	if ((((x - 2.0) * (t_2 + z)) / t_0) <= 2e+253) {
		tmp = (t_1 + (t_2 / t_0)) * (x + -2.0);
	} else {
		tmp = (x + -2.0) * (4.16438922228 + t_1);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))))
	t_1 = z / t_0
	t_2 = x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y)
	tmp = 0
	if (((x - 2.0) * (t_2 + z)) / t_0) <= 2e+253:
		tmp = (t_1 + (t_2 / t_0)) * (x + -2.0)
	else:
		tmp = (x + -2.0) * (4.16438922228 + t_1)
	return tmp
function code(x, y, z)
	t_0 = Float64(47.066876606 + Float64(x * Float64(313.399215894 + Float64(x * Float64(263.505074721 + Float64(x * Float64(x + 43.3400022514)))))))
	t_1 = Float64(z / t_0)
	t_2 = Float64(x * Float64(Float64(x * Float64(Float64(x * Float64(Float64(x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y))
	tmp = 0.0
	if (Float64(Float64(Float64(x - 2.0) * Float64(t_2 + z)) / t_0) <= 2e+253)
		tmp = Float64(Float64(t_1 + Float64(t_2 / t_0)) * Float64(x + -2.0));
	else
		tmp = Float64(Float64(x + -2.0) * Float64(4.16438922228 + t_1));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))));
	t_1 = z / t_0;
	t_2 = x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y);
	tmp = 0.0;
	if ((((x - 2.0) * (t_2 + z)) / t_0) <= 2e+253)
		tmp = (t_1 + (t_2 / t_0)) * (x + -2.0);
	else
		tmp = (x + -2.0) * (4.16438922228 + t_1);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(47.066876606 + N[(x * N[(313.399215894 + N[(x * N[(263.505074721 + N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z / t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(x * N[(N[(x * N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision]), $MachinePrecision] + 137.519416416), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x - 2.0), $MachinePrecision] * N[(t$95$2 + z), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], 2e+253], N[(N[(t$95$1 + N[(t$95$2 / t$95$0), $MachinePrecision]), $MachinePrecision] * N[(x + -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] * N[(4.16438922228 + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)\\
t_1 := \frac{z}{t\_0}\\
t_2 := x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\right)\\
\mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(t\_2 + z\right)}{t\_0} \leq 2 \cdot 10^{+253}:\\
\;\;\;\;\left(t\_1 + \frac{t\_2}{t\_0}\right) \cdot \left(x + -2\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + t\_1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < 1.9999999999999999e253

    1. Initial program 96.9%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*98.8%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg98.8%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval98.8%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define98.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define98.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define98.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define98.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define98.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define98.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define98.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified98.8%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 98.8%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right)} \]

    if 1.9999999999999999e253 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64)))

    1. Initial program 10.2%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*15.3%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg15.3%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval15.3%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified15.3%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 15.3%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right)} \]
    6. Taylor expanded in x around inf 98.4%

      \[\leadsto \left(x + -2\right) \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \color{blue}{4.16438922228}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\right) + z\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)} \leq 2 \cdot 10^{+253}:\\ \;\;\;\;\left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)} + \frac{x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\right) \cdot \left(x + -2\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 96.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)\\ t_1 := \frac{\left(x - 2\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\right) + z\right)}{t\_0}\\ \mathbf{if}\;t\_1 \leq 2 \cdot 10^{+253}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{t\_0}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0
         (+
          47.066876606
          (*
           x
           (+
            313.399215894
            (* x (+ 263.505074721 (* x (+ x 43.3400022514))))))))
        (t_1
         (/
          (*
           (- x 2.0)
           (+
            (*
             x
             (+
              (*
               x
               (+ (* x (+ (* x 4.16438922228) 78.6994924154)) 137.519416416))
              y))
            z))
          t_0)))
   (if (<= t_1 2e+253) t_1 (* (+ x -2.0) (+ 4.16438922228 (/ z t_0))))))
double code(double x, double y, double z) {
	double t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))));
	double t_1 = ((x - 2.0) * ((x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y)) + z)) / t_0;
	double tmp;
	if (t_1 <= 2e+253) {
		tmp = t_1;
	} else {
		tmp = (x + -2.0) * (4.16438922228 + (z / t_0));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 47.066876606d0 + (x * (313.399215894d0 + (x * (263.505074721d0 + (x * (x + 43.3400022514d0))))))
    t_1 = ((x - 2.0d0) * ((x * ((x * ((x * ((x * 4.16438922228d0) + 78.6994924154d0)) + 137.519416416d0)) + y)) + z)) / t_0
    if (t_1 <= 2d+253) then
        tmp = t_1
    else
        tmp = (x + (-2.0d0)) * (4.16438922228d0 + (z / t_0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))));
	double t_1 = ((x - 2.0) * ((x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y)) + z)) / t_0;
	double tmp;
	if (t_1 <= 2e+253) {
		tmp = t_1;
	} else {
		tmp = (x + -2.0) * (4.16438922228 + (z / t_0));
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))))
	t_1 = ((x - 2.0) * ((x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y)) + z)) / t_0
	tmp = 0
	if t_1 <= 2e+253:
		tmp = t_1
	else:
		tmp = (x + -2.0) * (4.16438922228 + (z / t_0))
	return tmp
function code(x, y, z)
	t_0 = Float64(47.066876606 + Float64(x * Float64(313.399215894 + Float64(x * Float64(263.505074721 + Float64(x * Float64(x + 43.3400022514)))))))
	t_1 = Float64(Float64(Float64(x - 2.0) * Float64(Float64(x * Float64(Float64(x * Float64(Float64(x * Float64(Float64(x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y)) + z)) / t_0)
	tmp = 0.0
	if (t_1 <= 2e+253)
		tmp = t_1;
	else
		tmp = Float64(Float64(x + -2.0) * Float64(4.16438922228 + Float64(z / t_0)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))));
	t_1 = ((x - 2.0) * ((x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y)) + z)) / t_0;
	tmp = 0.0;
	if (t_1 <= 2e+253)
		tmp = t_1;
	else
		tmp = (x + -2.0) * (4.16438922228 + (z / t_0));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(47.066876606 + N[(x * N[(313.399215894 + N[(x * N[(263.505074721 + N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(x - 2.0), $MachinePrecision] * N[(N[(x * N[(N[(x * N[(N[(x * N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision]), $MachinePrecision] + 137.519416416), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+253], t$95$1, N[(N[(x + -2.0), $MachinePrecision] * N[(4.16438922228 + N[(z / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)\\
t_1 := \frac{\left(x - 2\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\right) + z\right)}{t\_0}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{+253}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{t\_0}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < 1.9999999999999999e253

    1. Initial program 96.9%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Add Preprocessing

    if 1.9999999999999999e253 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64)))

    1. Initial program 10.2%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*15.3%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg15.3%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval15.3%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define15.3%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified15.3%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 15.3%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right)} \]
    6. Taylor expanded in x around inf 98.4%

      \[\leadsto \left(x + -2\right) \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \color{blue}{4.16438922228}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\right) + z\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)} \leq 2 \cdot 10^{+253}:\\ \;\;\;\;\frac{\left(x - 2\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\right) + z\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 96.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)\\ \mathbf{if}\;x \leq -9000000000:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{\frac{3451.550173699799 + \frac{y - 124074.40615218398}{x}}{x} - 101.7851458539211}{x}\right)\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{+19}:\\ \;\;\;\;\frac{\left(x - 2\right) \cdot \left(z + x \cdot \left(y + x \cdot 137.519416416\right)\right)}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{t\_0}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0
         (+
          47.066876606
          (*
           x
           (+
            313.399215894
            (* x (+ 263.505074721 (* x (+ x 43.3400022514)))))))))
   (if (<= x -9000000000.0)
     (*
      (+ x -2.0)
      (+
       4.16438922228
       (/
        (-
         (/ (+ 3451.550173699799 (/ (- y 124074.40615218398) x)) x)
         101.7851458539211)
        x)))
     (if (<= x 2.4e+19)
       (/ (* (- x 2.0) (+ z (* x (+ y (* x 137.519416416))))) t_0)
       (* (+ x -2.0) (+ 4.16438922228 (/ z t_0)))))))
double code(double x, double y, double z) {
	double t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))));
	double tmp;
	if (x <= -9000000000.0) {
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + ((y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x));
	} else if (x <= 2.4e+19) {
		tmp = ((x - 2.0) * (z + (x * (y + (x * 137.519416416))))) / t_0;
	} else {
		tmp = (x + -2.0) * (4.16438922228 + (z / t_0));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 47.066876606d0 + (x * (313.399215894d0 + (x * (263.505074721d0 + (x * (x + 43.3400022514d0))))))
    if (x <= (-9000000000.0d0)) then
        tmp = (x + (-2.0d0)) * (4.16438922228d0 + ((((3451.550173699799d0 + ((y - 124074.40615218398d0) / x)) / x) - 101.7851458539211d0) / x))
    else if (x <= 2.4d+19) then
        tmp = ((x - 2.0d0) * (z + (x * (y + (x * 137.519416416d0))))) / t_0
    else
        tmp = (x + (-2.0d0)) * (4.16438922228d0 + (z / t_0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))));
	double tmp;
	if (x <= -9000000000.0) {
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + ((y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x));
	} else if (x <= 2.4e+19) {
		tmp = ((x - 2.0) * (z + (x * (y + (x * 137.519416416))))) / t_0;
	} else {
		tmp = (x + -2.0) * (4.16438922228 + (z / t_0));
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))))
	tmp = 0
	if x <= -9000000000.0:
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + ((y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x))
	elif x <= 2.4e+19:
		tmp = ((x - 2.0) * (z + (x * (y + (x * 137.519416416))))) / t_0
	else:
		tmp = (x + -2.0) * (4.16438922228 + (z / t_0))
	return tmp
function code(x, y, z)
	t_0 = Float64(47.066876606 + Float64(x * Float64(313.399215894 + Float64(x * Float64(263.505074721 + Float64(x * Float64(x + 43.3400022514)))))))
	tmp = 0.0
	if (x <= -9000000000.0)
		tmp = Float64(Float64(x + -2.0) * Float64(4.16438922228 + Float64(Float64(Float64(Float64(3451.550173699799 + Float64(Float64(y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x)));
	elseif (x <= 2.4e+19)
		tmp = Float64(Float64(Float64(x - 2.0) * Float64(z + Float64(x * Float64(y + Float64(x * 137.519416416))))) / t_0);
	else
		tmp = Float64(Float64(x + -2.0) * Float64(4.16438922228 + Float64(z / t_0)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))));
	tmp = 0.0;
	if (x <= -9000000000.0)
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + ((y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x));
	elseif (x <= 2.4e+19)
		tmp = ((x - 2.0) * (z + (x * (y + (x * 137.519416416))))) / t_0;
	else
		tmp = (x + -2.0) * (4.16438922228 + (z / t_0));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(47.066876606 + N[(x * N[(313.399215894 + N[(x * N[(263.505074721 + N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9000000000.0], N[(N[(x + -2.0), $MachinePrecision] * N[(4.16438922228 + N[(N[(N[(N[(3451.550173699799 + N[(N[(y - 124074.40615218398), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 101.7851458539211), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.4e+19], N[(N[(N[(x - 2.0), $MachinePrecision] * N[(z + N[(x * N[(y + N[(x * 137.519416416), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] * N[(4.16438922228 + N[(z / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)\\
\mathbf{if}\;x \leq -9000000000:\\
\;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{\frac{3451.550173699799 + \frac{y - 124074.40615218398}{x}}{x} - 101.7851458539211}{x}\right)\\

\mathbf{elif}\;x \leq 2.4 \cdot 10^{+19}:\\
\;\;\;\;\frac{\left(x - 2\right) \cdot \left(z + x \cdot \left(y + x \cdot 137.519416416\right)\right)}{t\_0}\\

\mathbf{else}:\\
\;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{t\_0}\right)\\


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

    1. Initial program 13.0%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*19.0%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg19.0%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval19.0%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified19.0%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around -inf 97.3%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 + -1 \cdot \frac{101.7851458539211 + -1 \cdot \frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}}{x}\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg97.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 + \color{blue}{\left(-\frac{101.7851458539211 + -1 \cdot \frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}}{x}\right)}\right) \]
      2. unsub-neg97.3%

        \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211 + -1 \cdot \frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}}{x}\right)} \]
      3. mul-1-neg97.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \color{blue}{\left(-\frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}\right)}}{x}\right) \]
      4. unsub-neg97.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{\color{blue}{101.7851458539211 - \frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}}}{x}\right) \]
      5. mul-1-neg97.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 + \color{blue}{\left(-\frac{124074.40615218398 + -1 \cdot y}{x}\right)}}{x}}{x}\right) \]
      6. unsub-neg97.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{\color{blue}{3451.550173699799 - \frac{124074.40615218398 + -1 \cdot y}{x}}}{x}}{x}\right) \]
      7. mul-1-neg97.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 - \frac{124074.40615218398 + \color{blue}{\left(-y\right)}}{x}}{x}}{x}\right) \]
      8. unsub-neg97.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 - \frac{\color{blue}{124074.40615218398 - y}}{x}}{x}}{x}\right) \]
    7. Simplified97.3%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 - \frac{124074.40615218398 - y}{x}}{x}}{x}\right)} \]

    if -9e9 < x < 2.4e19

    1. Initial program 99.7%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 98.2%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(\color{blue}{137.519416416 \cdot x} + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    4. Step-by-step derivation
      1. *-commutative98.2%

        \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(\color{blue}{x \cdot 137.519416416} + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    5. Simplified98.2%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(\color{blue}{x \cdot 137.519416416} + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]

    if 2.4e19 < x

    1. Initial program 11.5%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*19.5%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg19.5%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval19.5%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define19.5%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define19.5%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define19.5%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define19.5%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define19.5%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define19.5%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define19.5%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified19.5%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 19.4%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right)} \]
    6. Taylor expanded in x around inf 96.4%

      \[\leadsto \left(x + -2\right) \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \color{blue}{4.16438922228}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification97.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9000000000:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{\frac{3451.550173699799 + \frac{y - 124074.40615218398}{x}}{x} - 101.7851458539211}{x}\right)\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{+19}:\\ \;\;\;\;\frac{\left(x - 2\right) \cdot \left(z + x \cdot \left(y + x \cdot 137.519416416\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 95.3% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -0.0049:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\right)\\ \mathbf{elif}\;x \leq 80:\\ \;\;\;\;\frac{\left(x - 2\right) \cdot \left(z + x \cdot \left(y + x \cdot 137.519416416\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot 263.505074721\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{\frac{3451.550173699799 + \frac{y - 124074.40615218398}{x}}{x} - 101.7851458539211}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -0.0049)
   (*
    (+ x -2.0)
    (+
     4.16438922228
     (/
      z
      (+
       47.066876606
       (*
        x
        (+
         313.399215894
         (* x (+ 263.505074721 (* x (+ x 43.3400022514))))))))))
   (if (<= x 80.0)
     (/
      (* (- x 2.0) (+ z (* x (+ y (* x 137.519416416)))))
      (+ 47.066876606 (* x (+ 313.399215894 (* x 263.505074721)))))
     (*
      (+ x -2.0)
      (+
       4.16438922228
       (/
        (-
         (/ (+ 3451.550173699799 (/ (- y 124074.40615218398) x)) x)
         101.7851458539211)
        x))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -0.0049) {
		tmp = (x + -2.0) * (4.16438922228 + (z / (47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514)))))))));
	} else if (x <= 80.0) {
		tmp = ((x - 2.0) * (z + (x * (y + (x * 137.519416416))))) / (47.066876606 + (x * (313.399215894 + (x * 263.505074721))));
	} else {
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + ((y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-0.0049d0)) then
        tmp = (x + (-2.0d0)) * (4.16438922228d0 + (z / (47.066876606d0 + (x * (313.399215894d0 + (x * (263.505074721d0 + (x * (x + 43.3400022514d0)))))))))
    else if (x <= 80.0d0) then
        tmp = ((x - 2.0d0) * (z + (x * (y + (x * 137.519416416d0))))) / (47.066876606d0 + (x * (313.399215894d0 + (x * 263.505074721d0))))
    else
        tmp = (x + (-2.0d0)) * (4.16438922228d0 + ((((3451.550173699799d0 + ((y - 124074.40615218398d0) / x)) / x) - 101.7851458539211d0) / x))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -0.0049) {
		tmp = (x + -2.0) * (4.16438922228 + (z / (47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514)))))))));
	} else if (x <= 80.0) {
		tmp = ((x - 2.0) * (z + (x * (y + (x * 137.519416416))))) / (47.066876606 + (x * (313.399215894 + (x * 263.505074721))));
	} else {
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + ((y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -0.0049:
		tmp = (x + -2.0) * (4.16438922228 + (z / (47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514)))))))))
	elif x <= 80.0:
		tmp = ((x - 2.0) * (z + (x * (y + (x * 137.519416416))))) / (47.066876606 + (x * (313.399215894 + (x * 263.505074721))))
	else:
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + ((y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -0.0049)
		tmp = Float64(Float64(x + -2.0) * Float64(4.16438922228 + Float64(z / Float64(47.066876606 + Float64(x * Float64(313.399215894 + Float64(x * Float64(263.505074721 + Float64(x * Float64(x + 43.3400022514))))))))));
	elseif (x <= 80.0)
		tmp = Float64(Float64(Float64(x - 2.0) * Float64(z + Float64(x * Float64(y + Float64(x * 137.519416416))))) / Float64(47.066876606 + Float64(x * Float64(313.399215894 + Float64(x * 263.505074721)))));
	else
		tmp = Float64(Float64(x + -2.0) * Float64(4.16438922228 + Float64(Float64(Float64(Float64(3451.550173699799 + Float64(Float64(y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -0.0049)
		tmp = (x + -2.0) * (4.16438922228 + (z / (47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514)))))))));
	elseif (x <= 80.0)
		tmp = ((x - 2.0) * (z + (x * (y + (x * 137.519416416))))) / (47.066876606 + (x * (313.399215894 + (x * 263.505074721))));
	else
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + ((y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -0.0049], N[(N[(x + -2.0), $MachinePrecision] * N[(4.16438922228 + N[(z / N[(47.066876606 + N[(x * N[(313.399215894 + N[(x * N[(263.505074721 + N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 80.0], N[(N[(N[(x - 2.0), $MachinePrecision] * N[(z + N[(x * N[(y + N[(x * 137.519416416), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(47.066876606 + N[(x * N[(313.399215894 + N[(x * 263.505074721), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] * N[(4.16438922228 + N[(N[(N[(N[(3451.550173699799 + N[(N[(y - 124074.40615218398), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 101.7851458539211), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.0049:\\
\;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\right)\\

\mathbf{elif}\;x \leq 80:\\
\;\;\;\;\frac{\left(x - 2\right) \cdot \left(z + x \cdot \left(y + x \cdot 137.519416416\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot 263.505074721\right)}\\

\mathbf{else}:\\
\;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{\frac{3451.550173699799 + \frac{y - 124074.40615218398}{x}}{x} - 101.7851458539211}{x}\right)\\


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

    1. Initial program 18.2%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*23.8%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg23.8%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval23.8%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define23.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define23.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define23.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define23.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define23.8%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define23.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define23.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified23.7%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 23.8%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right)} \]
    6. Taylor expanded in x around inf 93.9%

      \[\leadsto \left(x + -2\right) \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \color{blue}{4.16438922228}\right) \]

    if -0.0048999999999999998 < x < 80

    1. Initial program 99.7%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 98.8%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(\color{blue}{137.519416416 \cdot x} + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    4. Step-by-step derivation
      1. *-commutative98.8%

        \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(\color{blue}{x \cdot 137.519416416} + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    5. Simplified98.8%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(\color{blue}{x \cdot 137.519416416} + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    6. Taylor expanded in x around 0 98.5%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{\left(\color{blue}{263.505074721 \cdot x} + 313.399215894\right) \cdot x + 47.066876606} \]
    7. Step-by-step derivation
      1. *-commutative98.5%

        \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{\left(\color{blue}{x \cdot 263.505074721} + 313.399215894\right) \cdot x + 47.066876606} \]
    8. Simplified98.5%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{\left(\color{blue}{x \cdot 263.505074721} + 313.399215894\right) \cdot x + 47.066876606} \]

    if 80 < x

    1. Initial program 15.1%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*22.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg22.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval22.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified22.7%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around -inf 95.3%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 + -1 \cdot \frac{101.7851458539211 + -1 \cdot \frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}}{x}\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg95.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 + \color{blue}{\left(-\frac{101.7851458539211 + -1 \cdot \frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}}{x}\right)}\right) \]
      2. unsub-neg95.3%

        \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211 + -1 \cdot \frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}}{x}\right)} \]
      3. mul-1-neg95.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \color{blue}{\left(-\frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}\right)}}{x}\right) \]
      4. unsub-neg95.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{\color{blue}{101.7851458539211 - \frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}}}{x}\right) \]
      5. mul-1-neg95.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 + \color{blue}{\left(-\frac{124074.40615218398 + -1 \cdot y}{x}\right)}}{x}}{x}\right) \]
      6. unsub-neg95.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{\color{blue}{3451.550173699799 - \frac{124074.40615218398 + -1 \cdot y}{x}}}{x}}{x}\right) \]
      7. mul-1-neg95.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 - \frac{124074.40615218398 + \color{blue}{\left(-y\right)}}{x}}{x}}{x}\right) \]
      8. unsub-neg95.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 - \frac{\color{blue}{124074.40615218398 - y}}{x}}{x}}{x}\right) \]
    7. Simplified95.3%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 - \frac{124074.40615218398 - y}{x}}{x}}{x}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification96.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.0049:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\right)\\ \mathbf{elif}\;x \leq 80:\\ \;\;\;\;\frac{\left(x - 2\right) \cdot \left(z + x \cdot \left(y + x \cdot 137.519416416\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot 263.505074721\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{\frac{3451.550173699799 + \frac{y - 124074.40615218398}{x}}{x} - 101.7851458539211}{x}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 95.7% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -37 \lor \neg \left(x \leq 98\right):\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{\frac{3451.550173699799 + \frac{y - 124074.40615218398}{x}}{x} - 101.7851458539211}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x - 2\right) \cdot \left(z + x \cdot \left(y + x \cdot 137.519416416\right)\right)}{47.066876606 + x \cdot 313.399215894}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= x -37.0) (not (<= x 98.0)))
   (*
    (+ x -2.0)
    (+
     4.16438922228
     (/
      (-
       (/ (+ 3451.550173699799 (/ (- y 124074.40615218398) x)) x)
       101.7851458539211)
      x)))
   (/
    (* (- x 2.0) (+ z (* x (+ y (* x 137.519416416)))))
    (+ 47.066876606 (* x 313.399215894)))))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -37.0) || !(x <= 98.0)) {
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + ((y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x));
	} else {
		tmp = ((x - 2.0) * (z + (x * (y + (x * 137.519416416))))) / (47.066876606 + (x * 313.399215894));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((x <= (-37.0d0)) .or. (.not. (x <= 98.0d0))) then
        tmp = (x + (-2.0d0)) * (4.16438922228d0 + ((((3451.550173699799d0 + ((y - 124074.40615218398d0) / x)) / x) - 101.7851458539211d0) / x))
    else
        tmp = ((x - 2.0d0) * (z + (x * (y + (x * 137.519416416d0))))) / (47.066876606d0 + (x * 313.399215894d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((x <= -37.0) || !(x <= 98.0)) {
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + ((y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x));
	} else {
		tmp = ((x - 2.0) * (z + (x * (y + (x * 137.519416416))))) / (47.066876606 + (x * 313.399215894));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (x <= -37.0) or not (x <= 98.0):
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + ((y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x))
	else:
		tmp = ((x - 2.0) * (z + (x * (y + (x * 137.519416416))))) / (47.066876606 + (x * 313.399215894))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((x <= -37.0) || !(x <= 98.0))
		tmp = Float64(Float64(x + -2.0) * Float64(4.16438922228 + Float64(Float64(Float64(Float64(3451.550173699799 + Float64(Float64(y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x)));
	else
		tmp = Float64(Float64(Float64(x - 2.0) * Float64(z + Float64(x * Float64(y + Float64(x * 137.519416416))))) / Float64(47.066876606 + Float64(x * 313.399215894)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((x <= -37.0) || ~((x <= 98.0)))
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + ((y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x));
	else
		tmp = ((x - 2.0) * (z + (x * (y + (x * 137.519416416))))) / (47.066876606 + (x * 313.399215894));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[x, -37.0], N[Not[LessEqual[x, 98.0]], $MachinePrecision]], N[(N[(x + -2.0), $MachinePrecision] * N[(4.16438922228 + N[(N[(N[(N[(3451.550173699799 + N[(N[(y - 124074.40615218398), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 101.7851458539211), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x - 2.0), $MachinePrecision] * N[(z + N[(x * N[(y + N[(x * 137.519416416), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(47.066876606 + N[(x * 313.399215894), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -37 \lor \neg \left(x \leq 98\right):\\
\;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{\frac{3451.550173699799 + \frac{y - 124074.40615218398}{x}}{x} - 101.7851458539211}{x}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(x - 2\right) \cdot \left(z + x \cdot \left(y + x \cdot 137.519416416\right)\right)}{47.066876606 + x \cdot 313.399215894}\\


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

    1. Initial program 15.6%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*22.5%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg22.5%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval22.5%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define22.5%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define22.5%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define22.5%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define22.5%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define22.5%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define22.5%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define22.5%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified22.5%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around -inf 94.7%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 + -1 \cdot \frac{101.7851458539211 + -1 \cdot \frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}}{x}\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg94.7%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 + \color{blue}{\left(-\frac{101.7851458539211 + -1 \cdot \frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}}{x}\right)}\right) \]
      2. unsub-neg94.7%

        \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211 + -1 \cdot \frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}}{x}\right)} \]
      3. mul-1-neg94.7%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \color{blue}{\left(-\frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}\right)}}{x}\right) \]
      4. unsub-neg94.7%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{\color{blue}{101.7851458539211 - \frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}}}{x}\right) \]
      5. mul-1-neg94.7%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 + \color{blue}{\left(-\frac{124074.40615218398 + -1 \cdot y}{x}\right)}}{x}}{x}\right) \]
      6. unsub-neg94.7%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{\color{blue}{3451.550173699799 - \frac{124074.40615218398 + -1 \cdot y}{x}}}{x}}{x}\right) \]
      7. mul-1-neg94.7%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 - \frac{124074.40615218398 + \color{blue}{\left(-y\right)}}{x}}{x}}{x}\right) \]
      8. unsub-neg94.7%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 - \frac{\color{blue}{124074.40615218398 - y}}{x}}{x}}{x}\right) \]
    7. Simplified94.7%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 - \frac{124074.40615218398 - y}{x}}{x}}{x}\right)} \]

    if -37 < x < 98

    1. Initial program 99.7%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 98.8%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(\color{blue}{137.519416416 \cdot x} + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    4. Step-by-step derivation
      1. *-commutative98.8%

        \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(\color{blue}{x \cdot 137.519416416} + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    5. Simplified98.8%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(\color{blue}{x \cdot 137.519416416} + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    6. Taylor expanded in x around 0 97.7%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{\left(\color{blue}{263.505074721 \cdot x} + 313.399215894\right) \cdot x + 47.066876606} \]
    7. Step-by-step derivation
      1. *-commutative97.7%

        \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{\left(\color{blue}{x \cdot 263.505074721} + 313.399215894\right) \cdot x + 47.066876606} \]
    8. Simplified97.7%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{\left(\color{blue}{x \cdot 263.505074721} + 313.399215894\right) \cdot x + 47.066876606} \]
    9. Taylor expanded in x around 0 97.3%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{\color{blue}{313.399215894 \cdot x} + 47.066876606} \]
    10. Step-by-step derivation
      1. *-commutative97.3%

        \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{\color{blue}{x \cdot 313.399215894} + 47.066876606} \]
    11. Simplified97.3%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{\color{blue}{x \cdot 313.399215894} + 47.066876606} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification96.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -37 \lor \neg \left(x \leq 98\right):\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{\frac{3451.550173699799 + \frac{y - 124074.40615218398}{x}}{x} - 101.7851458539211}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x - 2\right) \cdot \left(z + x \cdot \left(y + x \cdot 137.519416416\right)\right)}{47.066876606 + x \cdot 313.399215894}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 93.2% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1960 \lor \neg \left(x \leq 37\right):\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{\frac{3451.550173699799 + \frac{y - 124074.40615218398}{x}}{x} - 101.7851458539211}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x - 2\right) \cdot \left(z + x \cdot y\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot 263.505074721\right)}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= x -1960.0) (not (<= x 37.0)))
   (*
    (+ x -2.0)
    (+
     4.16438922228
     (/
      (-
       (/ (+ 3451.550173699799 (/ (- y 124074.40615218398) x)) x)
       101.7851458539211)
      x)))
   (/
    (* (- x 2.0) (+ z (* x y)))
    (+ 47.066876606 (* x (+ 313.399215894 (* x 263.505074721)))))))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -1960.0) || !(x <= 37.0)) {
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + ((y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x));
	} else {
		tmp = ((x - 2.0) * (z + (x * y))) / (47.066876606 + (x * (313.399215894 + (x * 263.505074721))));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((x <= (-1960.0d0)) .or. (.not. (x <= 37.0d0))) then
        tmp = (x + (-2.0d0)) * (4.16438922228d0 + ((((3451.550173699799d0 + ((y - 124074.40615218398d0) / x)) / x) - 101.7851458539211d0) / x))
    else
        tmp = ((x - 2.0d0) * (z + (x * y))) / (47.066876606d0 + (x * (313.399215894d0 + (x * 263.505074721d0))))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((x <= -1960.0) || !(x <= 37.0)) {
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + ((y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x));
	} else {
		tmp = ((x - 2.0) * (z + (x * y))) / (47.066876606 + (x * (313.399215894 + (x * 263.505074721))));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (x <= -1960.0) or not (x <= 37.0):
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + ((y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x))
	else:
		tmp = ((x - 2.0) * (z + (x * y))) / (47.066876606 + (x * (313.399215894 + (x * 263.505074721))))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((x <= -1960.0) || !(x <= 37.0))
		tmp = Float64(Float64(x + -2.0) * Float64(4.16438922228 + Float64(Float64(Float64(Float64(3451.550173699799 + Float64(Float64(y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x)));
	else
		tmp = Float64(Float64(Float64(x - 2.0) * Float64(z + Float64(x * y))) / Float64(47.066876606 + Float64(x * Float64(313.399215894 + Float64(x * 263.505074721)))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((x <= -1960.0) || ~((x <= 37.0)))
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + ((y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x));
	else
		tmp = ((x - 2.0) * (z + (x * y))) / (47.066876606 + (x * (313.399215894 + (x * 263.505074721))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[x, -1960.0], N[Not[LessEqual[x, 37.0]], $MachinePrecision]], N[(N[(x + -2.0), $MachinePrecision] * N[(4.16438922228 + N[(N[(N[(N[(3451.550173699799 + N[(N[(y - 124074.40615218398), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 101.7851458539211), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x - 2.0), $MachinePrecision] * N[(z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(47.066876606 + N[(x * N[(313.399215894 + N[(x * 263.505074721), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1960 \lor \neg \left(x \leq 37\right):\\
\;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{\frac{3451.550173699799 + \frac{y - 124074.40615218398}{x}}{x} - 101.7851458539211}{x}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(x - 2\right) \cdot \left(z + x \cdot y\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot 263.505074721\right)}\\


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

    1. Initial program 14.2%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*21.2%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg21.2%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval21.2%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define21.2%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define21.2%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define21.2%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define21.2%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define21.2%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define21.2%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define21.2%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified21.2%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around -inf 96.1%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 + -1 \cdot \frac{101.7851458539211 + -1 \cdot \frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}}{x}\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg96.1%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 + \color{blue}{\left(-\frac{101.7851458539211 + -1 \cdot \frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}}{x}\right)}\right) \]
      2. unsub-neg96.1%

        \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211 + -1 \cdot \frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}}{x}\right)} \]
      3. mul-1-neg96.1%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \color{blue}{\left(-\frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}\right)}}{x}\right) \]
      4. unsub-neg96.1%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{\color{blue}{101.7851458539211 - \frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}}}{x}\right) \]
      5. mul-1-neg96.1%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 + \color{blue}{\left(-\frac{124074.40615218398 + -1 \cdot y}{x}\right)}}{x}}{x}\right) \]
      6. unsub-neg96.1%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{\color{blue}{3451.550173699799 - \frac{124074.40615218398 + -1 \cdot y}{x}}}{x}}{x}\right) \]
      7. mul-1-neg96.1%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 - \frac{124074.40615218398 + \color{blue}{\left(-y\right)}}{x}}{x}}{x}\right) \]
      8. unsub-neg96.1%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 - \frac{\color{blue}{124074.40615218398 - y}}{x}}{x}}{x}\right) \]
    7. Simplified96.1%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 - \frac{124074.40615218398 - y}{x}}{x}}{x}\right)} \]

    if -1960 < x < 37

    1. Initial program 99.7%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 98.8%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(\color{blue}{137.519416416 \cdot x} + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    4. Step-by-step derivation
      1. *-commutative98.8%

        \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(\color{blue}{x \cdot 137.519416416} + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    5. Simplified98.8%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(\color{blue}{x \cdot 137.519416416} + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    6. Taylor expanded in x around 0 96.5%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{\left(\color{blue}{263.505074721 \cdot x} + 313.399215894\right) \cdot x + 47.066876606} \]
    7. Step-by-step derivation
      1. *-commutative96.5%

        \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{\left(\color{blue}{x \cdot 263.505074721} + 313.399215894\right) \cdot x + 47.066876606} \]
    8. Simplified96.5%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{\left(\color{blue}{x \cdot 263.505074721} + 313.399215894\right) \cdot x + 47.066876606} \]
    9. Taylor expanded in x around 0 91.4%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\color{blue}{x \cdot y} + z\right)}{\left(x \cdot 263.505074721 + 313.399215894\right) \cdot x + 47.066876606} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1960 \lor \neg \left(x \leq 37\right):\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{\frac{3451.550173699799 + \frac{y - 124074.40615218398}{x}}{x} - 101.7851458539211}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x - 2\right) \cdot \left(z + x \cdot y\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot 263.505074721\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 92.6% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -0.0032 \lor \neg \left(x \leq 1.05\right):\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{\frac{3451.550173699799 + \frac{y - 124074.40615218398}{x}}{x} - 101.7851458539211}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(z \cdot 0.0212463641547976 - x \cdot \left(z \cdot 0.14147091005106402 - y \cdot 0.0212463641547976\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= x -0.0032) (not (<= x 1.05)))
   (*
    (+ x -2.0)
    (+
     4.16438922228
     (/
      (-
       (/ (+ 3451.550173699799 (/ (- y 124074.40615218398) x)) x)
       101.7851458539211)
      x)))
   (*
    (+ x -2.0)
    (-
     (* z 0.0212463641547976)
     (* x (- (* z 0.14147091005106402) (* y 0.0212463641547976)))))))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -0.0032) || !(x <= 1.05)) {
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + ((y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x));
	} else {
		tmp = (x + -2.0) * ((z * 0.0212463641547976) - (x * ((z * 0.14147091005106402) - (y * 0.0212463641547976))));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((x <= (-0.0032d0)) .or. (.not. (x <= 1.05d0))) then
        tmp = (x + (-2.0d0)) * (4.16438922228d0 + ((((3451.550173699799d0 + ((y - 124074.40615218398d0) / x)) / x) - 101.7851458539211d0) / x))
    else
        tmp = (x + (-2.0d0)) * ((z * 0.0212463641547976d0) - (x * ((z * 0.14147091005106402d0) - (y * 0.0212463641547976d0))))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((x <= -0.0032) || !(x <= 1.05)) {
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + ((y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x));
	} else {
		tmp = (x + -2.0) * ((z * 0.0212463641547976) - (x * ((z * 0.14147091005106402) - (y * 0.0212463641547976))));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (x <= -0.0032) or not (x <= 1.05):
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + ((y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x))
	else:
		tmp = (x + -2.0) * ((z * 0.0212463641547976) - (x * ((z * 0.14147091005106402) - (y * 0.0212463641547976))))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((x <= -0.0032) || !(x <= 1.05))
		tmp = Float64(Float64(x + -2.0) * Float64(4.16438922228 + Float64(Float64(Float64(Float64(3451.550173699799 + Float64(Float64(y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x)));
	else
		tmp = Float64(Float64(x + -2.0) * Float64(Float64(z * 0.0212463641547976) - Float64(x * Float64(Float64(z * 0.14147091005106402) - Float64(y * 0.0212463641547976)))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((x <= -0.0032) || ~((x <= 1.05)))
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + ((y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x));
	else
		tmp = (x + -2.0) * ((z * 0.0212463641547976) - (x * ((z * 0.14147091005106402) - (y * 0.0212463641547976))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[x, -0.0032], N[Not[LessEqual[x, 1.05]], $MachinePrecision]], N[(N[(x + -2.0), $MachinePrecision] * N[(4.16438922228 + N[(N[(N[(N[(3451.550173699799 + N[(N[(y - 124074.40615218398), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 101.7851458539211), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] * N[(N[(z * 0.0212463641547976), $MachinePrecision] - N[(x * N[(N[(z * 0.14147091005106402), $MachinePrecision] - N[(y * 0.0212463641547976), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.0032 \lor \neg \left(x \leq 1.05\right):\\
\;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{\frac{3451.550173699799 + \frac{y - 124074.40615218398}{x}}{x} - 101.7851458539211}{x}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x + -2\right) \cdot \left(z \cdot 0.0212463641547976 - x \cdot \left(z \cdot 0.14147091005106402 - y \cdot 0.0212463641547976\right)\right)\\


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

    1. Initial program 17.0%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*23.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg23.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval23.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define23.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define23.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define23.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define23.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define23.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define23.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define23.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified23.7%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around -inf 93.3%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 + -1 \cdot \frac{101.7851458539211 + -1 \cdot \frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}}{x}\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg93.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 + \color{blue}{\left(-\frac{101.7851458539211 + -1 \cdot \frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}}{x}\right)}\right) \]
      2. unsub-neg93.3%

        \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211 + -1 \cdot \frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}}{x}\right)} \]
      3. mul-1-neg93.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \color{blue}{\left(-\frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}\right)}}{x}\right) \]
      4. unsub-neg93.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{\color{blue}{101.7851458539211 - \frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}}}{x}\right) \]
      5. mul-1-neg93.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 + \color{blue}{\left(-\frac{124074.40615218398 + -1 \cdot y}{x}\right)}}{x}}{x}\right) \]
      6. unsub-neg93.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{\color{blue}{3451.550173699799 - \frac{124074.40615218398 + -1 \cdot y}{x}}}{x}}{x}\right) \]
      7. mul-1-neg93.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 - \frac{124074.40615218398 + \color{blue}{\left(-y\right)}}{x}}{x}}{x}\right) \]
      8. unsub-neg93.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 - \frac{\color{blue}{124074.40615218398 - y}}{x}}{x}}{x}\right) \]
    7. Simplified93.3%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 - \frac{124074.40615218398 - y}{x}}{x}}{x}\right)} \]

    if -0.00320000000000000015 < x < 1.05000000000000004

    1. Initial program 99.7%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*99.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg99.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval99.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 92.7%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(0.0212463641547976 \cdot z + x \cdot \left(0.0212463641547976 \cdot y - 0.14147091005106402 \cdot z\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.0032 \lor \neg \left(x \leq 1.05\right):\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{\frac{3451.550173699799 + \frac{y - 124074.40615218398}{x}}{x} - 101.7851458539211}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(z \cdot 0.0212463641547976 - x \cdot \left(z \cdot 0.14147091005106402 - y \cdot 0.0212463641547976\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 95.1% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.8 \cdot 10^{-5}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\right)\\ \mathbf{elif}\;x \leq 60:\\ \;\;\;\;\frac{\left(x - 2\right) \cdot \left(z + x \cdot \left(y + x \cdot 137.519416416\right)\right)}{47.066876606 + x \cdot 313.399215894}\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{\frac{3451.550173699799 + \frac{y - 124074.40615218398}{x}}{x} - 101.7851458539211}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -1.8e-5)
   (*
    (+ x -2.0)
    (+
     4.16438922228
     (/
      z
      (+
       47.066876606
       (*
        x
        (+
         313.399215894
         (* x (+ 263.505074721 (* x (+ x 43.3400022514))))))))))
   (if (<= x 60.0)
     (/
      (* (- x 2.0) (+ z (* x (+ y (* x 137.519416416)))))
      (+ 47.066876606 (* x 313.399215894)))
     (*
      (+ x -2.0)
      (+
       4.16438922228
       (/
        (-
         (/ (+ 3451.550173699799 (/ (- y 124074.40615218398) x)) x)
         101.7851458539211)
        x))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -1.8e-5) {
		tmp = (x + -2.0) * (4.16438922228 + (z / (47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514)))))))));
	} else if (x <= 60.0) {
		tmp = ((x - 2.0) * (z + (x * (y + (x * 137.519416416))))) / (47.066876606 + (x * 313.399215894));
	} else {
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + ((y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-1.8d-5)) then
        tmp = (x + (-2.0d0)) * (4.16438922228d0 + (z / (47.066876606d0 + (x * (313.399215894d0 + (x * (263.505074721d0 + (x * (x + 43.3400022514d0)))))))))
    else if (x <= 60.0d0) then
        tmp = ((x - 2.0d0) * (z + (x * (y + (x * 137.519416416d0))))) / (47.066876606d0 + (x * 313.399215894d0))
    else
        tmp = (x + (-2.0d0)) * (4.16438922228d0 + ((((3451.550173699799d0 + ((y - 124074.40615218398d0) / x)) / x) - 101.7851458539211d0) / x))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -1.8e-5) {
		tmp = (x + -2.0) * (4.16438922228 + (z / (47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514)))))))));
	} else if (x <= 60.0) {
		tmp = ((x - 2.0) * (z + (x * (y + (x * 137.519416416))))) / (47.066876606 + (x * 313.399215894));
	} else {
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + ((y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -1.8e-5:
		tmp = (x + -2.0) * (4.16438922228 + (z / (47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514)))))))))
	elif x <= 60.0:
		tmp = ((x - 2.0) * (z + (x * (y + (x * 137.519416416))))) / (47.066876606 + (x * 313.399215894))
	else:
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + ((y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -1.8e-5)
		tmp = Float64(Float64(x + -2.0) * Float64(4.16438922228 + Float64(z / Float64(47.066876606 + Float64(x * Float64(313.399215894 + Float64(x * Float64(263.505074721 + Float64(x * Float64(x + 43.3400022514))))))))));
	elseif (x <= 60.0)
		tmp = Float64(Float64(Float64(x - 2.0) * Float64(z + Float64(x * Float64(y + Float64(x * 137.519416416))))) / Float64(47.066876606 + Float64(x * 313.399215894)));
	else
		tmp = Float64(Float64(x + -2.0) * Float64(4.16438922228 + Float64(Float64(Float64(Float64(3451.550173699799 + Float64(Float64(y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -1.8e-5)
		tmp = (x + -2.0) * (4.16438922228 + (z / (47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514)))))))));
	elseif (x <= 60.0)
		tmp = ((x - 2.0) * (z + (x * (y + (x * 137.519416416))))) / (47.066876606 + (x * 313.399215894));
	else
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + ((y - 124074.40615218398) / x)) / x) - 101.7851458539211) / x));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -1.8e-5], N[(N[(x + -2.0), $MachinePrecision] * N[(4.16438922228 + N[(z / N[(47.066876606 + N[(x * N[(313.399215894 + N[(x * N[(263.505074721 + N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 60.0], N[(N[(N[(x - 2.0), $MachinePrecision] * N[(z + N[(x * N[(y + N[(x * 137.519416416), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(47.066876606 + N[(x * 313.399215894), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] * N[(4.16438922228 + N[(N[(N[(N[(3451.550173699799 + N[(N[(y - 124074.40615218398), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 101.7851458539211), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.8 \cdot 10^{-5}:\\
\;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\right)\\

\mathbf{elif}\;x \leq 60:\\
\;\;\;\;\frac{\left(x - 2\right) \cdot \left(z + x \cdot \left(y + x \cdot 137.519416416\right)\right)}{47.066876606 + x \cdot 313.399215894}\\

\mathbf{else}:\\
\;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{\frac{3451.550173699799 + \frac{y - 124074.40615218398}{x}}{x} - 101.7851458539211}{x}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.80000000000000005e-5

    1. Initial program 21.3%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*26.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg26.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval26.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define26.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define26.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define26.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define26.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define26.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define26.6%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define26.6%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified26.6%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 26.7%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}\right)} \]
    6. Taylor expanded in x around inf 92.5%

      \[\leadsto \left(x + -2\right) \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)} + \color{blue}{4.16438922228}\right) \]

    if -1.80000000000000005e-5 < x < 60

    1. Initial program 99.7%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 99.3%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(\color{blue}{137.519416416 \cdot x} + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    4. Step-by-step derivation
      1. *-commutative99.3%

        \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(\color{blue}{x \cdot 137.519416416} + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    5. Simplified99.3%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(\color{blue}{x \cdot 137.519416416} + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    6. Taylor expanded in x around 0 99.1%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{\left(\color{blue}{263.505074721 \cdot x} + 313.399215894\right) \cdot x + 47.066876606} \]
    7. Step-by-step derivation
      1. *-commutative99.1%

        \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{\left(\color{blue}{x \cdot 263.505074721} + 313.399215894\right) \cdot x + 47.066876606} \]
    8. Simplified99.1%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{\left(\color{blue}{x \cdot 263.505074721} + 313.399215894\right) \cdot x + 47.066876606} \]
    9. Taylor expanded in x around 0 98.7%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{\color{blue}{313.399215894 \cdot x} + 47.066876606} \]
    10. Step-by-step derivation
      1. *-commutative98.7%

        \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{\color{blue}{x \cdot 313.399215894} + 47.066876606} \]
    11. Simplified98.7%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{\color{blue}{x \cdot 313.399215894} + 47.066876606} \]

    if 60 < x

    1. Initial program 15.1%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*22.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg22.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval22.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified22.7%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around -inf 95.3%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 + -1 \cdot \frac{101.7851458539211 + -1 \cdot \frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}}{x}\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg95.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 + \color{blue}{\left(-\frac{101.7851458539211 + -1 \cdot \frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}}{x}\right)}\right) \]
      2. unsub-neg95.3%

        \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211 + -1 \cdot \frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}}{x}\right)} \]
      3. mul-1-neg95.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \color{blue}{\left(-\frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}\right)}}{x}\right) \]
      4. unsub-neg95.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{\color{blue}{101.7851458539211 - \frac{3451.550173699799 + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{x}}{x}}}{x}\right) \]
      5. mul-1-neg95.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 + \color{blue}{\left(-\frac{124074.40615218398 + -1 \cdot y}{x}\right)}}{x}}{x}\right) \]
      6. unsub-neg95.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{\color{blue}{3451.550173699799 - \frac{124074.40615218398 + -1 \cdot y}{x}}}{x}}{x}\right) \]
      7. mul-1-neg95.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 - \frac{124074.40615218398 + \color{blue}{\left(-y\right)}}{x}}{x}}{x}\right) \]
      8. unsub-neg95.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 - \frac{\color{blue}{124074.40615218398 - y}}{x}}{x}}{x}\right) \]
    7. Simplified95.3%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 - \frac{124074.40615218398 - y}{x}}{x}}{x}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification96.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.8 \cdot 10^{-5}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\right)\\ \mathbf{elif}\;x \leq 60:\\ \;\;\;\;\frac{\left(x - 2\right) \cdot \left(z + x \cdot \left(y + x \cdot 137.519416416\right)\right)}{47.066876606 + x \cdot 313.399215894}\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{\frac{3451.550173699799 + \frac{y - 124074.40615218398}{x}}{x} - 101.7851458539211}{x}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 89.7% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -102000:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 31:\\ \;\;\;\;z \cdot -0.0424927283095952 + x \cdot \left(0.0212463641547976 \cdot \left(z + y \cdot -2\right) - z \cdot -0.28294182010212804\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{\frac{3451.550173699799 + \frac{-124074.40615218398}{x}}{x} - 101.7851458539211}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -102000.0)
   (* x 4.16438922228)
   (if (<= x 31.0)
     (+
      (* z -0.0424927283095952)
      (*
       x
       (- (* 0.0212463641547976 (+ z (* y -2.0))) (* z -0.28294182010212804))))
     (*
      (+ x -2.0)
      (+
       4.16438922228
       (/
        (-
         (/ (+ 3451.550173699799 (/ -124074.40615218398 x)) x)
         101.7851458539211)
        x))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -102000.0) {
		tmp = x * 4.16438922228;
	} else if (x <= 31.0) {
		tmp = (z * -0.0424927283095952) + (x * ((0.0212463641547976 * (z + (y * -2.0))) - (z * -0.28294182010212804)));
	} else {
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + (-124074.40615218398 / x)) / x) - 101.7851458539211) / x));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-102000.0d0)) then
        tmp = x * 4.16438922228d0
    else if (x <= 31.0d0) then
        tmp = (z * (-0.0424927283095952d0)) + (x * ((0.0212463641547976d0 * (z + (y * (-2.0d0)))) - (z * (-0.28294182010212804d0))))
    else
        tmp = (x + (-2.0d0)) * (4.16438922228d0 + ((((3451.550173699799d0 + ((-124074.40615218398d0) / x)) / x) - 101.7851458539211d0) / x))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -102000.0) {
		tmp = x * 4.16438922228;
	} else if (x <= 31.0) {
		tmp = (z * -0.0424927283095952) + (x * ((0.0212463641547976 * (z + (y * -2.0))) - (z * -0.28294182010212804)));
	} else {
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + (-124074.40615218398 / x)) / x) - 101.7851458539211) / x));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -102000.0:
		tmp = x * 4.16438922228
	elif x <= 31.0:
		tmp = (z * -0.0424927283095952) + (x * ((0.0212463641547976 * (z + (y * -2.0))) - (z * -0.28294182010212804)))
	else:
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + (-124074.40615218398 / x)) / x) - 101.7851458539211) / x))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -102000.0)
		tmp = Float64(x * 4.16438922228);
	elseif (x <= 31.0)
		tmp = Float64(Float64(z * -0.0424927283095952) + Float64(x * Float64(Float64(0.0212463641547976 * Float64(z + Float64(y * -2.0))) - Float64(z * -0.28294182010212804))));
	else
		tmp = Float64(Float64(x + -2.0) * Float64(4.16438922228 + Float64(Float64(Float64(Float64(3451.550173699799 + Float64(-124074.40615218398 / x)) / x) - 101.7851458539211) / x)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -102000.0)
		tmp = x * 4.16438922228;
	elseif (x <= 31.0)
		tmp = (z * -0.0424927283095952) + (x * ((0.0212463641547976 * (z + (y * -2.0))) - (z * -0.28294182010212804)));
	else
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + (-124074.40615218398 / x)) / x) - 101.7851458539211) / x));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -102000.0], N[(x * 4.16438922228), $MachinePrecision], If[LessEqual[x, 31.0], N[(N[(z * -0.0424927283095952), $MachinePrecision] + N[(x * N[(N[(0.0212463641547976 * N[(z + N[(y * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * -0.28294182010212804), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] * N[(4.16438922228 + N[(N[(N[(N[(3451.550173699799 + N[(-124074.40615218398 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 101.7851458539211), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -102000:\\
\;\;\;\;x \cdot 4.16438922228\\

\mathbf{elif}\;x \leq 31:\\
\;\;\;\;z \cdot -0.0424927283095952 + x \cdot \left(0.0212463641547976 \cdot \left(z + y \cdot -2\right) - z \cdot -0.28294182010212804\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{\frac{3451.550173699799 + \frac{-124074.40615218398}{x}}{x} - 101.7851458539211}{x}\right)\\


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

    1. Initial program 13.0%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*19.0%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg19.0%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval19.0%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified19.0%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 93.8%

      \[\leadsto \color{blue}{4.16438922228 \cdot x} \]
    6. Step-by-step derivation
      1. *-commutative93.8%

        \[\leadsto \color{blue}{x \cdot 4.16438922228} \]
    7. Simplified93.8%

      \[\leadsto \color{blue}{x \cdot 4.16438922228} \]

    if -102000 < x < 31

    1. Initial program 99.7%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*99.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg99.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval99.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define99.6%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define99.6%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 90.2%

      \[\leadsto \color{blue}{-0.0424927283095952 \cdot z + x \cdot \left(0.0212463641547976 \cdot \left(z + -2 \cdot y\right) - -0.28294182010212804 \cdot z\right)} \]

    if 31 < x

    1. Initial program 15.1%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*22.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg22.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval22.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified22.7%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 18.3%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\frac{z + {x}^{2} \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}} \]
    6. Taylor expanded in x around -inf 90.5%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 + -1 \cdot \frac{101.7851458539211 + -1 \cdot \frac{3451.550173699799 - 124074.40615218398 \cdot \frac{1}{x}}{x}}{x}\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg90.5%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 + \color{blue}{\left(-\frac{101.7851458539211 + -1 \cdot \frac{3451.550173699799 - 124074.40615218398 \cdot \frac{1}{x}}{x}}{x}\right)}\right) \]
      2. unsub-neg90.5%

        \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211 + -1 \cdot \frac{3451.550173699799 - 124074.40615218398 \cdot \frac{1}{x}}{x}}{x}\right)} \]
      3. mul-1-neg90.5%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \color{blue}{\left(-\frac{3451.550173699799 - 124074.40615218398 \cdot \frac{1}{x}}{x}\right)}}{x}\right) \]
      4. unsub-neg90.5%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{\color{blue}{101.7851458539211 - \frac{3451.550173699799 - 124074.40615218398 \cdot \frac{1}{x}}{x}}}{x}\right) \]
      5. sub-neg90.5%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{\color{blue}{3451.550173699799 + \left(-124074.40615218398 \cdot \frac{1}{x}\right)}}{x}}{x}\right) \]
      6. associate-*r/90.5%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 + \left(-\color{blue}{\frac{124074.40615218398 \cdot 1}{x}}\right)}{x}}{x}\right) \]
      7. metadata-eval90.5%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 + \left(-\frac{\color{blue}{124074.40615218398}}{x}\right)}{x}}{x}\right) \]
      8. distribute-neg-frac90.5%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 + \color{blue}{\frac{-124074.40615218398}{x}}}{x}}{x}\right) \]
      9. metadata-eval90.5%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 + \frac{\color{blue}{-124074.40615218398}}{x}}{x}}{x}\right) \]
    8. Simplified90.5%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 + \frac{-124074.40615218398}{x}}{x}}{x}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification91.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -102000:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 31:\\ \;\;\;\;z \cdot -0.0424927283095952 + x \cdot \left(0.0212463641547976 \cdot \left(z + y \cdot -2\right) - z \cdot -0.28294182010212804\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{\frac{3451.550173699799 + \frac{-124074.40615218398}{x}}{x} - 101.7851458539211}{x}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 89.7% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -16000:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 105:\\ \;\;\;\;\left(x + -2\right) \cdot \left(z \cdot 0.0212463641547976 - x \cdot \left(z \cdot 0.14147091005106402 - y \cdot 0.0212463641547976\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{\frac{3451.550173699799 + \frac{-124074.40615218398}{x}}{x} - 101.7851458539211}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -16000.0)
   (* x 4.16438922228)
   (if (<= x 105.0)
     (*
      (+ x -2.0)
      (-
       (* z 0.0212463641547976)
       (* x (- (* z 0.14147091005106402) (* y 0.0212463641547976)))))
     (*
      (+ x -2.0)
      (+
       4.16438922228
       (/
        (-
         (/ (+ 3451.550173699799 (/ -124074.40615218398 x)) x)
         101.7851458539211)
        x))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -16000.0) {
		tmp = x * 4.16438922228;
	} else if (x <= 105.0) {
		tmp = (x + -2.0) * ((z * 0.0212463641547976) - (x * ((z * 0.14147091005106402) - (y * 0.0212463641547976))));
	} else {
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + (-124074.40615218398 / x)) / x) - 101.7851458539211) / x));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-16000.0d0)) then
        tmp = x * 4.16438922228d0
    else if (x <= 105.0d0) then
        tmp = (x + (-2.0d0)) * ((z * 0.0212463641547976d0) - (x * ((z * 0.14147091005106402d0) - (y * 0.0212463641547976d0))))
    else
        tmp = (x + (-2.0d0)) * (4.16438922228d0 + ((((3451.550173699799d0 + ((-124074.40615218398d0) / x)) / x) - 101.7851458539211d0) / x))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -16000.0) {
		tmp = x * 4.16438922228;
	} else if (x <= 105.0) {
		tmp = (x + -2.0) * ((z * 0.0212463641547976) - (x * ((z * 0.14147091005106402) - (y * 0.0212463641547976))));
	} else {
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + (-124074.40615218398 / x)) / x) - 101.7851458539211) / x));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -16000.0:
		tmp = x * 4.16438922228
	elif x <= 105.0:
		tmp = (x + -2.0) * ((z * 0.0212463641547976) - (x * ((z * 0.14147091005106402) - (y * 0.0212463641547976))))
	else:
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + (-124074.40615218398 / x)) / x) - 101.7851458539211) / x))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -16000.0)
		tmp = Float64(x * 4.16438922228);
	elseif (x <= 105.0)
		tmp = Float64(Float64(x + -2.0) * Float64(Float64(z * 0.0212463641547976) - Float64(x * Float64(Float64(z * 0.14147091005106402) - Float64(y * 0.0212463641547976)))));
	else
		tmp = Float64(Float64(x + -2.0) * Float64(4.16438922228 + Float64(Float64(Float64(Float64(3451.550173699799 + Float64(-124074.40615218398 / x)) / x) - 101.7851458539211) / x)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -16000.0)
		tmp = x * 4.16438922228;
	elseif (x <= 105.0)
		tmp = (x + -2.0) * ((z * 0.0212463641547976) - (x * ((z * 0.14147091005106402) - (y * 0.0212463641547976))));
	else
		tmp = (x + -2.0) * (4.16438922228 + ((((3451.550173699799 + (-124074.40615218398 / x)) / x) - 101.7851458539211) / x));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -16000.0], N[(x * 4.16438922228), $MachinePrecision], If[LessEqual[x, 105.0], N[(N[(x + -2.0), $MachinePrecision] * N[(N[(z * 0.0212463641547976), $MachinePrecision] - N[(x * N[(N[(z * 0.14147091005106402), $MachinePrecision] - N[(y * 0.0212463641547976), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] * N[(4.16438922228 + N[(N[(N[(N[(3451.550173699799 + N[(-124074.40615218398 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 101.7851458539211), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -16000:\\
\;\;\;\;x \cdot 4.16438922228\\

\mathbf{elif}\;x \leq 105:\\
\;\;\;\;\left(x + -2\right) \cdot \left(z \cdot 0.0212463641547976 - x \cdot \left(z \cdot 0.14147091005106402 - y \cdot 0.0212463641547976\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{\frac{3451.550173699799 + \frac{-124074.40615218398}{x}}{x} - 101.7851458539211}{x}\right)\\


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

    1. Initial program 13.0%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*19.0%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg19.0%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval19.0%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified19.0%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 93.8%

      \[\leadsto \color{blue}{4.16438922228 \cdot x} \]
    6. Step-by-step derivation
      1. *-commutative93.8%

        \[\leadsto \color{blue}{x \cdot 4.16438922228} \]
    7. Simplified93.8%

      \[\leadsto \color{blue}{x \cdot 4.16438922228} \]

    if -16000 < x < 105

    1. Initial program 99.7%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*99.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg99.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval99.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define99.6%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define99.6%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 90.2%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(0.0212463641547976 \cdot z + x \cdot \left(0.0212463641547976 \cdot y - 0.14147091005106402 \cdot z\right)\right)} \]

    if 105 < x

    1. Initial program 15.1%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*22.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg22.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval22.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified22.7%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 18.3%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\frac{z + {x}^{2} \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + 4.16438922228 \cdot x\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right)\right)}} \]
    6. Taylor expanded in x around -inf 90.5%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 + -1 \cdot \frac{101.7851458539211 + -1 \cdot \frac{3451.550173699799 - 124074.40615218398 \cdot \frac{1}{x}}{x}}{x}\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg90.5%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 + \color{blue}{\left(-\frac{101.7851458539211 + -1 \cdot \frac{3451.550173699799 - 124074.40615218398 \cdot \frac{1}{x}}{x}}{x}\right)}\right) \]
      2. unsub-neg90.5%

        \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211 + -1 \cdot \frac{3451.550173699799 - 124074.40615218398 \cdot \frac{1}{x}}{x}}{x}\right)} \]
      3. mul-1-neg90.5%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \color{blue}{\left(-\frac{3451.550173699799 - 124074.40615218398 \cdot \frac{1}{x}}{x}\right)}}{x}\right) \]
      4. unsub-neg90.5%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{\color{blue}{101.7851458539211 - \frac{3451.550173699799 - 124074.40615218398 \cdot \frac{1}{x}}{x}}}{x}\right) \]
      5. sub-neg90.5%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{\color{blue}{3451.550173699799 + \left(-124074.40615218398 \cdot \frac{1}{x}\right)}}{x}}{x}\right) \]
      6. associate-*r/90.5%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 + \left(-\color{blue}{\frac{124074.40615218398 \cdot 1}{x}}\right)}{x}}{x}\right) \]
      7. metadata-eval90.5%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 + \left(-\frac{\color{blue}{124074.40615218398}}{x}\right)}{x}}{x}\right) \]
      8. distribute-neg-frac90.5%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 + \color{blue}{\frac{-124074.40615218398}{x}}}{x}}{x}\right) \]
      9. metadata-eval90.5%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 + \frac{\color{blue}{-124074.40615218398}}{x}}{x}}{x}\right) \]
    8. Simplified90.5%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211 - \frac{3451.550173699799 + \frac{-124074.40615218398}{x}}{x}}{x}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification91.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -16000:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 105:\\ \;\;\;\;\left(x + -2\right) \cdot \left(z \cdot 0.0212463641547976 - x \cdot \left(z \cdot 0.14147091005106402 - y \cdot 0.0212463641547976\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{\frac{3451.550173699799 + \frac{-124074.40615218398}{x}}{x} - 101.7851458539211}{x}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 89.7% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -6200:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 2.1:\\ \;\;\;\;\left(x + -2\right) \cdot \left(z \cdot 0.0212463641547976 - x \cdot \left(z \cdot 0.14147091005106402 - y \cdot 0.0212463641547976\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(\left(5.16438922228 + \frac{\frac{3451.550173699799}{x} + -101.7851458539211}{x}\right) + -1\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -6200.0)
   (* x 4.16438922228)
   (if (<= x 2.1)
     (*
      (+ x -2.0)
      (-
       (* z 0.0212463641547976)
       (* x (- (* z 0.14147091005106402) (* y 0.0212463641547976)))))
     (*
      (+ x -2.0)
      (+
       (+ 5.16438922228 (/ (+ (/ 3451.550173699799 x) -101.7851458539211) x))
       -1.0)))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -6200.0) {
		tmp = x * 4.16438922228;
	} else if (x <= 2.1) {
		tmp = (x + -2.0) * ((z * 0.0212463641547976) - (x * ((z * 0.14147091005106402) - (y * 0.0212463641547976))));
	} else {
		tmp = (x + -2.0) * ((5.16438922228 + (((3451.550173699799 / x) + -101.7851458539211) / x)) + -1.0);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-6200.0d0)) then
        tmp = x * 4.16438922228d0
    else if (x <= 2.1d0) then
        tmp = (x + (-2.0d0)) * ((z * 0.0212463641547976d0) - (x * ((z * 0.14147091005106402d0) - (y * 0.0212463641547976d0))))
    else
        tmp = (x + (-2.0d0)) * ((5.16438922228d0 + (((3451.550173699799d0 / x) + (-101.7851458539211d0)) / x)) + (-1.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -6200.0) {
		tmp = x * 4.16438922228;
	} else if (x <= 2.1) {
		tmp = (x + -2.0) * ((z * 0.0212463641547976) - (x * ((z * 0.14147091005106402) - (y * 0.0212463641547976))));
	} else {
		tmp = (x + -2.0) * ((5.16438922228 + (((3451.550173699799 / x) + -101.7851458539211) / x)) + -1.0);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -6200.0:
		tmp = x * 4.16438922228
	elif x <= 2.1:
		tmp = (x + -2.0) * ((z * 0.0212463641547976) - (x * ((z * 0.14147091005106402) - (y * 0.0212463641547976))))
	else:
		tmp = (x + -2.0) * ((5.16438922228 + (((3451.550173699799 / x) + -101.7851458539211) / x)) + -1.0)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -6200.0)
		tmp = Float64(x * 4.16438922228);
	elseif (x <= 2.1)
		tmp = Float64(Float64(x + -2.0) * Float64(Float64(z * 0.0212463641547976) - Float64(x * Float64(Float64(z * 0.14147091005106402) - Float64(y * 0.0212463641547976)))));
	else
		tmp = Float64(Float64(x + -2.0) * Float64(Float64(5.16438922228 + Float64(Float64(Float64(3451.550173699799 / x) + -101.7851458539211) / x)) + -1.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -6200.0)
		tmp = x * 4.16438922228;
	elseif (x <= 2.1)
		tmp = (x + -2.0) * ((z * 0.0212463641547976) - (x * ((z * 0.14147091005106402) - (y * 0.0212463641547976))));
	else
		tmp = (x + -2.0) * ((5.16438922228 + (((3451.550173699799 / x) + -101.7851458539211) / x)) + -1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -6200.0], N[(x * 4.16438922228), $MachinePrecision], If[LessEqual[x, 2.1], N[(N[(x + -2.0), $MachinePrecision] * N[(N[(z * 0.0212463641547976), $MachinePrecision] - N[(x * N[(N[(z * 0.14147091005106402), $MachinePrecision] - N[(y * 0.0212463641547976), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] * N[(N[(5.16438922228 + N[(N[(N[(3451.550173699799 / x), $MachinePrecision] + -101.7851458539211), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6200:\\
\;\;\;\;x \cdot 4.16438922228\\

\mathbf{elif}\;x \leq 2.1:\\
\;\;\;\;\left(x + -2\right) \cdot \left(z \cdot 0.0212463641547976 - x \cdot \left(z \cdot 0.14147091005106402 - y \cdot 0.0212463641547976\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x + -2\right) \cdot \left(\left(5.16438922228 + \frac{\frac{3451.550173699799}{x} + -101.7851458539211}{x}\right) + -1\right)\\


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

    1. Initial program 13.0%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*19.0%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg19.0%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval19.0%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified19.0%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 93.8%

      \[\leadsto \color{blue}{4.16438922228 \cdot x} \]
    6. Step-by-step derivation
      1. *-commutative93.8%

        \[\leadsto \color{blue}{x \cdot 4.16438922228} \]
    7. Simplified93.8%

      \[\leadsto \color{blue}{x \cdot 4.16438922228} \]

    if -6200 < x < 2.10000000000000009

    1. Initial program 99.7%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*99.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg99.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval99.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define99.6%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define99.6%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 90.2%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(0.0212463641547976 \cdot z + x \cdot \left(0.0212463641547976 \cdot y - 0.14147091005106402 \cdot z\right)\right)} \]

    if 2.10000000000000009 < x

    1. Initial program 15.1%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*22.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg22.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval22.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified22.7%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around -inf 90.4%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 + -1 \cdot \frac{101.7851458539211 - 3451.550173699799 \cdot \frac{1}{x}}{x}\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 + \color{blue}{\left(-\frac{101.7851458539211 - 3451.550173699799 \cdot \frac{1}{x}}{x}\right)}\right) \]
      2. unsub-neg90.4%

        \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211 - 3451.550173699799 \cdot \frac{1}{x}}{x}\right)} \]
      3. sub-neg90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{\color{blue}{101.7851458539211 + \left(-3451.550173699799 \cdot \frac{1}{x}\right)}}{x}\right) \]
      4. associate-*r/90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \left(-\color{blue}{\frac{3451.550173699799 \cdot 1}{x}}\right)}{x}\right) \]
      5. metadata-eval90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \left(-\frac{\color{blue}{3451.550173699799}}{x}\right)}{x}\right) \]
      6. distribute-neg-frac90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \color{blue}{\frac{-3451.550173699799}{x}}}{x}\right) \]
      7. metadata-eval90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \frac{\color{blue}{-3451.550173699799}}{x}}{x}\right) \]
    7. Simplified90.4%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211 + \frac{-3451.550173699799}{x}}{x}\right)} \]
    8. Step-by-step derivation
      1. expm1-log1p-u90.4%

        \[\leadsto \left(x + -2\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(4.16438922228 - \frac{101.7851458539211 + \frac{-3451.550173699799}{x}}{x}\right)\right)} \]
      2. +-commutative90.4%

        \[\leadsto \left(x + -2\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(4.16438922228 - \frac{\color{blue}{\frac{-3451.550173699799}{x} + 101.7851458539211}}{x}\right)\right) \]
    9. Applied egg-rr90.4%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(4.16438922228 - \frac{\frac{-3451.550173699799}{x} + 101.7851458539211}{x}\right)\right)} \]
    10. Step-by-step derivation
      1. expm1-undefine90.4%

        \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(4.16438922228 - \frac{\frac{-3451.550173699799}{x} + 101.7851458539211}{x}\right)} - 1\right)} \]
      2. sub-neg90.4%

        \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(4.16438922228 - \frac{\frac{-3451.550173699799}{x} + 101.7851458539211}{x}\right)} + \left(-1\right)\right)} \]
      3. log1p-undefine90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(e^{\color{blue}{\log \left(1 + \left(4.16438922228 - \frac{\frac{-3451.550173699799}{x} + 101.7851458539211}{x}\right)\right)}} + \left(-1\right)\right) \]
      4. rem-exp-log90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\color{blue}{\left(1 + \left(4.16438922228 - \frac{\frac{-3451.550173699799}{x} + 101.7851458539211}{x}\right)\right)} + \left(-1\right)\right) \]
      5. sub-neg90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\left(1 + \color{blue}{\left(4.16438922228 + \left(-\frac{\frac{-3451.550173699799}{x} + 101.7851458539211}{x}\right)\right)}\right) + \left(-1\right)\right) \]
      6. associate-+r+90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\color{blue}{\left(\left(1 + 4.16438922228\right) + \left(-\frac{\frac{-3451.550173699799}{x} + 101.7851458539211}{x}\right)\right)} + \left(-1\right)\right) \]
      7. metadata-eval90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\left(\color{blue}{5.16438922228} + \left(-\frac{\frac{-3451.550173699799}{x} + 101.7851458539211}{x}\right)\right) + \left(-1\right)\right) \]
      8. distribute-neg-frac90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\left(5.16438922228 + \color{blue}{\frac{-\left(\frac{-3451.550173699799}{x} + 101.7851458539211\right)}{x}}\right) + \left(-1\right)\right) \]
      9. distribute-neg-in90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\left(5.16438922228 + \frac{\color{blue}{\left(-\frac{-3451.550173699799}{x}\right) + \left(-101.7851458539211\right)}}{x}\right) + \left(-1\right)\right) \]
      10. metadata-eval90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\left(5.16438922228 + \frac{\left(-\frac{\color{blue}{-3451.550173699799 \cdot 1}}{x}\right) + \left(-101.7851458539211\right)}{x}\right) + \left(-1\right)\right) \]
      11. associate-*r/90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\left(5.16438922228 + \frac{\left(-\color{blue}{-3451.550173699799 \cdot \frac{1}{x}}\right) + \left(-101.7851458539211\right)}{x}\right) + \left(-1\right)\right) \]
      12. distribute-lft-neg-in90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\left(5.16438922228 + \frac{\color{blue}{\left(--3451.550173699799\right) \cdot \frac{1}{x}} + \left(-101.7851458539211\right)}{x}\right) + \left(-1\right)\right) \]
      13. metadata-eval90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\left(5.16438922228 + \frac{\color{blue}{3451.550173699799} \cdot \frac{1}{x} + \left(-101.7851458539211\right)}{x}\right) + \left(-1\right)\right) \]
      14. associate-*r/90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\left(5.16438922228 + \frac{\color{blue}{\frac{3451.550173699799 \cdot 1}{x}} + \left(-101.7851458539211\right)}{x}\right) + \left(-1\right)\right) \]
      15. metadata-eval90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\left(5.16438922228 + \frac{\frac{\color{blue}{3451.550173699799}}{x} + \left(-101.7851458539211\right)}{x}\right) + \left(-1\right)\right) \]
      16. metadata-eval90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\left(5.16438922228 + \frac{\frac{3451.550173699799}{x} + \color{blue}{-101.7851458539211}}{x}\right) + \left(-1\right)\right) \]
      17. metadata-eval90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\left(5.16438922228 + \frac{\frac{3451.550173699799}{x} + -101.7851458539211}{x}\right) + \color{blue}{-1}\right) \]
    11. Simplified90.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6200:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 2.1:\\ \;\;\;\;\left(x + -2\right) \cdot \left(z \cdot 0.0212463641547976 - x \cdot \left(z \cdot 0.14147091005106402 - y \cdot 0.0212463641547976\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(\left(5.16438922228 + \frac{\frac{3451.550173699799}{x} + -101.7851458539211}{x}\right) + -1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 89.5% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4500000:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 1.3:\\ \;\;\;\;z \cdot -0.0424927283095952 - x \cdot \left(z \cdot -0.28294182010212804 - y \cdot -0.0424927283095952\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(\left(5.16438922228 + \frac{\frac{3451.550173699799}{x} + -101.7851458539211}{x}\right) + -1\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -4500000.0)
   (* x 4.16438922228)
   (if (<= x 1.3)
     (-
      (* z -0.0424927283095952)
      (* x (- (* z -0.28294182010212804) (* y -0.0424927283095952))))
     (*
      (+ x -2.0)
      (+
       (+ 5.16438922228 (/ (+ (/ 3451.550173699799 x) -101.7851458539211) x))
       -1.0)))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -4500000.0) {
		tmp = x * 4.16438922228;
	} else if (x <= 1.3) {
		tmp = (z * -0.0424927283095952) - (x * ((z * -0.28294182010212804) - (y * -0.0424927283095952)));
	} else {
		tmp = (x + -2.0) * ((5.16438922228 + (((3451.550173699799 / x) + -101.7851458539211) / x)) + -1.0);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-4500000.0d0)) then
        tmp = x * 4.16438922228d0
    else if (x <= 1.3d0) then
        tmp = (z * (-0.0424927283095952d0)) - (x * ((z * (-0.28294182010212804d0)) - (y * (-0.0424927283095952d0))))
    else
        tmp = (x + (-2.0d0)) * ((5.16438922228d0 + (((3451.550173699799d0 / x) + (-101.7851458539211d0)) / x)) + (-1.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -4500000.0) {
		tmp = x * 4.16438922228;
	} else if (x <= 1.3) {
		tmp = (z * -0.0424927283095952) - (x * ((z * -0.28294182010212804) - (y * -0.0424927283095952)));
	} else {
		tmp = (x + -2.0) * ((5.16438922228 + (((3451.550173699799 / x) + -101.7851458539211) / x)) + -1.0);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -4500000.0:
		tmp = x * 4.16438922228
	elif x <= 1.3:
		tmp = (z * -0.0424927283095952) - (x * ((z * -0.28294182010212804) - (y * -0.0424927283095952)))
	else:
		tmp = (x + -2.0) * ((5.16438922228 + (((3451.550173699799 / x) + -101.7851458539211) / x)) + -1.0)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -4500000.0)
		tmp = Float64(x * 4.16438922228);
	elseif (x <= 1.3)
		tmp = Float64(Float64(z * -0.0424927283095952) - Float64(x * Float64(Float64(z * -0.28294182010212804) - Float64(y * -0.0424927283095952))));
	else
		tmp = Float64(Float64(x + -2.0) * Float64(Float64(5.16438922228 + Float64(Float64(Float64(3451.550173699799 / x) + -101.7851458539211) / x)) + -1.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -4500000.0)
		tmp = x * 4.16438922228;
	elseif (x <= 1.3)
		tmp = (z * -0.0424927283095952) - (x * ((z * -0.28294182010212804) - (y * -0.0424927283095952)));
	else
		tmp = (x + -2.0) * ((5.16438922228 + (((3451.550173699799 / x) + -101.7851458539211) / x)) + -1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -4500000.0], N[(x * 4.16438922228), $MachinePrecision], If[LessEqual[x, 1.3], N[(N[(z * -0.0424927283095952), $MachinePrecision] - N[(x * N[(N[(z * -0.28294182010212804), $MachinePrecision] - N[(y * -0.0424927283095952), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] * N[(N[(5.16438922228 + N[(N[(N[(3451.550173699799 / x), $MachinePrecision] + -101.7851458539211), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4500000:\\
\;\;\;\;x \cdot 4.16438922228\\

\mathbf{elif}\;x \leq 1.3:\\
\;\;\;\;z \cdot -0.0424927283095952 - x \cdot \left(z \cdot -0.28294182010212804 - y \cdot -0.0424927283095952\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x + -2\right) \cdot \left(\left(5.16438922228 + \frac{\frac{3451.550173699799}{x} + -101.7851458539211}{x}\right) + -1\right)\\


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

    1. Initial program 13.0%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*19.0%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg19.0%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval19.0%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified19.0%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 93.8%

      \[\leadsto \color{blue}{4.16438922228 \cdot x} \]
    6. Step-by-step derivation
      1. *-commutative93.8%

        \[\leadsto \color{blue}{x \cdot 4.16438922228} \]
    7. Simplified93.8%

      \[\leadsto \color{blue}{x \cdot 4.16438922228} \]

    if -4.5e6 < x < 1.30000000000000004

    1. Initial program 99.7%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*99.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg99.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval99.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define99.6%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define99.6%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 90.2%

      \[\leadsto \color{blue}{-0.0424927283095952 \cdot z + x \cdot \left(0.0212463641547976 \cdot \left(z + -2 \cdot y\right) - -0.28294182010212804 \cdot z\right)} \]
    6. Taylor expanded in z around 0 89.7%

      \[\leadsto -0.0424927283095952 \cdot z + x \cdot \left(\color{blue}{-0.0424927283095952 \cdot y} - -0.28294182010212804 \cdot z\right) \]

    if 1.30000000000000004 < x

    1. Initial program 15.1%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*22.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg22.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval22.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified22.7%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around -inf 90.4%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 + -1 \cdot \frac{101.7851458539211 - 3451.550173699799 \cdot \frac{1}{x}}{x}\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 + \color{blue}{\left(-\frac{101.7851458539211 - 3451.550173699799 \cdot \frac{1}{x}}{x}\right)}\right) \]
      2. unsub-neg90.4%

        \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211 - 3451.550173699799 \cdot \frac{1}{x}}{x}\right)} \]
      3. sub-neg90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{\color{blue}{101.7851458539211 + \left(-3451.550173699799 \cdot \frac{1}{x}\right)}}{x}\right) \]
      4. associate-*r/90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \left(-\color{blue}{\frac{3451.550173699799 \cdot 1}{x}}\right)}{x}\right) \]
      5. metadata-eval90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \left(-\frac{\color{blue}{3451.550173699799}}{x}\right)}{x}\right) \]
      6. distribute-neg-frac90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \color{blue}{\frac{-3451.550173699799}{x}}}{x}\right) \]
      7. metadata-eval90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \frac{\color{blue}{-3451.550173699799}}{x}}{x}\right) \]
    7. Simplified90.4%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211 + \frac{-3451.550173699799}{x}}{x}\right)} \]
    8. Step-by-step derivation
      1. expm1-log1p-u90.4%

        \[\leadsto \left(x + -2\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(4.16438922228 - \frac{101.7851458539211 + \frac{-3451.550173699799}{x}}{x}\right)\right)} \]
      2. +-commutative90.4%

        \[\leadsto \left(x + -2\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(4.16438922228 - \frac{\color{blue}{\frac{-3451.550173699799}{x} + 101.7851458539211}}{x}\right)\right) \]
    9. Applied egg-rr90.4%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(4.16438922228 - \frac{\frac{-3451.550173699799}{x} + 101.7851458539211}{x}\right)\right)} \]
    10. Step-by-step derivation
      1. expm1-undefine90.4%

        \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(4.16438922228 - \frac{\frac{-3451.550173699799}{x} + 101.7851458539211}{x}\right)} - 1\right)} \]
      2. sub-neg90.4%

        \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(4.16438922228 - \frac{\frac{-3451.550173699799}{x} + 101.7851458539211}{x}\right)} + \left(-1\right)\right)} \]
      3. log1p-undefine90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(e^{\color{blue}{\log \left(1 + \left(4.16438922228 - \frac{\frac{-3451.550173699799}{x} + 101.7851458539211}{x}\right)\right)}} + \left(-1\right)\right) \]
      4. rem-exp-log90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\color{blue}{\left(1 + \left(4.16438922228 - \frac{\frac{-3451.550173699799}{x} + 101.7851458539211}{x}\right)\right)} + \left(-1\right)\right) \]
      5. sub-neg90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\left(1 + \color{blue}{\left(4.16438922228 + \left(-\frac{\frac{-3451.550173699799}{x} + 101.7851458539211}{x}\right)\right)}\right) + \left(-1\right)\right) \]
      6. associate-+r+90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\color{blue}{\left(\left(1 + 4.16438922228\right) + \left(-\frac{\frac{-3451.550173699799}{x} + 101.7851458539211}{x}\right)\right)} + \left(-1\right)\right) \]
      7. metadata-eval90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\left(\color{blue}{5.16438922228} + \left(-\frac{\frac{-3451.550173699799}{x} + 101.7851458539211}{x}\right)\right) + \left(-1\right)\right) \]
      8. distribute-neg-frac90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\left(5.16438922228 + \color{blue}{\frac{-\left(\frac{-3451.550173699799}{x} + 101.7851458539211\right)}{x}}\right) + \left(-1\right)\right) \]
      9. distribute-neg-in90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\left(5.16438922228 + \frac{\color{blue}{\left(-\frac{-3451.550173699799}{x}\right) + \left(-101.7851458539211\right)}}{x}\right) + \left(-1\right)\right) \]
      10. metadata-eval90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\left(5.16438922228 + \frac{\left(-\frac{\color{blue}{-3451.550173699799 \cdot 1}}{x}\right) + \left(-101.7851458539211\right)}{x}\right) + \left(-1\right)\right) \]
      11. associate-*r/90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\left(5.16438922228 + \frac{\left(-\color{blue}{-3451.550173699799 \cdot \frac{1}{x}}\right) + \left(-101.7851458539211\right)}{x}\right) + \left(-1\right)\right) \]
      12. distribute-lft-neg-in90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\left(5.16438922228 + \frac{\color{blue}{\left(--3451.550173699799\right) \cdot \frac{1}{x}} + \left(-101.7851458539211\right)}{x}\right) + \left(-1\right)\right) \]
      13. metadata-eval90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\left(5.16438922228 + \frac{\color{blue}{3451.550173699799} \cdot \frac{1}{x} + \left(-101.7851458539211\right)}{x}\right) + \left(-1\right)\right) \]
      14. associate-*r/90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\left(5.16438922228 + \frac{\color{blue}{\frac{3451.550173699799 \cdot 1}{x}} + \left(-101.7851458539211\right)}{x}\right) + \left(-1\right)\right) \]
      15. metadata-eval90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\left(5.16438922228 + \frac{\frac{\color{blue}{3451.550173699799}}{x} + \left(-101.7851458539211\right)}{x}\right) + \left(-1\right)\right) \]
      16. metadata-eval90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\left(5.16438922228 + \frac{\frac{3451.550173699799}{x} + \color{blue}{-101.7851458539211}}{x}\right) + \left(-1\right)\right) \]
      17. metadata-eval90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(\left(5.16438922228 + \frac{\frac{3451.550173699799}{x} + -101.7851458539211}{x}\right) + \color{blue}{-1}\right) \]
    11. Simplified90.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4500000:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 1.3:\\ \;\;\;\;z \cdot -0.0424927283095952 - x \cdot \left(z \cdot -0.28294182010212804 - y \cdot -0.0424927283095952\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(\left(5.16438922228 + \frac{\frac{3451.550173699799}{x} + -101.7851458539211}{x}\right) + -1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 89.5% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1350000:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 25:\\ \;\;\;\;z \cdot -0.0424927283095952 - x \cdot \left(z \cdot -0.28294182010212804 - y \cdot -0.0424927283095952\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \frac{-3451.550173699799}{x}}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -1350000.0)
   (* x 4.16438922228)
   (if (<= x 25.0)
     (-
      (* z -0.0424927283095952)
      (* x (- (* z -0.28294182010212804) (* y -0.0424927283095952))))
     (*
      (+ x -2.0)
      (-
       4.16438922228
       (/ (+ 101.7851458539211 (/ -3451.550173699799 x)) x))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -1350000.0) {
		tmp = x * 4.16438922228;
	} else if (x <= 25.0) {
		tmp = (z * -0.0424927283095952) - (x * ((z * -0.28294182010212804) - (y * -0.0424927283095952)));
	} else {
		tmp = (x + -2.0) * (4.16438922228 - ((101.7851458539211 + (-3451.550173699799 / x)) / x));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-1350000.0d0)) then
        tmp = x * 4.16438922228d0
    else if (x <= 25.0d0) then
        tmp = (z * (-0.0424927283095952d0)) - (x * ((z * (-0.28294182010212804d0)) - (y * (-0.0424927283095952d0))))
    else
        tmp = (x + (-2.0d0)) * (4.16438922228d0 - ((101.7851458539211d0 + ((-3451.550173699799d0) / x)) / x))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -1350000.0) {
		tmp = x * 4.16438922228;
	} else if (x <= 25.0) {
		tmp = (z * -0.0424927283095952) - (x * ((z * -0.28294182010212804) - (y * -0.0424927283095952)));
	} else {
		tmp = (x + -2.0) * (4.16438922228 - ((101.7851458539211 + (-3451.550173699799 / x)) / x));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -1350000.0:
		tmp = x * 4.16438922228
	elif x <= 25.0:
		tmp = (z * -0.0424927283095952) - (x * ((z * -0.28294182010212804) - (y * -0.0424927283095952)))
	else:
		tmp = (x + -2.0) * (4.16438922228 - ((101.7851458539211 + (-3451.550173699799 / x)) / x))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -1350000.0)
		tmp = Float64(x * 4.16438922228);
	elseif (x <= 25.0)
		tmp = Float64(Float64(z * -0.0424927283095952) - Float64(x * Float64(Float64(z * -0.28294182010212804) - Float64(y * -0.0424927283095952))));
	else
		tmp = Float64(Float64(x + -2.0) * Float64(4.16438922228 - Float64(Float64(101.7851458539211 + Float64(-3451.550173699799 / x)) / x)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -1350000.0)
		tmp = x * 4.16438922228;
	elseif (x <= 25.0)
		tmp = (z * -0.0424927283095952) - (x * ((z * -0.28294182010212804) - (y * -0.0424927283095952)));
	else
		tmp = (x + -2.0) * (4.16438922228 - ((101.7851458539211 + (-3451.550173699799 / x)) / x));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -1350000.0], N[(x * 4.16438922228), $MachinePrecision], If[LessEqual[x, 25.0], N[(N[(z * -0.0424927283095952), $MachinePrecision] - N[(x * N[(N[(z * -0.28294182010212804), $MachinePrecision] - N[(y * -0.0424927283095952), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] * N[(4.16438922228 - N[(N[(101.7851458539211 + N[(-3451.550173699799 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1350000:\\
\;\;\;\;x \cdot 4.16438922228\\

\mathbf{elif}\;x \leq 25:\\
\;\;\;\;z \cdot -0.0424927283095952 - x \cdot \left(z \cdot -0.28294182010212804 - y \cdot -0.0424927283095952\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \frac{-3451.550173699799}{x}}{x}\right)\\


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

    1. Initial program 13.0%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*19.0%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg19.0%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval19.0%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified19.0%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 93.8%

      \[\leadsto \color{blue}{4.16438922228 \cdot x} \]
    6. Step-by-step derivation
      1. *-commutative93.8%

        \[\leadsto \color{blue}{x \cdot 4.16438922228} \]
    7. Simplified93.8%

      \[\leadsto \color{blue}{x \cdot 4.16438922228} \]

    if -1.35e6 < x < 25

    1. Initial program 99.7%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*99.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg99.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval99.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define99.6%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define99.6%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 90.2%

      \[\leadsto \color{blue}{-0.0424927283095952 \cdot z + x \cdot \left(0.0212463641547976 \cdot \left(z + -2 \cdot y\right) - -0.28294182010212804 \cdot z\right)} \]
    6. Taylor expanded in z around 0 89.7%

      \[\leadsto -0.0424927283095952 \cdot z + x \cdot \left(\color{blue}{-0.0424927283095952 \cdot y} - -0.28294182010212804 \cdot z\right) \]

    if 25 < x

    1. Initial program 15.1%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*22.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg22.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval22.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified22.7%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around -inf 90.4%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 + -1 \cdot \frac{101.7851458539211 - 3451.550173699799 \cdot \frac{1}{x}}{x}\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 + \color{blue}{\left(-\frac{101.7851458539211 - 3451.550173699799 \cdot \frac{1}{x}}{x}\right)}\right) \]
      2. unsub-neg90.4%

        \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211 - 3451.550173699799 \cdot \frac{1}{x}}{x}\right)} \]
      3. sub-neg90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{\color{blue}{101.7851458539211 + \left(-3451.550173699799 \cdot \frac{1}{x}\right)}}{x}\right) \]
      4. associate-*r/90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \left(-\color{blue}{\frac{3451.550173699799 \cdot 1}{x}}\right)}{x}\right) \]
      5. metadata-eval90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \left(-\frac{\color{blue}{3451.550173699799}}{x}\right)}{x}\right) \]
      6. distribute-neg-frac90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \color{blue}{\frac{-3451.550173699799}{x}}}{x}\right) \]
      7. metadata-eval90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \frac{\color{blue}{-3451.550173699799}}{x}}{x}\right) \]
    7. Simplified90.4%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211 + \frac{-3451.550173699799}{x}}{x}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification90.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1350000:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 25:\\ \;\;\;\;z \cdot -0.0424927283095952 - x \cdot \left(z \cdot -0.28294182010212804 - y \cdot -0.0424927283095952\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \frac{-3451.550173699799}{x}}{x}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 89.5% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -42000:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 2:\\ \;\;\;\;z \cdot -0.0424927283095952 + \left(x \cdot y\right) \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \frac{-3451.550173699799}{x}}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -42000.0)
   (* x 4.16438922228)
   (if (<= x 2.0)
     (+ (* z -0.0424927283095952) (* (* x y) -0.0424927283095952))
     (*
      (+ x -2.0)
      (-
       4.16438922228
       (/ (+ 101.7851458539211 (/ -3451.550173699799 x)) x))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -42000.0) {
		tmp = x * 4.16438922228;
	} else if (x <= 2.0) {
		tmp = (z * -0.0424927283095952) + ((x * y) * -0.0424927283095952);
	} else {
		tmp = (x + -2.0) * (4.16438922228 - ((101.7851458539211 + (-3451.550173699799 / x)) / x));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-42000.0d0)) then
        tmp = x * 4.16438922228d0
    else if (x <= 2.0d0) then
        tmp = (z * (-0.0424927283095952d0)) + ((x * y) * (-0.0424927283095952d0))
    else
        tmp = (x + (-2.0d0)) * (4.16438922228d0 - ((101.7851458539211d0 + ((-3451.550173699799d0) / x)) / x))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -42000.0) {
		tmp = x * 4.16438922228;
	} else if (x <= 2.0) {
		tmp = (z * -0.0424927283095952) + ((x * y) * -0.0424927283095952);
	} else {
		tmp = (x + -2.0) * (4.16438922228 - ((101.7851458539211 + (-3451.550173699799 / x)) / x));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -42000.0:
		tmp = x * 4.16438922228
	elif x <= 2.0:
		tmp = (z * -0.0424927283095952) + ((x * y) * -0.0424927283095952)
	else:
		tmp = (x + -2.0) * (4.16438922228 - ((101.7851458539211 + (-3451.550173699799 / x)) / x))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -42000.0)
		tmp = Float64(x * 4.16438922228);
	elseif (x <= 2.0)
		tmp = Float64(Float64(z * -0.0424927283095952) + Float64(Float64(x * y) * -0.0424927283095952));
	else
		tmp = Float64(Float64(x + -2.0) * Float64(4.16438922228 - Float64(Float64(101.7851458539211 + Float64(-3451.550173699799 / x)) / x)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -42000.0)
		tmp = x * 4.16438922228;
	elseif (x <= 2.0)
		tmp = (z * -0.0424927283095952) + ((x * y) * -0.0424927283095952);
	else
		tmp = (x + -2.0) * (4.16438922228 - ((101.7851458539211 + (-3451.550173699799 / x)) / x));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -42000.0], N[(x * 4.16438922228), $MachinePrecision], If[LessEqual[x, 2.0], N[(N[(z * -0.0424927283095952), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] * -0.0424927283095952), $MachinePrecision]), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] * N[(4.16438922228 - N[(N[(101.7851458539211 + N[(-3451.550173699799 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -42000:\\
\;\;\;\;x \cdot 4.16438922228\\

\mathbf{elif}\;x \leq 2:\\
\;\;\;\;z \cdot -0.0424927283095952 + \left(x \cdot y\right) \cdot -0.0424927283095952\\

\mathbf{else}:\\
\;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \frac{-3451.550173699799}{x}}{x}\right)\\


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

    1. Initial program 13.0%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*19.0%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg19.0%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval19.0%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified19.0%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 93.8%

      \[\leadsto \color{blue}{4.16438922228 \cdot x} \]
    6. Step-by-step derivation
      1. *-commutative93.8%

        \[\leadsto \color{blue}{x \cdot 4.16438922228} \]
    7. Simplified93.8%

      \[\leadsto \color{blue}{x \cdot 4.16438922228} \]

    if -42000 < x < 2

    1. Initial program 99.7%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*99.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg99.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval99.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define99.6%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define99.6%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 90.2%

      \[\leadsto \color{blue}{-0.0424927283095952 \cdot z + x \cdot \left(0.0212463641547976 \cdot \left(z + -2 \cdot y\right) - -0.28294182010212804 \cdot z\right)} \]
    6. Taylor expanded in z around 0 89.6%

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

    if 2 < x

    1. Initial program 15.1%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*22.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg22.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval22.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified22.7%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around -inf 90.4%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 + -1 \cdot \frac{101.7851458539211 - 3451.550173699799 \cdot \frac{1}{x}}{x}\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 + \color{blue}{\left(-\frac{101.7851458539211 - 3451.550173699799 \cdot \frac{1}{x}}{x}\right)}\right) \]
      2. unsub-neg90.4%

        \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211 - 3451.550173699799 \cdot \frac{1}{x}}{x}\right)} \]
      3. sub-neg90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{\color{blue}{101.7851458539211 + \left(-3451.550173699799 \cdot \frac{1}{x}\right)}}{x}\right) \]
      4. associate-*r/90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \left(-\color{blue}{\frac{3451.550173699799 \cdot 1}{x}}\right)}{x}\right) \]
      5. metadata-eval90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \left(-\frac{\color{blue}{3451.550173699799}}{x}\right)}{x}\right) \]
      6. distribute-neg-frac90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \color{blue}{\frac{-3451.550173699799}{x}}}{x}\right) \]
      7. metadata-eval90.4%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \frac{\color{blue}{-3451.550173699799}}{x}}{x}\right) \]
    7. Simplified90.4%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211 + \frac{-3451.550173699799}{x}}{x}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification90.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -42000:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 2:\\ \;\;\;\;z \cdot -0.0424927283095952 + \left(x \cdot y\right) \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211 + \frac{-3451.550173699799}{x}}{x}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 89.5% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -165000:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 2:\\ \;\;\;\;z \cdot -0.0424927283095952 + \left(x \cdot y\right) \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{\frac{3655.1204654076414}{x} + -110.1139242984811}{x} - -4.16438922228\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -165000.0)
   (* x 4.16438922228)
   (if (<= x 2.0)
     (+ (* z -0.0424927283095952) (* (* x y) -0.0424927283095952))
     (*
      x
      (-
       (/ (+ (/ 3655.1204654076414 x) -110.1139242984811) x)
       -4.16438922228)))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -165000.0) {
		tmp = x * 4.16438922228;
	} else if (x <= 2.0) {
		tmp = (z * -0.0424927283095952) + ((x * y) * -0.0424927283095952);
	} else {
		tmp = x * ((((3655.1204654076414 / x) + -110.1139242984811) / x) - -4.16438922228);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-165000.0d0)) then
        tmp = x * 4.16438922228d0
    else if (x <= 2.0d0) then
        tmp = (z * (-0.0424927283095952d0)) + ((x * y) * (-0.0424927283095952d0))
    else
        tmp = x * ((((3655.1204654076414d0 / x) + (-110.1139242984811d0)) / x) - (-4.16438922228d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -165000.0) {
		tmp = x * 4.16438922228;
	} else if (x <= 2.0) {
		tmp = (z * -0.0424927283095952) + ((x * y) * -0.0424927283095952);
	} else {
		tmp = x * ((((3655.1204654076414 / x) + -110.1139242984811) / x) - -4.16438922228);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -165000.0:
		tmp = x * 4.16438922228
	elif x <= 2.0:
		tmp = (z * -0.0424927283095952) + ((x * y) * -0.0424927283095952)
	else:
		tmp = x * ((((3655.1204654076414 / x) + -110.1139242984811) / x) - -4.16438922228)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -165000.0)
		tmp = Float64(x * 4.16438922228);
	elseif (x <= 2.0)
		tmp = Float64(Float64(z * -0.0424927283095952) + Float64(Float64(x * y) * -0.0424927283095952));
	else
		tmp = Float64(x * Float64(Float64(Float64(Float64(3655.1204654076414 / x) + -110.1139242984811) / x) - -4.16438922228));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -165000.0)
		tmp = x * 4.16438922228;
	elseif (x <= 2.0)
		tmp = (z * -0.0424927283095952) + ((x * y) * -0.0424927283095952);
	else
		tmp = x * ((((3655.1204654076414 / x) + -110.1139242984811) / x) - -4.16438922228);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -165000.0], N[(x * 4.16438922228), $MachinePrecision], If[LessEqual[x, 2.0], N[(N[(z * -0.0424927283095952), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] * -0.0424927283095952), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(N[(N[(3655.1204654076414 / x), $MachinePrecision] + -110.1139242984811), $MachinePrecision] / x), $MachinePrecision] - -4.16438922228), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -165000:\\
\;\;\;\;x \cdot 4.16438922228\\

\mathbf{elif}\;x \leq 2:\\
\;\;\;\;z \cdot -0.0424927283095952 + \left(x \cdot y\right) \cdot -0.0424927283095952\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{\frac{3655.1204654076414}{x} + -110.1139242984811}{x} - -4.16438922228\right)\\


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

    1. Initial program 13.0%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*19.0%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg19.0%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval19.0%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified19.0%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 93.8%

      \[\leadsto \color{blue}{4.16438922228 \cdot x} \]
    6. Step-by-step derivation
      1. *-commutative93.8%

        \[\leadsto \color{blue}{x \cdot 4.16438922228} \]
    7. Simplified93.8%

      \[\leadsto \color{blue}{x \cdot 4.16438922228} \]

    if -165000 < x < 2

    1. Initial program 99.7%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*99.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg99.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval99.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define99.6%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define99.6%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 90.2%

      \[\leadsto \color{blue}{-0.0424927283095952 \cdot z + x \cdot \left(0.0212463641547976 \cdot \left(z + -2 \cdot y\right) - -0.28294182010212804 \cdot z\right)} \]
    6. Taylor expanded in z around 0 89.6%

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

    if 2 < x

    1. Initial program 15.1%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*22.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg22.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval22.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified22.7%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. metadata-eval22.7%

        \[\leadsto \left(x + \color{blue}{\left(-2\right)}\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)} \]
      2. sub-neg22.7%

        \[\leadsto \color{blue}{\left(x - 2\right)} \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)} \]
      3. flip--22.7%

        \[\leadsto \color{blue}{\frac{x \cdot x - 2 \cdot 2}{x + 2}} \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)} \]
      4. metadata-eval22.7%

        \[\leadsto \frac{x \cdot x - \color{blue}{4}}{x + 2} \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)} \]
      5. metadata-eval22.7%

        \[\leadsto \frac{x \cdot x - \color{blue}{-2 \cdot -2}}{x + 2} \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)} \]
      6. div-inv22.8%

        \[\leadsto \color{blue}{\left(\left(x \cdot x - -2 \cdot -2\right) \cdot \frac{1}{x + 2}\right)} \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)} \]
      7. fma-neg22.8%

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(x, x, --2 \cdot -2\right)} \cdot \frac{1}{x + 2}\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)} \]
      8. metadata-eval22.8%

        \[\leadsto \left(\mathsf{fma}\left(x, x, -\color{blue}{4}\right) \cdot \frac{1}{x + 2}\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)} \]
      9. metadata-eval22.8%

        \[\leadsto \left(\mathsf{fma}\left(x, x, \color{blue}{-4}\right) \cdot \frac{1}{x + 2}\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)} \]
    6. Applied egg-rr22.8%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(x, x, -4\right) \cdot \frac{1}{x + 2}\right)} \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)} \]
    7. Step-by-step derivation
      1. associate-*r/22.7%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, x, -4\right) \cdot 1}{x + 2}} \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)} \]
      2. *-rgt-identity22.7%

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, x, -4\right)}}{x + 2} \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)} \]
    8. Simplified22.7%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, x, -4\right)}{x + 2}} \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)} \]
    9. Taylor expanded in x around -inf 90.4%

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(-1 \cdot \frac{3655.1204654076414 \cdot \frac{1}{x} - 110.1139242984811}{x} - 4.16438922228\right)\right)} \]
    10. Simplified90.4%

      \[\leadsto \color{blue}{x \cdot \left(-\left(-4.16438922228 - \frac{\frac{3655.1204654076414}{x} + -110.1139242984811}{x}\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification90.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -165000:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 2:\\ \;\;\;\;z \cdot -0.0424927283095952 + \left(x \cdot y\right) \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{\frac{3655.1204654076414}{x} + -110.1139242984811}{x} - -4.16438922228\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 89.4% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4200000:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 2:\\ \;\;\;\;z \cdot -0.0424927283095952 + \left(x \cdot y\right) \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -4200000.0)
   (* x 4.16438922228)
   (if (<= x 2.0)
     (+ (* z -0.0424927283095952) (* (* x y) -0.0424927283095952))
     (* (+ x -2.0) (- 4.16438922228 (/ 101.7851458539211 x))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -4200000.0) {
		tmp = x * 4.16438922228;
	} else if (x <= 2.0) {
		tmp = (z * -0.0424927283095952) + ((x * y) * -0.0424927283095952);
	} else {
		tmp = (x + -2.0) * (4.16438922228 - (101.7851458539211 / x));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-4200000.0d0)) then
        tmp = x * 4.16438922228d0
    else if (x <= 2.0d0) then
        tmp = (z * (-0.0424927283095952d0)) + ((x * y) * (-0.0424927283095952d0))
    else
        tmp = (x + (-2.0d0)) * (4.16438922228d0 - (101.7851458539211d0 / x))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -4200000.0) {
		tmp = x * 4.16438922228;
	} else if (x <= 2.0) {
		tmp = (z * -0.0424927283095952) + ((x * y) * -0.0424927283095952);
	} else {
		tmp = (x + -2.0) * (4.16438922228 - (101.7851458539211 / x));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -4200000.0:
		tmp = x * 4.16438922228
	elif x <= 2.0:
		tmp = (z * -0.0424927283095952) + ((x * y) * -0.0424927283095952)
	else:
		tmp = (x + -2.0) * (4.16438922228 - (101.7851458539211 / x))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -4200000.0)
		tmp = Float64(x * 4.16438922228);
	elseif (x <= 2.0)
		tmp = Float64(Float64(z * -0.0424927283095952) + Float64(Float64(x * y) * -0.0424927283095952));
	else
		tmp = Float64(Float64(x + -2.0) * Float64(4.16438922228 - Float64(101.7851458539211 / x)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -4200000.0)
		tmp = x * 4.16438922228;
	elseif (x <= 2.0)
		tmp = (z * -0.0424927283095952) + ((x * y) * -0.0424927283095952);
	else
		tmp = (x + -2.0) * (4.16438922228 - (101.7851458539211 / x));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -4200000.0], N[(x * 4.16438922228), $MachinePrecision], If[LessEqual[x, 2.0], N[(N[(z * -0.0424927283095952), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] * -0.0424927283095952), $MachinePrecision]), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] * N[(4.16438922228 - N[(101.7851458539211 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4200000:\\
\;\;\;\;x \cdot 4.16438922228\\

\mathbf{elif}\;x \leq 2:\\
\;\;\;\;z \cdot -0.0424927283095952 + \left(x \cdot y\right) \cdot -0.0424927283095952\\

\mathbf{else}:\\
\;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211}{x}\right)\\


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

    1. Initial program 13.0%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*19.0%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg19.0%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval19.0%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified19.0%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 93.8%

      \[\leadsto \color{blue}{4.16438922228 \cdot x} \]
    6. Step-by-step derivation
      1. *-commutative93.8%

        \[\leadsto \color{blue}{x \cdot 4.16438922228} \]
    7. Simplified93.8%

      \[\leadsto \color{blue}{x \cdot 4.16438922228} \]

    if -4.2e6 < x < 2

    1. Initial program 99.7%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*99.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg99.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval99.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define99.6%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define99.6%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 90.2%

      \[\leadsto \color{blue}{-0.0424927283095952 \cdot z + x \cdot \left(0.0212463641547976 \cdot \left(z + -2 \cdot y\right) - -0.28294182010212804 \cdot z\right)} \]
    6. Taylor expanded in z around 0 89.6%

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

    if 2 < x

    1. Initial program 15.1%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*22.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg22.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval22.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define22.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified22.7%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 90.3%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - 101.7851458539211 \cdot \frac{1}{x}\right)} \]
    6. Step-by-step derivation
      1. associate-*r/90.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \color{blue}{\frac{101.7851458539211 \cdot 1}{x}}\right) \]
      2. metadata-eval90.3%

        \[\leadsto \left(x + -2\right) \cdot \left(4.16438922228 - \frac{\color{blue}{101.7851458539211}}{x}\right) \]
    7. Simplified90.3%

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(4.16438922228 - \frac{101.7851458539211}{x}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification90.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4200000:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 2:\\ \;\;\;\;z \cdot -0.0424927283095952 + \left(x \cdot y\right) \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 - \frac{101.7851458539211}{x}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 76.4% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5400:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 6.6 \cdot 10^{-5}:\\ \;\;\;\;z \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(4.16438922228 - \frac{110.1139242984811}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -5400.0)
   (* x 4.16438922228)
   (if (<= x 6.6e-5)
     (* z -0.0424927283095952)
     (* x (- 4.16438922228 (/ 110.1139242984811 x))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -5400.0) {
		tmp = x * 4.16438922228;
	} else if (x <= 6.6e-5) {
		tmp = z * -0.0424927283095952;
	} else {
		tmp = x * (4.16438922228 - (110.1139242984811 / x));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-5400.0d0)) then
        tmp = x * 4.16438922228d0
    else if (x <= 6.6d-5) then
        tmp = z * (-0.0424927283095952d0)
    else
        tmp = x * (4.16438922228d0 - (110.1139242984811d0 / x))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -5400.0) {
		tmp = x * 4.16438922228;
	} else if (x <= 6.6e-5) {
		tmp = z * -0.0424927283095952;
	} else {
		tmp = x * (4.16438922228 - (110.1139242984811 / x));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -5400.0:
		tmp = x * 4.16438922228
	elif x <= 6.6e-5:
		tmp = z * -0.0424927283095952
	else:
		tmp = x * (4.16438922228 - (110.1139242984811 / x))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -5400.0)
		tmp = Float64(x * 4.16438922228);
	elseif (x <= 6.6e-5)
		tmp = Float64(z * -0.0424927283095952);
	else
		tmp = Float64(x * Float64(4.16438922228 - Float64(110.1139242984811 / x)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -5400.0)
		tmp = x * 4.16438922228;
	elseif (x <= 6.6e-5)
		tmp = z * -0.0424927283095952;
	else
		tmp = x * (4.16438922228 - (110.1139242984811 / x));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -5400.0], N[(x * 4.16438922228), $MachinePrecision], If[LessEqual[x, 6.6e-5], N[(z * -0.0424927283095952), $MachinePrecision], N[(x * N[(4.16438922228 - N[(110.1139242984811 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5400:\\
\;\;\;\;x \cdot 4.16438922228\\

\mathbf{elif}\;x \leq 6.6 \cdot 10^{-5}:\\
\;\;\;\;z \cdot -0.0424927283095952\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(4.16438922228 - \frac{110.1139242984811}{x}\right)\\


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

    1. Initial program 13.0%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*19.0%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg19.0%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval19.0%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified19.0%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 93.8%

      \[\leadsto \color{blue}{4.16438922228 \cdot x} \]
    6. Step-by-step derivation
      1. *-commutative93.8%

        \[\leadsto \color{blue}{x \cdot 4.16438922228} \]
    7. Simplified93.8%

      \[\leadsto \color{blue}{x \cdot 4.16438922228} \]

    if -5400 < x < 6.6000000000000005e-5

    1. Initial program 99.7%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*99.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg99.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval99.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 66.7%

      \[\leadsto \color{blue}{-0.0424927283095952 \cdot z} \]
    6. Step-by-step derivation
      1. *-commutative66.7%

        \[\leadsto \color{blue}{z \cdot -0.0424927283095952} \]
    7. Simplified66.7%

      \[\leadsto \color{blue}{z \cdot -0.0424927283095952} \]

    if 6.6000000000000005e-5 < x

    1. Initial program 17.3%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*24.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg24.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval24.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define24.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define24.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define24.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define24.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define24.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define24.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define24.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified24.7%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 88.1%

      \[\leadsto \color{blue}{x \cdot \left(4.16438922228 - 110.1139242984811 \cdot \frac{1}{x}\right)} \]
    6. Step-by-step derivation
      1. associate-*r/88.1%

        \[\leadsto x \cdot \left(4.16438922228 - \color{blue}{\frac{110.1139242984811 \cdot 1}{x}}\right) \]
      2. metadata-eval88.1%

        \[\leadsto x \cdot \left(4.16438922228 - \frac{\color{blue}{110.1139242984811}}{x}\right) \]
    7. Simplified88.1%

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

Alternative 20: 76.4% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5400:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 6.6 \cdot 10^{-5}:\\ \;\;\;\;z \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;4.16438922228 \cdot \left(x + -2\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -5400.0)
   (* x 4.16438922228)
   (if (<= x 6.6e-5) (* z -0.0424927283095952) (* 4.16438922228 (+ x -2.0)))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -5400.0) {
		tmp = x * 4.16438922228;
	} else if (x <= 6.6e-5) {
		tmp = z * -0.0424927283095952;
	} else {
		tmp = 4.16438922228 * (x + -2.0);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-5400.0d0)) then
        tmp = x * 4.16438922228d0
    else if (x <= 6.6d-5) then
        tmp = z * (-0.0424927283095952d0)
    else
        tmp = 4.16438922228d0 * (x + (-2.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -5400.0) {
		tmp = x * 4.16438922228;
	} else if (x <= 6.6e-5) {
		tmp = z * -0.0424927283095952;
	} else {
		tmp = 4.16438922228 * (x + -2.0);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -5400.0:
		tmp = x * 4.16438922228
	elif x <= 6.6e-5:
		tmp = z * -0.0424927283095952
	else:
		tmp = 4.16438922228 * (x + -2.0)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -5400.0)
		tmp = Float64(x * 4.16438922228);
	elseif (x <= 6.6e-5)
		tmp = Float64(z * -0.0424927283095952);
	else
		tmp = Float64(4.16438922228 * Float64(x + -2.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -5400.0)
		tmp = x * 4.16438922228;
	elseif (x <= 6.6e-5)
		tmp = z * -0.0424927283095952;
	else
		tmp = 4.16438922228 * (x + -2.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -5400.0], N[(x * 4.16438922228), $MachinePrecision], If[LessEqual[x, 6.6e-5], N[(z * -0.0424927283095952), $MachinePrecision], N[(4.16438922228 * N[(x + -2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5400:\\
\;\;\;\;x \cdot 4.16438922228\\

\mathbf{elif}\;x \leq 6.6 \cdot 10^{-5}:\\
\;\;\;\;z \cdot -0.0424927283095952\\

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


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

    1. Initial program 13.0%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*19.0%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg19.0%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval19.0%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define19.0%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified19.0%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 93.8%

      \[\leadsto \color{blue}{4.16438922228 \cdot x} \]
    6. Step-by-step derivation
      1. *-commutative93.8%

        \[\leadsto \color{blue}{x \cdot 4.16438922228} \]
    7. Simplified93.8%

      \[\leadsto \color{blue}{x \cdot 4.16438922228} \]

    if -5400 < x < 6.6000000000000005e-5

    1. Initial program 99.7%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*99.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg99.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval99.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 66.7%

      \[\leadsto \color{blue}{-0.0424927283095952 \cdot z} \]
    6. Step-by-step derivation
      1. *-commutative66.7%

        \[\leadsto \color{blue}{z \cdot -0.0424927283095952} \]
    7. Simplified66.7%

      \[\leadsto \color{blue}{z \cdot -0.0424927283095952} \]

    if 6.6000000000000005e-5 < x

    1. Initial program 17.3%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*24.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg24.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval24.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define24.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define24.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define24.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define24.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define24.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define24.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define24.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified24.7%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 88.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5400:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 6.6 \cdot 10^{-5}:\\ \;\;\;\;z \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;4.16438922228 \cdot \left(x + -2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 76.4% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3700 \lor \neg \left(x \leq 0.00025\right):\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{else}:\\ \;\;\;\;z \cdot -0.0424927283095952\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= x -3700.0) (not (<= x 0.00025)))
   (* x 4.16438922228)
   (* z -0.0424927283095952)))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -3700.0) || !(x <= 0.00025)) {
		tmp = x * 4.16438922228;
	} else {
		tmp = z * -0.0424927283095952;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((x <= (-3700.0d0)) .or. (.not. (x <= 0.00025d0))) then
        tmp = x * 4.16438922228d0
    else
        tmp = z * (-0.0424927283095952d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((x <= -3700.0) || !(x <= 0.00025)) {
		tmp = x * 4.16438922228;
	} else {
		tmp = z * -0.0424927283095952;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (x <= -3700.0) or not (x <= 0.00025):
		tmp = x * 4.16438922228
	else:
		tmp = z * -0.0424927283095952
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((x <= -3700.0) || !(x <= 0.00025))
		tmp = Float64(x * 4.16438922228);
	else
		tmp = Float64(z * -0.0424927283095952);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((x <= -3700.0) || ~((x <= 0.00025)))
		tmp = x * 4.16438922228;
	else
		tmp = z * -0.0424927283095952;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[x, -3700.0], N[Not[LessEqual[x, 0.00025]], $MachinePrecision]], N[(x * 4.16438922228), $MachinePrecision], N[(z * -0.0424927283095952), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3700 \lor \neg \left(x \leq 0.00025\right):\\
\;\;\;\;x \cdot 4.16438922228\\

\mathbf{else}:\\
\;\;\;\;z \cdot -0.0424927283095952\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3700 or 2.5000000000000001e-4 < x

    1. Initial program 15.0%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*21.9%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg21.9%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval21.9%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define21.9%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define21.9%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define21.9%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define21.9%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define21.9%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define21.9%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define21.9%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified21.9%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 90.9%

      \[\leadsto \color{blue}{4.16438922228 \cdot x} \]
    6. Step-by-step derivation
      1. *-commutative90.9%

        \[\leadsto \color{blue}{x \cdot 4.16438922228} \]
    7. Simplified90.9%

      \[\leadsto \color{blue}{x \cdot 4.16438922228} \]

    if -3700 < x < 2.5000000000000001e-4

    1. Initial program 99.7%

      \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    2. Step-by-step derivation
      1. associate-/l*99.7%

        \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
      2. sub-neg99.7%

        \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      3. metadata-eval99.7%

        \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      4. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      5. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      6. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      7. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
      8. fma-define99.7%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
      9. fma-define99.6%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
      10. fma-define99.6%

        \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 66.2%

      \[\leadsto \color{blue}{-0.0424927283095952 \cdot z} \]
    6. Step-by-step derivation
      1. *-commutative66.2%

        \[\leadsto \color{blue}{z \cdot -0.0424927283095952} \]
    7. Simplified66.2%

      \[\leadsto \color{blue}{z \cdot -0.0424927283095952} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification78.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3700 \lor \neg \left(x \leq 0.00025\right):\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{else}:\\ \;\;\;\;z \cdot -0.0424927283095952\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 44.5% accurate, 12.3× speedup?

\[\begin{array}{l} \\ x \cdot 4.16438922228 \end{array} \]
(FPCore (x y z) :precision binary64 (* x 4.16438922228))
double code(double x, double y, double z) {
	return x * 4.16438922228;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x * 4.16438922228d0
end function
public static double code(double x, double y, double z) {
	return x * 4.16438922228;
}
def code(x, y, z):
	return x * 4.16438922228
function code(x, y, z)
	return Float64(x * 4.16438922228)
end
function tmp = code(x, y, z)
	tmp = x * 4.16438922228;
end
code[x_, y_, z_] := N[(x * 4.16438922228), $MachinePrecision]
\begin{array}{l}

\\
x \cdot 4.16438922228
\end{array}
Derivation
  1. Initial program 59.3%

    \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
  2. Step-by-step derivation
    1. associate-/l*62.6%

      \[\leadsto \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}} \]
    2. sub-neg62.6%

      \[\leadsto \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    3. metadata-eval62.6%

      \[\leadsto \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    4. fma-define62.6%

      \[\leadsto \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    5. fma-define62.6%

      \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    6. fma-define62.6%

      \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    7. fma-define62.6%

      \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
    8. fma-define62.6%

      \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}} \]
    9. fma-define62.6%

      \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)} \]
    10. fma-define62.6%

      \[\leadsto \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)} \]
  3. Simplified62.6%

    \[\leadsto \color{blue}{\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}} \]
  4. Add Preprocessing
  5. Taylor expanded in x around inf 45.0%

    \[\leadsto \color{blue}{4.16438922228 \cdot x} \]
  6. Step-by-step derivation
    1. *-commutative45.0%

      \[\leadsto \color{blue}{x \cdot 4.16438922228} \]
  7. Simplified45.0%

    \[\leadsto \color{blue}{x \cdot 4.16438922228} \]
  8. Add Preprocessing

Alternative 23: 9.1% accurate, 12.3× speedup?

\[\begin{array}{l} \\ x \cdot 0.5218852675289308 \end{array} \]
(FPCore (x y z) :precision binary64 (* x 0.5218852675289308))
double code(double x, double y, double z) {
	return x * 0.5218852675289308;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x * 0.5218852675289308d0
end function
public static double code(double x, double y, double z) {
	return x * 0.5218852675289308;
}
def code(x, y, z):
	return x * 0.5218852675289308
function code(x, y, z)
	return Float64(x * 0.5218852675289308)
end
function tmp = code(x, y, z)
	tmp = x * 0.5218852675289308;
end
code[x_, y_, z_] := N[(x * 0.5218852675289308), $MachinePrecision]
\begin{array}{l}

\\
x \cdot 0.5218852675289308
\end{array}
Derivation
  1. Initial program 59.3%

    \[\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
  2. Add Preprocessing
  3. Taylor expanded in x around 0 54.2%

    \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(\color{blue}{137.519416416 \cdot x} + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
  4. Step-by-step derivation
    1. *-commutative54.2%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(\color{blue}{x \cdot 137.519416416} + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
  5. Simplified54.2%

    \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(\color{blue}{x \cdot 137.519416416} + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]
  6. Taylor expanded in x around 0 52.6%

    \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{\left(\color{blue}{263.505074721 \cdot x} + 313.399215894\right) \cdot x + 47.066876606} \]
  7. Step-by-step derivation
    1. *-commutative52.6%

      \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{\left(\color{blue}{x \cdot 263.505074721} + 313.399215894\right) \cdot x + 47.066876606} \]
  8. Simplified52.6%

    \[\leadsto \frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{\left(\color{blue}{x \cdot 263.505074721} + 313.399215894\right) \cdot x + 47.066876606} \]
  9. Taylor expanded in x around inf 9.1%

    \[\leadsto \color{blue}{0.5218852675289308 \cdot x} \]
  10. Step-by-step derivation
    1. *-commutative9.1%

      \[\leadsto \color{blue}{x \cdot 0.5218852675289308} \]
  11. Simplified9.1%

    \[\leadsto \color{blue}{x \cdot 0.5218852675289308} \]
  12. Add Preprocessing

Developer Target 1: 98.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\frac{y}{x \cdot x} + 4.16438922228 \cdot x\right) - 110.1139242984811\\ \mathbf{if}\;x < -3.326128725870005 \cdot 10^{+62}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x < 9.429991714554673 \cdot 10^{+55}:\\ \;\;\;\;\frac{x - 2}{1} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(263.505074721 \cdot x + \left(43.3400022514 \cdot \left(x \cdot x\right) + x \cdot \left(x \cdot x\right)\right)\right) + 313.399215894\right) \cdot x + 47.066876606}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- (+ (/ y (* x x)) (* 4.16438922228 x)) 110.1139242984811)))
   (if (< x -3.326128725870005e+62)
     t_0
     (if (< x 9.429991714554673e+55)
       (*
        (/ (- x 2.0) 1.0)
        (/
         (+
          (*
           (+
            (* (+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416) x)
            y)
           x)
          z)
         (+
          (*
           (+
            (+ (* 263.505074721 x) (+ (* 43.3400022514 (* x x)) (* x (* x x))))
            313.399215894)
           x)
          47.066876606)))
       t_0))))
double code(double x, double y, double z) {
	double t_0 = ((y / (x * x)) + (4.16438922228 * x)) - 110.1139242984811;
	double tmp;
	if (x < -3.326128725870005e+62) {
		tmp = t_0;
	} else if (x < 9.429991714554673e+55) {
		tmp = ((x - 2.0) / 1.0) * (((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z) / (((((263.505074721 * x) + ((43.3400022514 * (x * x)) + (x * (x * x)))) + 313.399215894) * x) + 47.066876606));
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = ((y / (x * x)) + (4.16438922228d0 * x)) - 110.1139242984811d0
    if (x < (-3.326128725870005d+62)) then
        tmp = t_0
    else if (x < 9.429991714554673d+55) then
        tmp = ((x - 2.0d0) / 1.0d0) * (((((((((x * 4.16438922228d0) + 78.6994924154d0) * x) + 137.519416416d0) * x) + y) * x) + z) / (((((263.505074721d0 * x) + ((43.3400022514d0 * (x * x)) + (x * (x * x)))) + 313.399215894d0) * x) + 47.066876606d0))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = ((y / (x * x)) + (4.16438922228 * x)) - 110.1139242984811;
	double tmp;
	if (x < -3.326128725870005e+62) {
		tmp = t_0;
	} else if (x < 9.429991714554673e+55) {
		tmp = ((x - 2.0) / 1.0) * (((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z) / (((((263.505074721 * x) + ((43.3400022514 * (x * x)) + (x * (x * x)))) + 313.399215894) * x) + 47.066876606));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = ((y / (x * x)) + (4.16438922228 * x)) - 110.1139242984811
	tmp = 0
	if x < -3.326128725870005e+62:
		tmp = t_0
	elif x < 9.429991714554673e+55:
		tmp = ((x - 2.0) / 1.0) * (((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z) / (((((263.505074721 * x) + ((43.3400022514 * (x * x)) + (x * (x * x)))) + 313.399215894) * x) + 47.066876606))
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(Float64(y / Float64(x * x)) + Float64(4.16438922228 * x)) - 110.1139242984811)
	tmp = 0.0
	if (x < -3.326128725870005e+62)
		tmp = t_0;
	elseif (x < 9.429991714554673e+55)
		tmp = Float64(Float64(Float64(x - 2.0) / 1.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z) / Float64(Float64(Float64(Float64(Float64(263.505074721 * x) + Float64(Float64(43.3400022514 * Float64(x * x)) + Float64(x * Float64(x * x)))) + 313.399215894) * x) + 47.066876606)));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = ((y / (x * x)) + (4.16438922228 * x)) - 110.1139242984811;
	tmp = 0.0;
	if (x < -3.326128725870005e+62)
		tmp = t_0;
	elseif (x < 9.429991714554673e+55)
		tmp = ((x - 2.0) / 1.0) * (((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z) / (((((263.505074721 * x) + ((43.3400022514 * (x * x)) + (x * (x * x)))) + 313.399215894) * x) + 47.066876606));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(4.16438922228 * x), $MachinePrecision]), $MachinePrecision] - 110.1139242984811), $MachinePrecision]}, If[Less[x, -3.326128725870005e+62], t$95$0, If[Less[x, 9.429991714554673e+55], N[(N[(N[(x - 2.0), $MachinePrecision] / 1.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision] * x), $MachinePrecision] + 137.519416416), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision] / N[(N[(N[(N[(N[(263.505074721 * x), $MachinePrecision] + N[(N[(43.3400022514 * N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 313.399215894), $MachinePrecision] * x), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(\frac{y}{x \cdot x} + 4.16438922228 \cdot x\right) - 110.1139242984811\\
\mathbf{if}\;x < -3.326128725870005 \cdot 10^{+62}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x < 9.429991714554673 \cdot 10^{+55}:\\
\;\;\;\;\frac{x - 2}{1} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(263.505074721 \cdot x + \left(43.3400022514 \cdot \left(x \cdot x\right) + x \cdot \left(x \cdot x\right)\right)\right) + 313.399215894\right) \cdot x + 47.066876606}\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024118 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, C"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< x -332612872587000500000000000000000000000000000000000000000000000) (- (+ (/ y (* x x)) (* 104109730557/25000000000 x)) 1101139242984811/10000000000000) (if (< x 94299917145546730000000000000000000000000000000000000000) (* (/ (- x 2) 1) (/ (+ (* (+ (* (+ (* (+ (* x 104109730557/25000000000) 393497462077/5000000000) x) 4297481763/31250000) x) y) x) z) (+ (* (+ (+ (* 263505074721/1000000000 x) (+ (* 216700011257/5000000000 (* x x)) (* x (* x x)))) 156699607947/500000000) x) 23533438303/500000000))) (- (+ (/ y (* x x)) (* 104109730557/25000000000 x)) 1101139242984811/10000000000000))))

  (/ (* (- x 2.0) (+ (* (+ (* (+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416) x) y) x) z)) (+ (* (+ (* (+ (* (+ x 43.3400022514) x) 263.505074721) x) 313.399215894) x) 47.066876606)))