Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.4% → 99.3%
Time: 12.5s
Alternatives: 12
Speedup: 0.6×

Specification

?
\[\begin{array}{l} \\ \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b):
	return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b))
end
function tmp = code(x, y, z, t, a, b)
	tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\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 12 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: 92.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b):
	return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b))
end
function tmp = code(x, y, z, t, a, b)
	tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}

Alternative 1: 99.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+56} \lor \neg \left(z \leq 1.95 \cdot 10^{-25}\right):\\ \;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + z \cdot y\right) + \left(a \cdot \left(z \cdot b\right) + a \cdot t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= z -5e+56) (not (<= z 1.95e-25)))
   (* z (+ y (+ (/ x z) (* a (+ b (/ t z))))))
   (+ (+ x (* z y)) (+ (* a (* z b)) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -5e+56) || !(z <= 1.95e-25)) {
		tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
	} else {
		tmp = (x + (z * y)) + ((a * (z * b)) + (a * t));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if ((z <= (-5d+56)) .or. (.not. (z <= 1.95d-25))) then
        tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
    else
        tmp = (x + (z * y)) + ((a * (z * b)) + (a * t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -5e+56) || !(z <= 1.95e-25)) {
		tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
	} else {
		tmp = (x + (z * y)) + ((a * (z * b)) + (a * t));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (z <= -5e+56) or not (z <= 1.95e-25):
		tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
	else:
		tmp = (x + (z * y)) + ((a * (z * b)) + (a * t))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((z <= -5e+56) || !(z <= 1.95e-25))
		tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z))))));
	else
		tmp = Float64(Float64(x + Float64(z * y)) + Float64(Float64(a * Float64(z * b)) + Float64(a * t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((z <= -5e+56) || ~((z <= 1.95e-25)))
		tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
	else
		tmp = (x + (z * y)) + ((a * (z * b)) + (a * t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -5e+56], N[Not[LessEqual[z, 1.95e-25]], $MachinePrecision]], N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+56} \lor \neg \left(z \leq 1.95 \cdot 10^{-25}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x + z \cdot y\right) + \left(a \cdot \left(z \cdot b\right) + a \cdot t\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.00000000000000024e56 or 1.95e-25 < z

    1. Initial program 83.4%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+83.4%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. associate-*l*83.6%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified83.6%

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 98.2%

      \[\leadsto \color{blue}{z \cdot \left(y + \left(a \cdot b + \left(\frac{x}{z} + \frac{a \cdot t}{z}\right)\right)\right)} \]
    6. Step-by-step derivation
      1. +-commutative98.2%

        \[\leadsto z \cdot \left(y + \color{blue}{\left(\left(\frac{x}{z} + \frac{a \cdot t}{z}\right) + a \cdot b\right)}\right) \]
      2. associate-+l+98.2%

        \[\leadsto z \cdot \left(y + \color{blue}{\left(\frac{x}{z} + \left(\frac{a \cdot t}{z} + a \cdot b\right)\right)}\right) \]
      3. +-commutative98.2%

        \[\leadsto z \cdot \left(y + \left(\frac{x}{z} + \color{blue}{\left(a \cdot b + \frac{a \cdot t}{z}\right)}\right)\right) \]
      4. associate-/l*99.9%

        \[\leadsto z \cdot \left(y + \left(\frac{x}{z} + \left(a \cdot b + \color{blue}{a \cdot \frac{t}{z}}\right)\right)\right) \]
      5. distribute-lft-out99.9%

        \[\leadsto z \cdot \left(y + \left(\frac{x}{z} + \color{blue}{a \cdot \left(b + \frac{t}{z}\right)}\right)\right) \]
    7. Simplified99.9%

      \[\leadsto \color{blue}{z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)} \]

    if -5.00000000000000024e56 < z < 1.95e-25

    1. Initial program 98.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+98.5%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. associate-*l*99.9%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification99.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+56} \lor \neg \left(z \leq 1.95 \cdot 10^{-25}\right):\\ \;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + z \cdot y\right) + \left(a \cdot \left(z \cdot b\right) + a \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 93.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{-154} \lor \neg \left(z \leq 4.7 \cdot 10^{-88}\right):\\ \;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(a \cdot \left(z \cdot b\right) + a \cdot t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= z -3.5e-154) (not (<= z 4.7e-88)))
   (* z (+ y (+ (/ x z) (* a (+ b (/ t z))))))
   (+ x (+ (* a (* z b)) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -3.5e-154) || !(z <= 4.7e-88)) {
		tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
	} else {
		tmp = x + ((a * (z * b)) + (a * t));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if ((z <= (-3.5d-154)) .or. (.not. (z <= 4.7d-88))) then
        tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
    else
        tmp = x + ((a * (z * b)) + (a * t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -3.5e-154) || !(z <= 4.7e-88)) {
		tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
	} else {
		tmp = x + ((a * (z * b)) + (a * t));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (z <= -3.5e-154) or not (z <= 4.7e-88):
		tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
	else:
		tmp = x + ((a * (z * b)) + (a * t))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((z <= -3.5e-154) || !(z <= 4.7e-88))
		tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z))))));
	else
		tmp = Float64(x + Float64(Float64(a * Float64(z * b)) + Float64(a * t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((z <= -3.5e-154) || ~((z <= 4.7e-88)))
		tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
	else
		tmp = x + ((a * (z * b)) + (a * t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3.5e-154], N[Not[LessEqual[z, 4.7e-88]], $MachinePrecision]], N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-154} \lor \neg \left(z \leq 4.7 \cdot 10^{-88}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x + \left(a \cdot \left(z \cdot b\right) + a \cdot t\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.5000000000000001e-154 or 4.7e-88 < z

    1. Initial program 88.1%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+88.1%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. associate-*l*88.8%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified88.8%

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 95.5%

      \[\leadsto \color{blue}{z \cdot \left(y + \left(a \cdot b + \left(\frac{x}{z} + \frac{a \cdot t}{z}\right)\right)\right)} \]
    6. Step-by-step derivation
      1. +-commutative95.5%

        \[\leadsto z \cdot \left(y + \color{blue}{\left(\left(\frac{x}{z} + \frac{a \cdot t}{z}\right) + a \cdot b\right)}\right) \]
      2. associate-+l+95.5%

        \[\leadsto z \cdot \left(y + \color{blue}{\left(\frac{x}{z} + \left(\frac{a \cdot t}{z} + a \cdot b\right)\right)}\right) \]
      3. +-commutative95.5%

        \[\leadsto z \cdot \left(y + \left(\frac{x}{z} + \color{blue}{\left(a \cdot b + \frac{a \cdot t}{z}\right)}\right)\right) \]
      4. associate-/l*96.0%

        \[\leadsto z \cdot \left(y + \left(\frac{x}{z} + \left(a \cdot b + \color{blue}{a \cdot \frac{t}{z}}\right)\right)\right) \]
      5. distribute-lft-out96.6%

        \[\leadsto z \cdot \left(y + \left(\frac{x}{z} + \color{blue}{a \cdot \left(b + \frac{t}{z}\right)}\right)\right) \]
    7. Simplified96.6%

      \[\leadsto \color{blue}{z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)} \]

    if -3.5000000000000001e-154 < z < 4.7e-88

    1. Initial program 98.7%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+98.7%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. associate-*l*99.9%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 92.7%

      \[\leadsto \color{blue}{x + \left(a \cdot t + a \cdot \left(b \cdot z\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{-154} \lor \neg \left(z \leq 4.7 \cdot 10^{-88}\right):\\ \;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(a \cdot \left(z \cdot b\right) + a \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 87.5% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.9 \cdot 10^{+47} \lor \neg \left(y \leq 4.5 \cdot 10^{+51}\right):\\ \;\;\;\;x + y \cdot \left(z + \frac{a \cdot t}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= y -1.9e+47) (not (<= y 4.5e+51)))
   (+ x (* y (+ z (/ (* a t) y))))
   (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y <= -1.9e+47) || !(y <= 4.5e+51)) {
		tmp = x + (y * (z + ((a * t) / y)));
	} else {
		tmp = x + (a * (t + (z * b)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if ((y <= (-1.9d+47)) .or. (.not. (y <= 4.5d+51))) then
        tmp = x + (y * (z + ((a * t) / y)))
    else
        tmp = x + (a * (t + (z * b)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y <= -1.9e+47) || !(y <= 4.5e+51)) {
		tmp = x + (y * (z + ((a * t) / y)));
	} else {
		tmp = x + (a * (t + (z * b)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (y <= -1.9e+47) or not (y <= 4.5e+51):
		tmp = x + (y * (z + ((a * t) / y)))
	else:
		tmp = x + (a * (t + (z * b)))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((y <= -1.9e+47) || !(y <= 4.5e+51))
		tmp = Float64(x + Float64(y * Float64(z + Float64(Float64(a * t) / y))));
	else
		tmp = Float64(x + Float64(a * Float64(t + Float64(z * b))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((y <= -1.9e+47) || ~((y <= 4.5e+51)))
		tmp = x + (y * (z + ((a * t) / y)));
	else
		tmp = x + (a * (t + (z * b)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.9e+47], N[Not[LessEqual[y, 4.5e+51]], $MachinePrecision]], N[(x + N[(y * N[(z + N[(N[(a * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{+47} \lor \neg \left(y \leq 4.5 \cdot 10^{+51}\right):\\
\;\;\;\;x + y \cdot \left(z + \frac{a \cdot t}{y}\right)\\

\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.9000000000000002e47 or 4.5e51 < y

    1. Initial program 86.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+86.5%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. associate-*l*89.4%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified89.4%

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in b around 0 85.9%

      \[\leadsto \color{blue}{x + \left(a \cdot t + y \cdot z\right)} \]
    6. Taylor expanded in y around inf 88.8%

      \[\leadsto x + \color{blue}{y \cdot \left(z + \frac{a \cdot t}{y}\right)} \]

    if -1.9000000000000002e47 < y < 4.5e51

    1. Initial program 94.7%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+94.7%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. +-commutative94.7%

        \[\leadsto \color{blue}{\left(y \cdot z + x\right)} + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right) \]
      3. fma-define94.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, z, x\right)} + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right) \]
      4. associate-*l*94.2%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
      5. *-commutative94.2%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + \left(t \cdot a + a \cdot \color{blue}{\left(b \cdot z\right)}\right) \]
      6. *-commutative94.2%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + \left(t \cdot a + \color{blue}{\left(b \cdot z\right) \cdot a}\right) \]
      7. distribute-rgt-out96.2%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + \color{blue}{a \cdot \left(t + b \cdot z\right)} \]
      8. *-commutative96.2%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \color{blue}{z \cdot b}\right) \]
    3. Simplified96.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 90.0%

      \[\leadsto \color{blue}{x + a \cdot \left(t + b \cdot z\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification89.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.9 \cdot 10^{+47} \lor \neg \left(y \leq 4.5 \cdot 10^{+51}\right):\\ \;\;\;\;x + y \cdot \left(z + \frac{a \cdot t}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 58.8% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2.1 \cdot 10^{+275}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -2.6 \cdot 10^{+106}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq 1.02 \cdot 10^{+117}:\\ \;\;\;\;x + z \cdot y\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= a -2.1e+275)
   (* a t)
   (if (<= a -2.6e+106)
     (* a (* z b))
     (if (<= a 1.02e+117) (+ x (* z y)) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -2.1e+275) {
		tmp = a * t;
	} else if (a <= -2.6e+106) {
		tmp = a * (z * b);
	} else if (a <= 1.02e+117) {
		tmp = x + (z * y);
	} else {
		tmp = a * t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (a <= (-2.1d+275)) then
        tmp = a * t
    else if (a <= (-2.6d+106)) then
        tmp = a * (z * b)
    else if (a <= 1.02d+117) then
        tmp = x + (z * y)
    else
        tmp = a * t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -2.1e+275) {
		tmp = a * t;
	} else if (a <= -2.6e+106) {
		tmp = a * (z * b);
	} else if (a <= 1.02e+117) {
		tmp = x + (z * y);
	} else {
		tmp = a * t;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if a <= -2.1e+275:
		tmp = a * t
	elif a <= -2.6e+106:
		tmp = a * (z * b)
	elif a <= 1.02e+117:
		tmp = x + (z * y)
	else:
		tmp = a * t
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= -2.1e+275)
		tmp = Float64(a * t);
	elseif (a <= -2.6e+106)
		tmp = Float64(a * Float64(z * b));
	elseif (a <= 1.02e+117)
		tmp = Float64(x + Float64(z * y));
	else
		tmp = Float64(a * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (a <= -2.1e+275)
		tmp = a * t;
	elseif (a <= -2.6e+106)
		tmp = a * (z * b);
	elseif (a <= 1.02e+117)
		tmp = x + (z * y);
	else
		tmp = a * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.1e+275], N[(a * t), $MachinePrecision], If[LessEqual[a, -2.6e+106], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.02e+117], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], N[(a * t), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.1 \cdot 10^{+275}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;a \leq -2.6 \cdot 10^{+106}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\

\mathbf{elif}\;a \leq 1.02 \cdot 10^{+117}:\\
\;\;\;\;x + z \cdot y\\

\mathbf{else}:\\
\;\;\;\;a \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.1000000000000001e275 or 1.02e117 < a

    1. Initial program 78.8%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+78.8%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. associate-*l*88.3%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified88.3%

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 55.1%

      \[\leadsto \color{blue}{a \cdot t} \]

    if -2.1000000000000001e275 < a < -2.6000000000000002e106

    1. Initial program 84.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+84.9%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. associate-*l*93.4%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified93.4%

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 55.4%

      \[\leadsto \color{blue}{z \cdot \left(y + a \cdot b\right)} \]
    6. Taylor expanded in y around 0 49.8%

      \[\leadsto \color{blue}{a \cdot \left(b \cdot z\right)} \]
    7. Step-by-step derivation
      1. *-commutative49.8%

        \[\leadsto a \cdot \color{blue}{\left(z \cdot b\right)} \]
    8. Simplified49.8%

      \[\leadsto \color{blue}{a \cdot \left(z \cdot b\right)} \]

    if -2.6000000000000002e106 < a < 1.02e117

    1. Initial program 97.4%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+97.4%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. associate-*l*93.2%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified93.2%

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 71.0%

      \[\leadsto \color{blue}{x + y \cdot z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification64.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.1 \cdot 10^{+275}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -2.6 \cdot 10^{+106}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq 1.02 \cdot 10^{+117}:\\ \;\;\;\;x + z \cdot y\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 87.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.25 \cdot 10^{+47} \lor \neg \left(y \leq 3.5 \cdot 10^{+51}\right):\\ \;\;\;\;x + \left(z \cdot y + a \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= y -1.25e+47) (not (<= y 3.5e+51)))
   (+ x (+ (* z y) (* a t)))
   (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y <= -1.25e+47) || !(y <= 3.5e+51)) {
		tmp = x + ((z * y) + (a * t));
	} else {
		tmp = x + (a * (t + (z * b)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if ((y <= (-1.25d+47)) .or. (.not. (y <= 3.5d+51))) then
        tmp = x + ((z * y) + (a * t))
    else
        tmp = x + (a * (t + (z * b)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y <= -1.25e+47) || !(y <= 3.5e+51)) {
		tmp = x + ((z * y) + (a * t));
	} else {
		tmp = x + (a * (t + (z * b)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (y <= -1.25e+47) or not (y <= 3.5e+51):
		tmp = x + ((z * y) + (a * t))
	else:
		tmp = x + (a * (t + (z * b)))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((y <= -1.25e+47) || !(y <= 3.5e+51))
		tmp = Float64(x + Float64(Float64(z * y) + Float64(a * t)));
	else
		tmp = Float64(x + Float64(a * Float64(t + Float64(z * b))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((y <= -1.25e+47) || ~((y <= 3.5e+51)))
		tmp = x + ((z * y) + (a * t));
	else
		tmp = x + (a * (t + (z * b)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.25e+47], N[Not[LessEqual[y, 3.5e+51]], $MachinePrecision]], N[(x + N[(N[(z * y), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+47} \lor \neg \left(y \leq 3.5 \cdot 10^{+51}\right):\\
\;\;\;\;x + \left(z \cdot y + a \cdot t\right)\\

\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.25000000000000005e47 or 3.5e51 < y

    1. Initial program 86.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+86.5%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. associate-*l*89.4%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified89.4%

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in b around 0 85.9%

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

    if -1.25000000000000005e47 < y < 3.5e51

    1. Initial program 94.7%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+94.7%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. +-commutative94.7%

        \[\leadsto \color{blue}{\left(y \cdot z + x\right)} + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right) \]
      3. fma-define94.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, z, x\right)} + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right) \]
      4. associate-*l*94.2%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
      5. *-commutative94.2%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + \left(t \cdot a + a \cdot \color{blue}{\left(b \cdot z\right)}\right) \]
      6. *-commutative94.2%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + \left(t \cdot a + \color{blue}{\left(b \cdot z\right) \cdot a}\right) \]
      7. distribute-rgt-out96.2%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + \color{blue}{a \cdot \left(t + b \cdot z\right)} \]
      8. *-commutative96.2%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \color{blue}{z \cdot b}\right) \]
    3. Simplified96.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 90.0%

      \[\leadsto \color{blue}{x + a \cdot \left(t + b \cdot z\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification88.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.25 \cdot 10^{+47} \lor \neg \left(y \leq 3.5 \cdot 10^{+51}\right):\\ \;\;\;\;x + \left(z \cdot y + a \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 82.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+113} \lor \neg \left(z \leq 3.6 \cdot 10^{+77}\right):\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= z -2.6e+113) (not (<= z 3.6e+77)))
   (* z (+ y (* a b)))
   (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -2.6e+113) || !(z <= 3.6e+77)) {
		tmp = z * (y + (a * b));
	} else {
		tmp = x + (a * (t + (z * b)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if ((z <= (-2.6d+113)) .or. (.not. (z <= 3.6d+77))) then
        tmp = z * (y + (a * b))
    else
        tmp = x + (a * (t + (z * b)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -2.6e+113) || !(z <= 3.6e+77)) {
		tmp = z * (y + (a * b));
	} else {
		tmp = x + (a * (t + (z * b)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (z <= -2.6e+113) or not (z <= 3.6e+77):
		tmp = z * (y + (a * b))
	else:
		tmp = x + (a * (t + (z * b)))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((z <= -2.6e+113) || !(z <= 3.6e+77))
		tmp = Float64(z * Float64(y + Float64(a * b)));
	else
		tmp = Float64(x + Float64(a * Float64(t + Float64(z * b))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((z <= -2.6e+113) || ~((z <= 3.6e+77)))
		tmp = z * (y + (a * b));
	else
		tmp = x + (a * (t + (z * b)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.6e+113], N[Not[LessEqual[z, 3.6e+77]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+113} \lor \neg \left(z \leq 3.6 \cdot 10^{+77}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\

\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.5999999999999999e113 or 3.5999999999999998e77 < z

    1. Initial program 81.6%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+81.6%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. associate-*l*83.1%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified83.1%

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 85.3%

      \[\leadsto \color{blue}{z \cdot \left(y + a \cdot b\right)} \]

    if -2.5999999999999999e113 < z < 3.5999999999999998e77

    1. Initial program 96.4%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+96.4%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. +-commutative96.4%

        \[\leadsto \color{blue}{\left(y \cdot z + x\right)} + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right) \]
      3. fma-define96.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, z, x\right)} + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right) \]
      4. associate-*l*97.0%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
      5. *-commutative97.0%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + \left(t \cdot a + a \cdot \color{blue}{\left(b \cdot z\right)}\right) \]
      6. *-commutative97.0%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + \left(t \cdot a + \color{blue}{\left(b \cdot z\right) \cdot a}\right) \]
      7. distribute-rgt-out97.5%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + \color{blue}{a \cdot \left(t + b \cdot z\right)} \]
      8. *-commutative97.5%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \color{blue}{z \cdot b}\right) \]
    3. Simplified97.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 86.2%

      \[\leadsto \color{blue}{x + a \cdot \left(t + b \cdot z\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification85.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+113} \lor \neg \left(z \leq 3.6 \cdot 10^{+77}\right):\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 39.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{+113}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-300}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{+76}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= z -8.2e+113)
   (* z y)
   (if (<= z -3.5e-300) (* a t) (if (<= z 5.5e+76) x (* z y)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -8.2e+113) {
		tmp = z * y;
	} else if (z <= -3.5e-300) {
		tmp = a * t;
	} else if (z <= 5.5e+76) {
		tmp = x;
	} else {
		tmp = z * y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (z <= (-8.2d+113)) then
        tmp = z * y
    else if (z <= (-3.5d-300)) then
        tmp = a * t
    else if (z <= 5.5d+76) then
        tmp = x
    else
        tmp = z * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -8.2e+113) {
		tmp = z * y;
	} else if (z <= -3.5e-300) {
		tmp = a * t;
	} else if (z <= 5.5e+76) {
		tmp = x;
	} else {
		tmp = z * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if z <= -8.2e+113:
		tmp = z * y
	elif z <= -3.5e-300:
		tmp = a * t
	elif z <= 5.5e+76:
		tmp = x
	else:
		tmp = z * y
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -8.2e+113)
		tmp = Float64(z * y);
	elseif (z <= -3.5e-300)
		tmp = Float64(a * t);
	elseif (z <= 5.5e+76)
		tmp = x;
	else
		tmp = Float64(z * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (z <= -8.2e+113)
		tmp = z * y;
	elseif (z <= -3.5e-300)
		tmp = a * t;
	elseif (z <= 5.5e+76)
		tmp = x;
	else
		tmp = z * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -8.2e+113], N[(z * y), $MachinePrecision], If[LessEqual[z, -3.5e-300], N[(a * t), $MachinePrecision], If[LessEqual[z, 5.5e+76], x, N[(z * y), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+113}:\\
\;\;\;\;z \cdot y\\

\mathbf{elif}\;z \leq -3.5 \cdot 10^{-300}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;z \leq 5.5 \cdot 10^{+76}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;z \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.19999999999999985e113 or 5.5000000000000001e76 < z

    1. Initial program 81.6%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+81.6%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. associate-*l*83.1%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified83.1%

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 55.4%

      \[\leadsto \color{blue}{y \cdot z} \]
    6. Step-by-step derivation
      1. *-commutative55.4%

        \[\leadsto \color{blue}{z \cdot y} \]
    7. Simplified55.4%

      \[\leadsto \color{blue}{z \cdot y} \]

    if -8.19999999999999985e113 < z < -3.5000000000000002e-300

    1. Initial program 95.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+95.5%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. associate-*l*96.5%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified96.5%

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 42.4%

      \[\leadsto \color{blue}{a \cdot t} \]

    if -3.5000000000000002e-300 < z < 5.5000000000000001e76

    1. Initial program 97.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+97.5%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. associate-*l*97.4%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified97.4%

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 47.6%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 8: 74.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -0.0055 \lor \neg \left(a \leq 102000\right):\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= a -0.0055) (not (<= a 102000.0)))
   (* a (+ t (* z b)))
   (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((a <= -0.0055) || !(a <= 102000.0)) {
		tmp = a * (t + (z * b));
	} else {
		tmp = x + (z * y);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if ((a <= (-0.0055d0)) .or. (.not. (a <= 102000.0d0))) then
        tmp = a * (t + (z * b))
    else
        tmp = x + (z * y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((a <= -0.0055) || !(a <= 102000.0)) {
		tmp = a * (t + (z * b));
	} else {
		tmp = x + (z * y);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (a <= -0.0055) or not (a <= 102000.0):
		tmp = a * (t + (z * b))
	else:
		tmp = x + (z * y)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((a <= -0.0055) || !(a <= 102000.0))
		tmp = Float64(a * Float64(t + Float64(z * b)));
	else
		tmp = Float64(x + Float64(z * y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((a <= -0.0055) || ~((a <= 102000.0)))
		tmp = a * (t + (z * b));
	else
		tmp = x + (z * y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -0.0055], N[Not[LessEqual[a, 102000.0]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.0055 \lor \neg \left(a \leq 102000\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\

\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -0.0054999999999999997 or 102000 < a

    1. Initial program 85.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+85.5%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. associate-*l*92.7%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified92.7%

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf 75.8%

      \[\leadsto \color{blue}{a \cdot \left(t + b \cdot z\right)} \]

    if -0.0054999999999999997 < a < 102000

    1. Initial program 98.2%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+98.2%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. associate-*l*91.8%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified91.8%

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 80.5%

      \[\leadsto \color{blue}{x + y \cdot z} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification78.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -0.0055 \lor \neg \left(a \leq 102000\right):\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 73.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.2:\\ \;\;\;\;\left(b + \frac{t}{z}\right) \cdot \left(z \cdot a\right)\\ \mathbf{elif}\;a \leq 1200:\\ \;\;\;\;x + z \cdot y\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= a -1.2)
   (* (+ b (/ t z)) (* z a))
   (if (<= a 1200.0) (+ x (* z y)) (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -1.2) {
		tmp = (b + (t / z)) * (z * a);
	} else if (a <= 1200.0) {
		tmp = x + (z * y);
	} else {
		tmp = a * (t + (z * b));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (a <= (-1.2d0)) then
        tmp = (b + (t / z)) * (z * a)
    else if (a <= 1200.0d0) then
        tmp = x + (z * y)
    else
        tmp = a * (t + (z * b))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -1.2) {
		tmp = (b + (t / z)) * (z * a);
	} else if (a <= 1200.0) {
		tmp = x + (z * y);
	} else {
		tmp = a * (t + (z * b));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if a <= -1.2:
		tmp = (b + (t / z)) * (z * a)
	elif a <= 1200.0:
		tmp = x + (z * y)
	else:
		tmp = a * (t + (z * b))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= -1.2)
		tmp = Float64(Float64(b + Float64(t / z)) * Float64(z * a));
	elseif (a <= 1200.0)
		tmp = Float64(x + Float64(z * y));
	else
		tmp = Float64(a * Float64(t + Float64(z * b)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (a <= -1.2)
		tmp = (b + (t / z)) * (z * a);
	elseif (a <= 1200.0)
		tmp = x + (z * y);
	else
		tmp = a * (t + (z * b));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.2], N[(N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision] * N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1200.0], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.2:\\
\;\;\;\;\left(b + \frac{t}{z}\right) \cdot \left(z \cdot a\right)\\

\mathbf{elif}\;a \leq 1200:\\
\;\;\;\;x + z \cdot y\\

\mathbf{else}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\


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

    1. Initial program 84.6%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+84.6%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. associate-*l*91.5%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified91.5%

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 81.1%

      \[\leadsto \color{blue}{z \cdot \left(y + \left(a \cdot b + \left(\frac{x}{z} + \frac{a \cdot t}{z}\right)\right)\right)} \]
    6. Step-by-step derivation
      1. +-commutative81.1%

        \[\leadsto z \cdot \left(y + \color{blue}{\left(\left(\frac{x}{z} + \frac{a \cdot t}{z}\right) + a \cdot b\right)}\right) \]
      2. associate-+l+81.1%

        \[\leadsto z \cdot \left(y + \color{blue}{\left(\frac{x}{z} + \left(\frac{a \cdot t}{z} + a \cdot b\right)\right)}\right) \]
      3. +-commutative81.1%

        \[\leadsto z \cdot \left(y + \left(\frac{x}{z} + \color{blue}{\left(a \cdot b + \frac{a \cdot t}{z}\right)}\right)\right) \]
      4. associate-/l*82.5%

        \[\leadsto z \cdot \left(y + \left(\frac{x}{z} + \left(a \cdot b + \color{blue}{a \cdot \frac{t}{z}}\right)\right)\right) \]
      5. distribute-lft-out83.9%

        \[\leadsto z \cdot \left(y + \left(\frac{x}{z} + \color{blue}{a \cdot \left(b + \frac{t}{z}\right)}\right)\right) \]
    7. Simplified83.9%

      \[\leadsto \color{blue}{z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)} \]
    8. Taylor expanded in a around inf 74.7%

      \[\leadsto \color{blue}{a \cdot \left(z \cdot \left(b + \frac{t}{z}\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r*77.9%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot \left(b + \frac{t}{z}\right)} \]
    10. Simplified77.9%

      \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot \left(b + \frac{t}{z}\right)} \]

    if -1.19999999999999996 < a < 1200

    1. Initial program 98.2%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+98.2%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. associate-*l*91.8%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified91.8%

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 80.5%

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

    if 1200 < a

    1. Initial program 86.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+86.5%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. associate-*l*93.9%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified93.9%

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf 75.8%

      \[\leadsto \color{blue}{a \cdot \left(t + b \cdot z\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification78.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.2:\\ \;\;\;\;\left(b + \frac{t}{z}\right) \cdot \left(z \cdot a\right)\\ \mathbf{elif}\;a \leq 1200:\\ \;\;\;\;x + z \cdot y\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 63.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.06 \cdot 10^{+114} \lor \neg \left(z \leq 3.4 \cdot 10^{+55}\right):\\ \;\;\;\;x + z \cdot y\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= z -1.06e+114) (not (<= z 3.4e+55))) (+ x (* z y)) (+ x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -1.06e+114) || !(z <= 3.4e+55)) {
		tmp = x + (z * y);
	} else {
		tmp = x + (a * t);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if ((z <= (-1.06d+114)) .or. (.not. (z <= 3.4d+55))) then
        tmp = x + (z * y)
    else
        tmp = x + (a * t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -1.06e+114) || !(z <= 3.4e+55)) {
		tmp = x + (z * y);
	} else {
		tmp = x + (a * t);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (z <= -1.06e+114) or not (z <= 3.4e+55):
		tmp = x + (z * y)
	else:
		tmp = x + (a * t)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((z <= -1.06e+114) || !(z <= 3.4e+55))
		tmp = Float64(x + Float64(z * y));
	else
		tmp = Float64(x + Float64(a * t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((z <= -1.06e+114) || ~((z <= 3.4e+55)))
		tmp = x + (z * y);
	else
		tmp = x + (a * t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.06e+114], N[Not[LessEqual[z, 3.4e+55]], $MachinePrecision]], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.06 \cdot 10^{+114} \lor \neg \left(z \leq 3.4 \cdot 10^{+55}\right):\\
\;\;\;\;x + z \cdot y\\

\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.05999999999999993e114 or 3.3999999999999998e55 < z

    1. Initial program 82.6%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+82.6%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. associate-*l*82.9%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified82.9%

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 64.2%

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

    if -1.05999999999999993e114 < z < 3.3999999999999998e55

    1. Initial program 96.3%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+96.3%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. associate-*l*97.5%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified97.5%

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 67.7%

      \[\leadsto \color{blue}{x + a \cdot t} \]
    6. Step-by-step derivation
      1. +-commutative67.7%

        \[\leadsto \color{blue}{a \cdot t + x} \]
    7. Simplified67.7%

      \[\leadsto \color{blue}{a \cdot t + x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.06 \cdot 10^{+114} \lor \neg \left(z \leq 3.4 \cdot 10^{+55}\right):\\ \;\;\;\;x + z \cdot y\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 39.4% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -650000000000 \lor \neg \left(a \leq 1.42 \cdot 10^{+55}\right):\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= a -650000000000.0) (not (<= a 1.42e+55))) (* a t) x))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((a <= -650000000000.0) || !(a <= 1.42e+55)) {
		tmp = a * t;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if ((a <= (-650000000000.0d0)) .or. (.not. (a <= 1.42d+55))) then
        tmp = a * t
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((a <= -650000000000.0) || !(a <= 1.42e+55)) {
		tmp = a * t;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (a <= -650000000000.0) or not (a <= 1.42e+55):
		tmp = a * t
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((a <= -650000000000.0) || !(a <= 1.42e+55))
		tmp = Float64(a * t);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((a <= -650000000000.0) || ~((a <= 1.42e+55)))
		tmp = a * t;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -650000000000.0], N[Not[LessEqual[a, 1.42e+55]], $MachinePrecision]], N[(a * t), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -650000000000 \lor \neg \left(a \leq 1.42 \cdot 10^{+55}\right):\\
\;\;\;\;a \cdot t\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6.5e11 or 1.42000000000000005e55 < a

    1. Initial program 84.1%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+84.1%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. associate-*l*92.0%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified92.0%

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 43.0%

      \[\leadsto \color{blue}{a \cdot t} \]

    if -6.5e11 < a < 1.42000000000000005e55

    1. Initial program 98.4%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+98.4%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. associate-*l*92.5%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified92.5%

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 43.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -650000000000 \lor \neg \left(a \leq 1.42 \cdot 10^{+55}\right):\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 25.7% accurate, 15.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
def code(x, y, z, t, a, b):
	return x
function code(x, y, z, t, a, b)
	return x
end
function tmp = code(x, y, z, t, a, b)
	tmp = x;
end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 91.4%

    \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
  2. Step-by-step derivation
    1. associate-+l+91.4%

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
    2. associate-*l*92.3%

      \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
  3. Simplified92.3%

    \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in x around inf 26.7%

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

Developer Target 1: 97.5% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\ \mathbf{if}\;z < -11820553527347888000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\ \;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ (* z (+ (* b a) y)) (+ x (* t a)))))
   (if (< z -11820553527347888000.0)
     t_1
     (if (< z 4.7589743188364287e-122)
       (+ (* (+ (* b z) t) a) (+ (* z y) x))
       t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z * ((b * a) + y)) + (x + (t * a));
	double tmp;
	if (z < -11820553527347888000.0) {
		tmp = t_1;
	} else if (z < 4.7589743188364287e-122) {
		tmp = (((b * z) + t) * a) + ((z * y) + x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (z * ((b * a) + y)) + (x + (t * a))
    if (z < (-11820553527347888000.0d0)) then
        tmp = t_1
    else if (z < 4.7589743188364287d-122) then
        tmp = (((b * z) + t) * a) + ((z * y) + x)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z * ((b * a) + y)) + (x + (t * a));
	double tmp;
	if (z < -11820553527347888000.0) {
		tmp = t_1;
	} else if (z < 4.7589743188364287e-122) {
		tmp = (((b * z) + t) * a) + ((z * y) + x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (z * ((b * a) + y)) + (x + (t * a))
	tmp = 0
	if z < -11820553527347888000.0:
		tmp = t_1
	elif z < 4.7589743188364287e-122:
		tmp = (((b * z) + t) * a) + ((z * y) + x)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(z * Float64(Float64(b * a) + y)) + Float64(x + Float64(t * a)))
	tmp = 0.0
	if (z < -11820553527347888000.0)
		tmp = t_1;
	elseif (z < 4.7589743188364287e-122)
		tmp = Float64(Float64(Float64(Float64(b * z) + t) * a) + Float64(Float64(z * y) + x));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (z * ((b * a) + y)) + (x + (t * a));
	tmp = 0.0;
	if (z < -11820553527347888000.0)
		tmp = t_1;
	elseif (z < 4.7589743188364287e-122)
		tmp = (((b * z) + t) * a) + ((z * y) + x);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(N[(b * a), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -11820553527347888000.0], t$95$1, If[Less[z, 4.7589743188364287e-122], N[(N[(N[(N[(b * z), $MachinePrecision] + t), $MachinePrecision] * a), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\
\mathbf{if}\;z < -11820553527347888000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\
\;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024135 
(FPCore (x y z t a b)
  :name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< z -11820553527347888000) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 47589743188364287/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a))))))

  (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))