Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.2% → 97.7%
Time: 13.5s
Alternatives: 14
Speedup: 0.7×

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.2% 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: 97.7% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.5000000000000002e136

    1. Initial program 87.5%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]

    if -7.5000000000000002e136 < z < 4.9999999999999999e-13

    1. Initial program 96.8%

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

      \[\leadsto expr\]
    3. Add Preprocessing

    if 4.9999999999999999e-13 < z

    1. Initial program 78.1%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 2: 98.6% accurate, 0.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(a \cdot \left(b + \frac{t}{z}\right) + y\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)) < 1.9999999999999999e298

    1. Initial program 98.5%

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

    if 1.9999999999999999e298 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b))

    1. Initial program 61.0%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 74.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(t + b \cdot z\right)\\ \mathbf{if}\;a \leq -1.9 \cdot 10^{+60}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -1.12 \cdot 10^{-66}:\\ \;\;\;\;a \cdot t + z \cdot y\\ \mathbf{elif}\;a \leq -7 \cdot 10^{-92}:\\ \;\;\;\;x + \left(a \cdot z\right) \cdot b\\ \mathbf{elif}\;a \leq 1.2 \cdot 10^{-38}:\\ \;\;\;\;z \cdot y + x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (+ t (* b z)))))
   (if (<= a -1.9e+60)
     t_1
     (if (<= a -1.12e-66)
       (+ (* a t) (* z y))
       (if (<= a -7e-92)
         (+ x (* (* a z) b))
         (if (<= a 1.2e-38) (+ (* z y) x) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (t + (b * z));
	double tmp;
	if (a <= -1.9e+60) {
		tmp = t_1;
	} else if (a <= -1.12e-66) {
		tmp = (a * t) + (z * y);
	} else if (a <= -7e-92) {
		tmp = x + ((a * z) * b);
	} else if (a <= 1.2e-38) {
		tmp = (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 = a * (t + (b * z))
    if (a <= (-1.9d+60)) then
        tmp = t_1
    else if (a <= (-1.12d-66)) then
        tmp = (a * t) + (z * y)
    else if (a <= (-7d-92)) then
        tmp = x + ((a * z) * b)
    else if (a <= 1.2d-38) then
        tmp = (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 = a * (t + (b * z));
	double tmp;
	if (a <= -1.9e+60) {
		tmp = t_1;
	} else if (a <= -1.12e-66) {
		tmp = (a * t) + (z * y);
	} else if (a <= -7e-92) {
		tmp = x + ((a * z) * b);
	} else if (a <= 1.2e-38) {
		tmp = (z * y) + x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (t + (b * z))
	tmp = 0
	if a <= -1.9e+60:
		tmp = t_1
	elif a <= -1.12e-66:
		tmp = (a * t) + (z * y)
	elif a <= -7e-92:
		tmp = x + ((a * z) * b)
	elif a <= 1.2e-38:
		tmp = (z * y) + x
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(t + Float64(b * z)))
	tmp = 0.0
	if (a <= -1.9e+60)
		tmp = t_1;
	elseif (a <= -1.12e-66)
		tmp = Float64(Float64(a * t) + Float64(z * y));
	elseif (a <= -7e-92)
		tmp = Float64(x + Float64(Float64(a * z) * b));
	elseif (a <= 1.2e-38)
		tmp = 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 = a * (t + (b * z));
	tmp = 0.0;
	if (a <= -1.9e+60)
		tmp = t_1;
	elseif (a <= -1.12e-66)
		tmp = (a * t) + (z * y);
	elseif (a <= -7e-92)
		tmp = x + ((a * z) * b);
	elseif (a <= 1.2e-38)
		tmp = (z * y) + x;
	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[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.9e+60], t$95$1, If[LessEqual[a, -1.12e-66], N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -7e-92], N[(x + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.2e-38], N[(N[(z * y), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -1.12 \cdot 10^{-66}:\\
\;\;\;\;a \cdot t + z \cdot y\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.90000000000000005e60 or 1.20000000000000011e-38 < a

    1. Initial program 81.8%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in a around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if -1.90000000000000005e60 < a < -1.12000000000000004e-66

    1. Initial program 97.2%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Taylor expanded in t around inf 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]

    if -1.12000000000000004e-66 < a < -7e-92

    1. Initial program 99.8%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -7e-92 < a < 1.20000000000000011e-38

    1. Initial program 99.0%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in a around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 4: 38.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{-37}:\\
\;\;\;\;b \cdot \left(a \cdot z\right)\\

\mathbf{elif}\;z \leq 2.1 \cdot 10^{-289}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 4.5 \cdot 10^{-122}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;z \leq 2.8 \cdot 10^{+122}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.85e-37

    1. Initial program 86.3%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in b around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if -1.85e-37 < z < 2.0999999999999998e-289 or 4.4999999999999998e-122 < z < 2.8e122

    1. Initial program 99.1%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if 2.0999999999999998e-289 < z < 4.4999999999999998e-122

    1. Initial program 99.8%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if 2.8e122 < z

    1. Initial program 62.3%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in b around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Applied egg-rr0

      \[\leadsto expr\]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 5: 38.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{-39}:\\
\;\;\;\;b \cdot \left(a \cdot z\right)\\

\mathbf{elif}\;z \leq 6 \cdot 10^{-290}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 3.8 \cdot 10^{-122}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;z \leq 2.5 \cdot 10^{+122}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.1999999999999998e-39

    1. Initial program 86.3%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in b around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if -3.1999999999999998e-39 < z < 5.99999999999999985e-290 or 3.8000000000000001e-122 < z < 2.49999999999999994e122

    1. Initial program 99.1%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if 5.99999999999999985e-290 < z < 3.8000000000000001e-122

    1. Initial program 99.8%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if 2.49999999999999994e122 < z

    1. Initial program 62.3%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in b around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Applied egg-rr0

      \[\leadsto expr\]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 6: 38.7% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq 2.2 \cdot 10^{-291}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 4.7 \cdot 10^{-122}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;z \leq 2.4 \cdot 10^{+122}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.09999999999999991e-36 or 2.4000000000000002e122 < z

    1. Initial program 78.2%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in b around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if -2.09999999999999991e-36 < z < 2.20000000000000002e-291 or 4.6999999999999999e-122 < z < 2.4000000000000002e122

    1. Initial program 99.1%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if 2.20000000000000002e-291 < z < 4.6999999999999999e-122

    1. Initial program 99.8%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 7: 95.0% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.39999999999999988e-62 or 7.2e-152 < z

    1. Initial program 86.4%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if -3.39999999999999988e-62 < z < 7.2e-152

    1. Initial program 99.9%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in b around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 8: 86.4% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.75e-12 or 3.8999999999999998e120 < z

    1. Initial program 77.7%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    7. Simplified0

      \[\leadsto expr\]

    if -1.75e-12 < z < 3.8999999999999998e120

    1. Initial program 99.3%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in b around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 9: 59.5% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;a \leq -2.9 \cdot 10^{+37}:\\
\;\;\;\;a \cdot t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.8500000000000001e109 or 6.60000000000000011e125 < a

    1. Initial program 78.5%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in b around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if -1.8500000000000001e109 < a < -2.89999999999999978e37

    1. Initial program 83.7%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if -2.89999999999999978e37 < a < 6.60000000000000011e125

    1. Initial program 98.1%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in a around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 10: 83.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(t + b \cdot z\right)\\ \mathbf{if}\;a \leq -2.2 \cdot 10^{+60}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 8 \cdot 10^{+114}:\\ \;\;\;\;a \cdot t + \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 (* a (+ t (* b z)))))
   (if (<= a -2.2e+60) t_1 (if (<= a 8e+114) (+ (* a t) (+ (* z y) x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (t + (b * z));
	double tmp;
	if (a <= -2.2e+60) {
		tmp = t_1;
	} else if (a <= 8e+114) {
		tmp = (a * t) + ((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 = a * (t + (b * z))
    if (a <= (-2.2d+60)) then
        tmp = t_1
    else if (a <= 8d+114) then
        tmp = (a * t) + ((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 = a * (t + (b * z));
	double tmp;
	if (a <= -2.2e+60) {
		tmp = t_1;
	} else if (a <= 8e+114) {
		tmp = (a * t) + ((z * y) + x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (t + (b * z))
	tmp = 0
	if a <= -2.2e+60:
		tmp = t_1
	elif a <= 8e+114:
		tmp = (a * t) + ((z * y) + x)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(t + Float64(b * z)))
	tmp = 0.0
	if (a <= -2.2e+60)
		tmp = t_1;
	elseif (a <= 8e+114)
		tmp = Float64(Float64(a * t) + 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 = a * (t + (b * z));
	tmp = 0.0;
	if (a <= -2.2e+60)
		tmp = t_1;
	elseif (a <= 8e+114)
		tmp = (a * t) + ((z * y) + x);
	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[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.2e+60], t$95$1, If[LessEqual[a, 8e+114], N[(N[(a * t), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.19999999999999996e60 or 8e114 < a

    1. Initial program 78.2%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in a around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if -2.19999999999999996e60 < a < 8e114

    1. Initial program 97.7%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in b around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 11: 39.9% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;x \leq -1.25 \cdot 10^{-257}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;x \leq 3300000000000:\\
\;\;\;\;z \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.29999999999999988e34 or 3.3e12 < x

    1. Initial program 89.6%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if -3.29999999999999988e34 < x < -1.24999999999999997e-257

    1. Initial program 94.5%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if -1.24999999999999997e-257 < x < 3.3e12

    1. Initial program 90.8%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 12: 75.1% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -7.2e-40 or 6.7999999999999997e-41 < a

    1. Initial program 84.8%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in a around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if -7.2e-40 < a < 6.7999999999999997e-41

    1. Initial program 99.1%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in a around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 13: 39.9% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;t \leq 10500:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.1999999999999996e73 or 10500 < t

    1. Initial program 85.9%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if -8.1999999999999996e73 < t < 10500

    1. Initial program 94.7%

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

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 14: 27.1% 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.0%

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

    \[\leadsto expr\]
  3. Add Preprocessing
  4. Taylor expanded in x around inf 0

    \[\leadsto expr\]
  5. Simplified0

    \[\leadsto expr\]
  6. Add Preprocessing

Developer target: 97.1% 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 2024110 
(FPCore (x y z t a b)
  :name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
  :precision binary64

  :alt
  (if (< z -11820553527347888000.0) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 4.7589743188364287e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))

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