Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.6% → 98.8%
Time: 12.4s
Alternatives: 14
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 14 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.6% 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: 98.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+76} \lor \neg \left(z \leq 8.8 \cdot 10^{-50}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.8000000000000001e76 or 8.7999999999999996e-50 < z

    1. Initial program 90.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+90.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*82.7%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified82.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 z around inf 94.9%

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

        \[\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+94.9%

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

        \[\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*97.4%

        \[\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 -1.8000000000000001e76 < z < 8.7999999999999996e-50

    1. Initial program 98.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+98.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*100.0%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified100.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
  3. Recombined 2 regimes into one program.
  4. Final simplification99.9%

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

Alternative 2: 98.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(t \cdot a + \left(x + y \cdot z\right)\right) + \left(z \cdot a\right) \cdot b\\ \mathbf{if}\;t\_1 \leq 10^{+308}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ (+ (* t a) (+ x (* y z))) (* (* z a) b))))
   (if (<= t_1 1e+308) t_1 (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((t * a) + (x + (y * z))) + ((z * a) * b);
	double tmp;
	if (t_1 <= 1e+308) {
		tmp = t_1;
	} else {
		tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
	}
	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 = ((t * a) + (x + (y * z))) + ((z * a) * b)
    if (t_1 <= 1d+308) then
        tmp = t_1
    else
        tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
    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 = ((t * a) + (x + (y * z))) + ((z * a) * b);
	double tmp;
	if (t_1 <= 1e+308) {
		tmp = t_1;
	} else {
		tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = ((t * a) + (x + (y * z))) + ((z * a) * b)
	tmp = 0
	if t_1 <= 1e+308:
		tmp = t_1
	else:
		tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(Float64(t * a) + Float64(x + Float64(y * z))) + Float64(Float64(z * a) * b))
	tmp = 0.0
	if (t_1 <= 1e+308)
		tmp = t_1;
	else
		tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z))))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = ((t * a) + (x + (y * z))) + ((z * a) * b);
	tmp = 0.0;
	if (t_1 <= 1e+308)
		tmp = t_1;
	else
		tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t * a), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+308], t$95$1, N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(t \cdot a + \left(x + y \cdot z\right)\right) + \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;t\_1 \leq 10^{+308}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < 1e308

    1. Initial program 99.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing

    if 1e308 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b))

    1. Initial program 73.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+73.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.3%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified83.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 z around inf 85.4%

      \[\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. +-commutative85.4%

        \[\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+85.4%

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

        \[\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*91.7%

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

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

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

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

Alternative 3: 93.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{-9} \lor \neg \left(z \leq 3.8 \cdot 10^{-99}\right):\\ \;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y \cdot z + t \cdot a\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= z -1.35e-9) (not (<= z 3.8e-99)))
   (* z (+ y (+ (/ x z) (* a (+ b (/ t z))))))
   (+ x (+ (* y z) (* t a)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -1.35e-9) || !(z <= 3.8e-99)) {
		tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
	} else {
		tmp = x + ((y * z) + (t * a));
	}
	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.35d-9)) .or. (.not. (z <= 3.8d-99))) then
        tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
    else
        tmp = x + ((y * z) + (t * a))
    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.35e-9) || !(z <= 3.8e-99)) {
		tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
	} else {
		tmp = x + ((y * z) + (t * a));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (z <= -1.35e-9) or not (z <= 3.8e-99):
		tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
	else:
		tmp = x + ((y * z) + (t * a))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((z <= -1.35e-9) || !(z <= 3.8e-99))
		tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z))))));
	else
		tmp = Float64(x + Float64(Float64(y * z) + Float64(t * a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((z <= -1.35e-9) || ~((z <= 3.8e-99)))
		tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
	else
		tmp = x + ((y * z) + (t * a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.35e-9], N[Not[LessEqual[z, 3.8e-99]], $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[(y * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{-9} \lor \neg \left(z \leq 3.8 \cdot 10^{-99}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.3500000000000001e-9 or 3.7999999999999997e-99 < z

    1. Initial program 90.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+90.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*85.8%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified85.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 94.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. +-commutative94.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+94.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. +-commutative94.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.6%

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

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

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

    if -1.3500000000000001e-9 < z < 3.7999999999999997e-99

    1. Initial program 99.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+99.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*100.0%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified100.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 b around 0 94.3%

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

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

Alternative 4: 87.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{if}\;a \leq -8.8 \cdot 10^{-12}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 2.8 \cdot 10^{-229}:\\ \;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;a \leq 5.8 \cdot 10^{-35}:\\ \;\;\;\;x + \left(y \cdot z + t \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (* a (+ t (* z b))))))
   (if (<= a -8.8e-12)
     t_1
     (if (<= a 2.8e-229)
       (+ x (* z (+ y (* a b))))
       (if (<= a 5.8e-35) (+ x (+ (* y z) (* t a))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (a * (t + (z * b)));
	double tmp;
	if (a <= -8.8e-12) {
		tmp = t_1;
	} else if (a <= 2.8e-229) {
		tmp = x + (z * (y + (a * b)));
	} else if (a <= 5.8e-35) {
		tmp = x + ((y * z) + (t * a));
	} 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 = x + (a * (t + (z * b)))
    if (a <= (-8.8d-12)) then
        tmp = t_1
    else if (a <= 2.8d-229) then
        tmp = x + (z * (y + (a * b)))
    else if (a <= 5.8d-35) then
        tmp = x + ((y * z) + (t * a))
    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 = x + (a * (t + (z * b)));
	double tmp;
	if (a <= -8.8e-12) {
		tmp = t_1;
	} else if (a <= 2.8e-229) {
		tmp = x + (z * (y + (a * b)));
	} else if (a <= 5.8e-35) {
		tmp = x + ((y * z) + (t * a));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (a * (t + (z * b)))
	tmp = 0
	if a <= -8.8e-12:
		tmp = t_1
	elif a <= 2.8e-229:
		tmp = x + (z * (y + (a * b)))
	elif a <= 5.8e-35:
		tmp = x + ((y * z) + (t * a))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(a * Float64(t + Float64(z * b))))
	tmp = 0.0
	if (a <= -8.8e-12)
		tmp = t_1;
	elseif (a <= 2.8e-229)
		tmp = Float64(x + Float64(z * Float64(y + Float64(a * b))));
	elseif (a <= 5.8e-35)
		tmp = Float64(x + Float64(Float64(y * z) + Float64(t * a)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + (a * (t + (z * b)));
	tmp = 0.0;
	if (a <= -8.8e-12)
		tmp = t_1;
	elseif (a <= 2.8e-229)
		tmp = x + (z * (y + (a * b)));
	elseif (a <= 5.8e-35)
		tmp = x + ((y * z) + (t * a));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -8.8e-12], t$95$1, If[LessEqual[a, 2.8e-229], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.8e-35], N[(x + N[(N[(y * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -8.8 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 2.8 \cdot 10^{-229}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\

\mathbf{elif}\;a \leq 5.8 \cdot 10^{-35}:\\
\;\;\;\;x + \left(y \cdot z + t \cdot a\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -8.79999999999999966e-12 or 5.8000000000000004e-35 < a

    1. Initial program 90.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+90.6%

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

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

        \[\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*95.2%

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + \left(t \cdot a + a \cdot \color{blue}{\left(b \cdot z\right)}\right) \]
      6. *-commutative95.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-out99.3%

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

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

      \[\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 92.1%

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

    if -8.79999999999999966e-12 < a < 2.7999999999999999e-229

    1. Initial program 99.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+99.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*82.8%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified82.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 t around 0 76.3%

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

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

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

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

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

    if 2.7999999999999999e-229 < a < 5.8000000000000004e-35

    1. Initial program 100.0%

      \[\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+100.0%

        \[\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 b around 0 94.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -8.8 \cdot 10^{-12}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;a \leq 2.8 \cdot 10^{-229}:\\ \;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;a \leq 5.8 \cdot 10^{-35}:\\ \;\;\;\;x + \left(y \cdot z + t \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 37.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.75 \cdot 10^{+129}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{-253}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{-126}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;x \leq 3.9 \cdot 10^{+138}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= x -1.75e+129)
   x
   (if (<= x 4.4e-253)
     (* t a)
     (if (<= x 2.7e-126) (* z (* a b)) (if (<= x 3.9e+138) (* t a) x)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -1.75e+129) {
		tmp = x;
	} else if (x <= 4.4e-253) {
		tmp = t * a;
	} else if (x <= 2.7e-126) {
		tmp = z * (a * b);
	} else if (x <= 3.9e+138) {
		tmp = t * a;
	} 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 (x <= (-1.75d+129)) then
        tmp = x
    else if (x <= 4.4d-253) then
        tmp = t * a
    else if (x <= 2.7d-126) then
        tmp = z * (a * b)
    else if (x <= 3.9d+138) then
        tmp = t * a
    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 (x <= -1.75e+129) {
		tmp = x;
	} else if (x <= 4.4e-253) {
		tmp = t * a;
	} else if (x <= 2.7e-126) {
		tmp = z * (a * b);
	} else if (x <= 3.9e+138) {
		tmp = t * a;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if x <= -1.75e+129:
		tmp = x
	elif x <= 4.4e-253:
		tmp = t * a
	elif x <= 2.7e-126:
		tmp = z * (a * b)
	elif x <= 3.9e+138:
		tmp = t * a
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= -1.75e+129)
		tmp = x;
	elseif (x <= 4.4e-253)
		tmp = Float64(t * a);
	elseif (x <= 2.7e-126)
		tmp = Float64(z * Float64(a * b));
	elseif (x <= 3.9e+138)
		tmp = Float64(t * a);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (x <= -1.75e+129)
		tmp = x;
	elseif (x <= 4.4e-253)
		tmp = t * a;
	elseif (x <= 2.7e-126)
		tmp = z * (a * b);
	elseif (x <= 3.9e+138)
		tmp = t * a;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.75e+129], x, If[LessEqual[x, 4.4e-253], N[(t * a), $MachinePrecision], If[LessEqual[x, 2.7e-126], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.9e+138], N[(t * a), $MachinePrecision], x]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{+129}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 4.4 \cdot 10^{-253}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;x \leq 2.7 \cdot 10^{-126}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\

\mathbf{elif}\;x \leq 3.9 \cdot 10^{+138}:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.7499999999999999e129 or 3.8999999999999998e138 < x

    1. Initial program 95.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+95.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*96.2%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified96.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 b around 0 87.6%

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

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

    if -1.7499999999999999e129 < x < 4.39999999999999992e-253 or 2.69999999999999995e-126 < x < 3.8999999999999998e138

    1. Initial program 94.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+94.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*90.5%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified90.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 a around inf 88.1%

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

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

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

      \[\leadsto a \cdot \left(t + \color{blue}{z \cdot b}\right) \]
    9. Taylor expanded in t around inf 44.4%

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

    if 4.39999999999999992e-253 < x < 2.69999999999999995e-126

    1. Initial program 93.0%

      \[\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+93.0%

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

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified82.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 z around inf 81.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.75 \cdot 10^{+129}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{-253}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{-126}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;x \leq 3.9 \cdot 10^{+138}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 72.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(t + z \cdot b\right)\\ \mathbf{if}\;a \leq -8.5 \cdot 10^{-7}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 8.5 \cdot 10^{-118}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq 5.4 \cdot 10^{+174}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (+ t (* z b)))))
   (if (<= a -8.5e-7)
     t_1
     (if (<= a 8.5e-118)
       (+ x (* y z))
       (if (<= a 5.4e+174) (+ x (* t a)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (t + (z * b));
	double tmp;
	if (a <= -8.5e-7) {
		tmp = t_1;
	} else if (a <= 8.5e-118) {
		tmp = x + (y * z);
	} else if (a <= 5.4e+174) {
		tmp = x + (t * a);
	} 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 = a * (t + (z * b))
    if (a <= (-8.5d-7)) then
        tmp = t_1
    else if (a <= 8.5d-118) then
        tmp = x + (y * z)
    else if (a <= 5.4d+174) then
        tmp = x + (t * a)
    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 = a * (t + (z * b));
	double tmp;
	if (a <= -8.5e-7) {
		tmp = t_1;
	} else if (a <= 8.5e-118) {
		tmp = x + (y * z);
	} else if (a <= 5.4e+174) {
		tmp = x + (t * a);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (t + (z * b))
	tmp = 0
	if a <= -8.5e-7:
		tmp = t_1
	elif a <= 8.5e-118:
		tmp = x + (y * z)
	elif a <= 5.4e+174:
		tmp = x + (t * a)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(t + Float64(z * b)))
	tmp = 0.0
	if (a <= -8.5e-7)
		tmp = t_1;
	elseif (a <= 8.5e-118)
		tmp = Float64(x + Float64(y * z));
	elseif (a <= 5.4e+174)
		tmp = Float64(x + Float64(t * a));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (t + (z * b));
	tmp = 0.0;
	if (a <= -8.5e-7)
		tmp = t_1;
	elseif (a <= 8.5e-118)
		tmp = x + (y * z);
	elseif (a <= 5.4e+174)
		tmp = x + (t * a);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -8.5e-7], t$95$1, If[LessEqual[a, 8.5e-118], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.4e+174], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -8.5 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 8.5 \cdot 10^{-118}:\\
\;\;\;\;x + y \cdot z\\

\mathbf{elif}\;a \leq 5.4 \cdot 10^{+174}:\\
\;\;\;\;x + t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -8.50000000000000014e-7 or 5.3999999999999998e174 < a

    1. Initial program 87.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+87.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*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 98.9%

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

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

        \[\leadsto a \cdot \left(t + \color{blue}{z \cdot b}\right) \]
    8. Simplified82.1%

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

    if -8.50000000000000014e-7 < a < 8.50000000000000087e-118

    1. Initial program 99.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+99.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*87.4%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified87.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.6%

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

      \[\leadsto \color{blue}{x + y \cdot z} \]
    7. Step-by-step derivation
      1. +-commutative76.1%

        \[\leadsto \color{blue}{y \cdot z + x} \]
    8. Simplified76.1%

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

    if 8.50000000000000087e-118 < a < 5.3999999999999998e174

    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*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 z around 0 64.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -8.5 \cdot 10^{-7}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;a \leq 8.5 \cdot 10^{-118}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq 5.4 \cdot 10^{+174}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 59.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+202}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{+69}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{+136}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= z -4.2e+202)
   (* y z)
   (if (<= z -1.45e+69)
     (* (* z a) b)
     (if (<= z 2.05e+136) (+ x (* t a)) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -4.2e+202) {
		tmp = y * z;
	} else if (z <= -1.45e+69) {
		tmp = (z * a) * b;
	} else if (z <= 2.05e+136) {
		tmp = x + (t * a);
	} else {
		tmp = y * z;
	}
	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 <= (-4.2d+202)) then
        tmp = y * z
    else if (z <= (-1.45d+69)) then
        tmp = (z * a) * b
    else if (z <= 2.05d+136) then
        tmp = x + (t * a)
    else
        tmp = y * z
    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 <= -4.2e+202) {
		tmp = y * z;
	} else if (z <= -1.45e+69) {
		tmp = (z * a) * b;
	} else if (z <= 2.05e+136) {
		tmp = x + (t * a);
	} else {
		tmp = y * z;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if z <= -4.2e+202:
		tmp = y * z
	elif z <= -1.45e+69:
		tmp = (z * a) * b
	elif z <= 2.05e+136:
		tmp = x + (t * a)
	else:
		tmp = y * z
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -4.2e+202)
		tmp = Float64(y * z);
	elseif (z <= -1.45e+69)
		tmp = Float64(Float64(z * a) * b);
	elseif (z <= 2.05e+136)
		tmp = Float64(x + Float64(t * a));
	else
		tmp = Float64(y * z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (z <= -4.2e+202)
		tmp = y * z;
	elseif (z <= -1.45e+69)
		tmp = (z * a) * b;
	elseif (z <= 2.05e+136)
		tmp = x + (t * a);
	else
		tmp = y * z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.2e+202], N[(y * z), $MachinePrecision], If[LessEqual[z, -1.45e+69], N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[z, 2.05e+136], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], N[(y * z), $MachinePrecision]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq 2.05 \cdot 10^{+136}:\\
\;\;\;\;x + t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.2e202 or 2.0499999999999999e136 < z

    1. Initial program 92.0%

      \[\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+92.0%

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

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified80.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 84.3%

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

      \[\leadsto \color{blue}{y \cdot z} \]
    7. Step-by-step derivation
      1. *-commutative67.0%

        \[\leadsto \color{blue}{z \cdot y} \]
    8. Simplified67.0%

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

    if -4.2e202 < z < -1.4499999999999999e69

    1. Initial program 92.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+92.8%

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

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

        \[\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*79.5%

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

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

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

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

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

      \[\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 76.3%

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

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

        \[\leadsto \color{blue}{\left(a \cdot b\right) \cdot z} \]
      2. *-commutative56.5%

        \[\leadsto \color{blue}{\left(b \cdot a\right)} \cdot z \]
      3. associate-*r*66.8%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot z\right)} \]
      4. *-commutative66.8%

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

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

    if -1.4499999999999999e69 < z < 2.0499999999999999e136

    1. Initial program 95.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+95.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*97.2%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified97.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 z around 0 74.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+202}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{+69}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{+136}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 37.5% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.75 \cdot 10^{+129}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{-251}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{+153}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= x -1.75e+129)
   x
   (if (<= x 4.5e-251) (* t a) (if (<= x 3.2e+153) (* (* z a) b) x))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -1.75e+129) {
		tmp = x;
	} else if (x <= 4.5e-251) {
		tmp = t * a;
	} else if (x <= 3.2e+153) {
		tmp = (z * a) * b;
	} 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 (x <= (-1.75d+129)) then
        tmp = x
    else if (x <= 4.5d-251) then
        tmp = t * a
    else if (x <= 3.2d+153) then
        tmp = (z * a) * b
    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 (x <= -1.75e+129) {
		tmp = x;
	} else if (x <= 4.5e-251) {
		tmp = t * a;
	} else if (x <= 3.2e+153) {
		tmp = (z * a) * b;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if x <= -1.75e+129:
		tmp = x
	elif x <= 4.5e-251:
		tmp = t * a
	elif x <= 3.2e+153:
		tmp = (z * a) * b
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= -1.75e+129)
		tmp = x;
	elseif (x <= 4.5e-251)
		tmp = Float64(t * a);
	elseif (x <= 3.2e+153)
		tmp = Float64(Float64(z * a) * b);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (x <= -1.75e+129)
		tmp = x;
	elseif (x <= 4.5e-251)
		tmp = t * a;
	elseif (x <= 3.2e+153)
		tmp = (z * a) * b;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.75e+129], x, If[LessEqual[x, 4.5e-251], N[(t * a), $MachinePrecision], If[LessEqual[x, 3.2e+153], N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision], x]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{+129}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 4.5 \cdot 10^{-251}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;x \leq 3.2 \cdot 10^{+153}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.7499999999999999e129 or 3.2000000000000001e153 < x

    1. Initial program 95.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+95.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*96.0%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified96.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 b around 0 89.0%

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

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

    if -1.7499999999999999e129 < x < 4.49999999999999978e-251

    1. Initial program 94.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+94.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.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 a around inf 89.2%

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

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

        \[\leadsto a \cdot \left(t + \color{blue}{z \cdot b}\right) \]
    8. Simplified62.4%

      \[\leadsto a \cdot \left(t + \color{blue}{z \cdot b}\right) \]
    9. Taylor expanded in t around inf 43.4%

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

    if 4.49999999999999978e-251 < x < 3.2000000000000001e153

    1. Initial program 93.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+93.9%

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

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

        \[\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*83.5%

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

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

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

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

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

      \[\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 69.9%

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

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

        \[\leadsto \color{blue}{\left(a \cdot b\right) \cdot z} \]
      2. *-commutative40.5%

        \[\leadsto \color{blue}{\left(b \cdot a\right)} \cdot z \]
      3. associate-*r*42.5%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot z\right)} \]
      4. *-commutative42.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.75 \cdot 10^{+129}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{-251}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{+153}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 86.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2.5 \cdot 10^{-11} \lor \neg \left(a \leq 1.1 \cdot 10^{-118}\right):\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= a -2.5e-11) (not (<= a 1.1e-118)))
   (+ x (* a (+ t (* z b))))
   (+ x (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((a <= -2.5e-11) || !(a <= 1.1e-118)) {
		tmp = x + (a * (t + (z * b)));
	} else {
		tmp = x + (z * (y + (a * 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 <= (-2.5d-11)) .or. (.not. (a <= 1.1d-118))) then
        tmp = x + (a * (t + (z * b)))
    else
        tmp = x + (z * (y + (a * 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 <= -2.5e-11) || !(a <= 1.1e-118)) {
		tmp = x + (a * (t + (z * b)));
	} else {
		tmp = x + (z * (y + (a * b)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (a <= -2.5e-11) or not (a <= 1.1e-118):
		tmp = x + (a * (t + (z * b)))
	else:
		tmp = x + (z * (y + (a * b)))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((a <= -2.5e-11) || !(a <= 1.1e-118))
		tmp = Float64(x + Float64(a * Float64(t + Float64(z * b))));
	else
		tmp = Float64(x + Float64(z * Float64(y + Float64(a * b))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((a <= -2.5e-11) || ~((a <= 1.1e-118)))
		tmp = x + (a * (t + (z * b)));
	else
		tmp = x + (z * (y + (a * b)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.5e-11], N[Not[LessEqual[a, 1.1e-118]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{-11} \lor \neg \left(a \leq 1.1 \cdot 10^{-118}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.50000000000000009e-11 or 1.09999999999999992e-118 < a

    1. Initial program 91.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+91.3%

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

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

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

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

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

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

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

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

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

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

    if -2.50000000000000009e-11 < a < 1.09999999999999992e-118

    1. Initial program 99.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+99.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*87.2%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified87.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 t around 0 78.5%

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

        \[\leadsto x + \left(\color{blue}{\left(a \cdot b\right) \cdot z} + y \cdot z\right) \]
      2. distribute-rgt-in91.2%

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

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

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

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

Alternative 10: 82.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.25 \cdot 10^{-12} \lor \neg \left(a \leq 1.95 \cdot 10^{-149}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.2499999999999999e-12 or 1.9500000000000001e-149 < a

    1. Initial program 91.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+91.8%

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

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

        \[\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*95.2%

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + \left(t \cdot a + a \cdot \color{blue}{\left(b \cdot z\right)}\right) \]
      6. *-commutative95.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-out98.8%

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

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

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

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

    if -2.2499999999999999e-12 < a < 1.9500000000000001e-149

    1. Initial program 99.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+99.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*85.9%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified85.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 b around 0 85.0%

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

      \[\leadsto \color{blue}{x + y \cdot z} \]
    7. Step-by-step derivation
      1. +-commutative77.4%

        \[\leadsto \color{blue}{y \cdot z + x} \]
    8. Simplified77.4%

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

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

Alternative 11: 73.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -215000000000 \lor \neg \left(z \leq 1.3 \cdot 10^{+55}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.15e11 or 1.3e55 < z

    1. Initial program 89.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+89.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*82.6%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified82.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 74.2%

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

    if -2.15e11 < z < 1.3e55

    1. Initial program 97.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+97.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*98.6%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified98.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 0 80.1%

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

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

Alternative 12: 63.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.3 \cdot 10^{+127} \lor \neg \left(y \leq 4.8 \cdot 10^{+67}\right):\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot a\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= y -2.3e+127) (not (<= y 4.8e+67))) (+ x (* y z)) (+ x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y <= -2.3e+127) || !(y <= 4.8e+67)) {
		tmp = x + (y * z);
	} else {
		tmp = x + (t * a);
	}
	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 <= (-2.3d+127)) .or. (.not. (y <= 4.8d+67))) then
        tmp = x + (y * z)
    else
        tmp = x + (t * a)
    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 <= -2.3e+127) || !(y <= 4.8e+67)) {
		tmp = x + (y * z);
	} else {
		tmp = x + (t * a);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (y <= -2.3e+127) or not (y <= 4.8e+67):
		tmp = x + (y * z)
	else:
		tmp = x + (t * a)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((y <= -2.3e+127) || !(y <= 4.8e+67))
		tmp = Float64(x + Float64(y * z));
	else
		tmp = Float64(x + Float64(t * a));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((y <= -2.3e+127) || ~((y <= 4.8e+67)))
		tmp = x + (y * z);
	else
		tmp = x + (t * a);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.3e+127], N[Not[LessEqual[y, 4.8e+67]], $MachinePrecision]], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+127} \lor \neg \left(y \leq 4.8 \cdot 10^{+67}\right):\\
\;\;\;\;x + y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.3000000000000002e127 or 4.80000000000000004e67 < y

    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*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 b around 0 90.9%

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

      \[\leadsto \color{blue}{x + y \cdot z} \]
    7. Step-by-step derivation
      1. +-commutative81.0%

        \[\leadsto \color{blue}{y \cdot z + x} \]
    8. Simplified81.0%

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

    if -2.3000000000000002e127 < y < 4.80000000000000004e67

    1. Initial program 93.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+93.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*91.7%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified91.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 z around 0 69.1%

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

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

Alternative 13: 37.9% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.8 \cdot 10^{+129}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.08 \cdot 10^{+139}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= x -1.8e+129) x (if (<= x 1.08e+139) (* t a) x)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -1.8e+129) {
		tmp = x;
	} else if (x <= 1.08e+139) {
		tmp = t * a;
	} 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 (x <= (-1.8d+129)) then
        tmp = x
    else if (x <= 1.08d+139) then
        tmp = t * a
    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 (x <= -1.8e+129) {
		tmp = x;
	} else if (x <= 1.08e+139) {
		tmp = t * a;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if x <= -1.8e+129:
		tmp = x
	elif x <= 1.08e+139:
		tmp = t * a
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= -1.8e+129)
		tmp = x;
	elseif (x <= 1.08e+139)
		tmp = Float64(t * a);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (x <= -1.8e+129)
		tmp = x;
	elseif (x <= 1.08e+139)
		tmp = t * a;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.8e+129], x, If[LessEqual[x, 1.08e+139], N[(t * a), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.8 \cdot 10^{+129}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 1.08 \cdot 10^{+139}:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.8000000000000001e129 or 1.08000000000000004e139 < x

    1. Initial program 95.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+95.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*96.2%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified96.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 b around 0 87.6%

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

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

    if -1.8000000000000001e129 < x < 1.08000000000000004e139

    1. Initial program 94.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+94.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*89.0%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified89.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 a around inf 86.4%

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

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

        \[\leadsto a \cdot \left(t + \color{blue}{z \cdot b}\right) \]
    8. Simplified61.4%

      \[\leadsto a \cdot \left(t + \color{blue}{z \cdot b}\right) \]
    9. Taylor expanded in t around inf 40.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.8 \cdot 10^{+129}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.08 \cdot 10^{+139}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 26.4% 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 94.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+94.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*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 b around 0 81.5%

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

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

Developer Target 1: 97.2% 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 2024148 
(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)))