Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3

Percentage Accurate: 97.3% → 99.7%
Time: 11.2s
Alternatives: 11
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
	return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
    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
    code = x - ((y - z) / (((t - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a):
	return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a)
	return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a)))
end
function tmp = code(x, y, z, t, a)
	tmp = x - ((y - z) / (((t - z) + 1.0) / a));
end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 97.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
	return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
    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
    code = x - ((y - z) / (((t - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a):
	return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a)
	return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a)))
end
function tmp = code(x, y, z, t, a)
	tmp = x - ((y - z) / (((t - z) + 1.0) / a));
end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}

Alternative 1: 99.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + a \cdot \frac{z - y}{\left(t - z\right) + 1} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (+ x (* a (/ (- z y) (+ (- t z) 1.0)))))
double code(double x, double y, double z, double t, double a) {
	return x + (a * ((z - y) / ((t - z) + 1.0)));
}
real(8) function code(x, y, z, t, a)
    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
    code = x + (a * ((z - y) / ((t - z) + 1.0d0)))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (a * ((z - y) / ((t - z) + 1.0)));
}
def code(x, y, z, t, a):
	return x + (a * ((z - y) / ((t - z) + 1.0)))
function code(x, y, z, t, a)
	return Float64(x + Float64(a * Float64(Float64(z - y) / Float64(Float64(t - z) + 1.0))))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (a * ((z - y) / ((t - z) + 1.0)));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + a \cdot \frac{z - y}{\left(t - z\right) + 1}
\end{array}
Derivation
  1. Initial program 96.9%

    \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
  2. Step-by-step derivation
    1. associate-/r/99.5%

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

    \[\leadsto \color{blue}{x - \frac{y - z}{\left(t - z\right) + 1} \cdot a} \]
  4. Add Preprocessing
  5. Final simplification99.5%

    \[\leadsto x + a \cdot \frac{z - y}{\left(t - z\right) + 1} \]
  6. Add Preprocessing

Alternative 2: 70.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - y \cdot a\\ t_2 := x - \frac{a}{\frac{t}{y}}\\ \mathbf{if}\;t \leq -600:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq -5.7 \cdot 10^{-196}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{-190}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 10^{-44}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{-32}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (* y a))) (t_2 (- x (/ a (/ t y)))))
   (if (<= t -600.0)
     t_2
     (if (<= t -5.7e-196)
       (- x a)
       (if (<= t 2.4e-190)
         t_1
         (if (<= t 1e-44) (- x a) (if (<= t 1.05e-32) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (y * a);
	double t_2 = x - (a / (t / y));
	double tmp;
	if (t <= -600.0) {
		tmp = t_2;
	} else if (t <= -5.7e-196) {
		tmp = x - a;
	} else if (t <= 2.4e-190) {
		tmp = t_1;
	} else if (t <= 1e-44) {
		tmp = x - a;
	} else if (t <= 1.05e-32) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x - (y * a)
    t_2 = x - (a / (t / y))
    if (t <= (-600.0d0)) then
        tmp = t_2
    else if (t <= (-5.7d-196)) then
        tmp = x - a
    else if (t <= 2.4d-190) then
        tmp = t_1
    else if (t <= 1d-44) then
        tmp = x - a
    else if (t <= 1.05d-32) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (y * a);
	double t_2 = x - (a / (t / y));
	double tmp;
	if (t <= -600.0) {
		tmp = t_2;
	} else if (t <= -5.7e-196) {
		tmp = x - a;
	} else if (t <= 2.4e-190) {
		tmp = t_1;
	} else if (t <= 1e-44) {
		tmp = x - a;
	} else if (t <= 1.05e-32) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - (y * a)
	t_2 = x - (a / (t / y))
	tmp = 0
	if t <= -600.0:
		tmp = t_2
	elif t <= -5.7e-196:
		tmp = x - a
	elif t <= 2.4e-190:
		tmp = t_1
	elif t <= 1e-44:
		tmp = x - a
	elif t <= 1.05e-32:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(y * a))
	t_2 = Float64(x - Float64(a / Float64(t / y)))
	tmp = 0.0
	if (t <= -600.0)
		tmp = t_2;
	elseif (t <= -5.7e-196)
		tmp = Float64(x - a);
	elseif (t <= 2.4e-190)
		tmp = t_1;
	elseif (t <= 1e-44)
		tmp = Float64(x - a);
	elseif (t <= 1.05e-32)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x - (y * a);
	t_2 = x - (a / (t / y));
	tmp = 0.0;
	if (t <= -600.0)
		tmp = t_2;
	elseif (t <= -5.7e-196)
		tmp = x - a;
	elseif (t <= 2.4e-190)
		tmp = t_1;
	elseif (t <= 1e-44)
		tmp = x - a;
	elseif (t <= 1.05e-32)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -600.0], t$95$2, If[LessEqual[t, -5.7e-196], N[(x - a), $MachinePrecision], If[LessEqual[t, 2.4e-190], t$95$1, If[LessEqual[t, 1e-44], N[(x - a), $MachinePrecision], If[LessEqual[t, 1.05e-32], t$95$1, t$95$2]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x - y \cdot a\\
t_2 := x - \frac{a}{\frac{t}{y}}\\
\mathbf{if}\;t \leq -600:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq -5.7 \cdot 10^{-196}:\\
\;\;\;\;x - a\\

\mathbf{elif}\;t \leq 2.4 \cdot 10^{-190}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 10^{-44}:\\
\;\;\;\;x - a\\

\mathbf{elif}\;t \leq 1.05 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -600 or 1.05e-32 < t

    1. Initial program 95.2%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Step-by-step derivation
      1. associate-/r/99.2%

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

      \[\leadsto \color{blue}{x - \frac{y - z}{\left(t - z\right) + 1} \cdot a} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative99.2%

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

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

        \[\leadsto x - \color{blue}{\frac{a}{\frac{\left(t - z\right) + 1}{y - z}}} \]
    6. Applied egg-rr99.2%

      \[\leadsto x - \color{blue}{\frac{a}{\frac{\left(t - z\right) + 1}{y - z}}} \]
    7. Taylor expanded in z around 0 87.9%

      \[\leadsto x - \frac{a}{\color{blue}{\frac{1 + t}{y}}} \]
    8. Taylor expanded in t around inf 87.2%

      \[\leadsto x - \frac{a}{\color{blue}{\frac{t}{y}}} \]

    if -600 < t < -5.7000000000000002e-196 or 2.4e-190 < t < 9.99999999999999953e-45

    1. Initial program 98.2%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Step-by-step derivation
      1. associate-/r/99.8%

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

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

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

    if -5.7000000000000002e-196 < t < 2.4e-190 or 9.99999999999999953e-45 < t < 1.05e-32

    1. Initial program 99.9%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 99.9%

      \[\leadsto x - \frac{y - z}{\frac{\color{blue}{1 - z}}{a}} \]
    4. Taylor expanded in z around 0 82.4%

      \[\leadsto x - \color{blue}{a \cdot y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification81.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -600:\\ \;\;\;\;x - \frac{a}{\frac{t}{y}}\\ \mathbf{elif}\;t \leq -5.7 \cdot 10^{-196}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{-190}:\\ \;\;\;\;x - y \cdot a\\ \mathbf{elif}\;t \leq 10^{-44}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{-32}:\\ \;\;\;\;x - y \cdot a\\ \mathbf{else}:\\ \;\;\;\;x - \frac{a}{\frac{t}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 72.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + a \cdot \frac{z}{1 - z}\\ t_2 := x - \frac{a}{\frac{t}{y}}\\ \mathbf{if}\;t \leq -4.4 \cdot 10^{+34}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq -1.95 \cdot 10^{-197}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 3.7 \cdot 10^{-190}:\\ \;\;\;\;x - y \cdot a\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{-37}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* a (/ z (- 1.0 z))))) (t_2 (- x (/ a (/ t y)))))
   (if (<= t -4.4e+34)
     t_2
     (if (<= t -1.95e-197)
       t_1
       (if (<= t 3.7e-190) (- x (* y a)) (if (<= t 2.8e-37) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (a * (z / (1.0 - z)));
	double t_2 = x - (a / (t / y));
	double tmp;
	if (t <= -4.4e+34) {
		tmp = t_2;
	} else if (t <= -1.95e-197) {
		tmp = t_1;
	} else if (t <= 3.7e-190) {
		tmp = x - (y * a);
	} else if (t <= 2.8e-37) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x + (a * (z / (1.0d0 - z)))
    t_2 = x - (a / (t / y))
    if (t <= (-4.4d+34)) then
        tmp = t_2
    else if (t <= (-1.95d-197)) then
        tmp = t_1
    else if (t <= 3.7d-190) then
        tmp = x - (y * a)
    else if (t <= 2.8d-37) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (a * (z / (1.0 - z)));
	double t_2 = x - (a / (t / y));
	double tmp;
	if (t <= -4.4e+34) {
		tmp = t_2;
	} else if (t <= -1.95e-197) {
		tmp = t_1;
	} else if (t <= 3.7e-190) {
		tmp = x - (y * a);
	} else if (t <= 2.8e-37) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (a * (z / (1.0 - z)))
	t_2 = x - (a / (t / y))
	tmp = 0
	if t <= -4.4e+34:
		tmp = t_2
	elif t <= -1.95e-197:
		tmp = t_1
	elif t <= 3.7e-190:
		tmp = x - (y * a)
	elif t <= 2.8e-37:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(a * Float64(z / Float64(1.0 - z))))
	t_2 = Float64(x - Float64(a / Float64(t / y)))
	tmp = 0.0
	if (t <= -4.4e+34)
		tmp = t_2;
	elseif (t <= -1.95e-197)
		tmp = t_1;
	elseif (t <= 3.7e-190)
		tmp = Float64(x - Float64(y * a));
	elseif (t <= 2.8e-37)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (a * (z / (1.0 - z)));
	t_2 = x - (a / (t / y));
	tmp = 0.0;
	if (t <= -4.4e+34)
		tmp = t_2;
	elseif (t <= -1.95e-197)
		tmp = t_1;
	elseif (t <= 3.7e-190)
		tmp = x - (y * a);
	elseif (t <= 2.8e-37)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(a * N[(z / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.4e+34], t$95$2, If[LessEqual[t, -1.95e-197], t$95$1, If[LessEqual[t, 3.7e-190], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.8e-37], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + a \cdot \frac{z}{1 - z}\\
t_2 := x - \frac{a}{\frac{t}{y}}\\
\mathbf{if}\;t \leq -4.4 \cdot 10^{+34}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq -1.95 \cdot 10^{-197}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 3.7 \cdot 10^{-190}:\\
\;\;\;\;x - y \cdot a\\

\mathbf{elif}\;t \leq 2.8 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.4000000000000005e34 or 2.8000000000000001e-37 < t

    1. Initial program 95.6%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Step-by-step derivation
      1. associate-/r/99.2%

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

      \[\leadsto \color{blue}{x - \frac{y - z}{\left(t - z\right) + 1} \cdot a} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative99.2%

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

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

        \[\leadsto x - \color{blue}{\frac{a}{\frac{\left(t - z\right) + 1}{y - z}}} \]
    6. Applied egg-rr99.2%

      \[\leadsto x - \color{blue}{\frac{a}{\frac{\left(t - z\right) + 1}{y - z}}} \]
    7. Taylor expanded in z around 0 88.7%

      \[\leadsto x - \frac{a}{\color{blue}{\frac{1 + t}{y}}} \]
    8. Taylor expanded in t around inf 87.8%

      \[\leadsto x - \frac{a}{\color{blue}{\frac{t}{y}}} \]

    if -4.4000000000000005e34 < t < -1.95e-197 or 3.7000000000000002e-190 < t < 2.8000000000000001e-37

    1. Initial program 97.1%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 95.7%

      \[\leadsto x - \frac{y - z}{\frac{\color{blue}{1 - z}}{a}} \]
    4. Taylor expanded in y around 0 67.7%

      \[\leadsto \color{blue}{x - -1 \cdot \frac{a \cdot z}{1 - z}} \]
    5. Step-by-step derivation
      1. sub-neg67.7%

        \[\leadsto \color{blue}{x + \left(--1 \cdot \frac{a \cdot z}{1 - z}\right)} \]
      2. mul-1-neg67.7%

        \[\leadsto x + \left(-\color{blue}{\left(-\frac{a \cdot z}{1 - z}\right)}\right) \]
      3. remove-double-neg67.7%

        \[\leadsto x + \color{blue}{\frac{a \cdot z}{1 - z}} \]
      4. associate-/l*79.5%

        \[\leadsto x + \color{blue}{a \cdot \frac{z}{1 - z}} \]
    6. Simplified79.5%

      \[\leadsto \color{blue}{x + a \cdot \frac{z}{1 - z}} \]

    if -1.95e-197 < t < 3.7000000000000002e-190

    1. Initial program 99.9%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 99.9%

      \[\leadsto x - \frac{y - z}{\frac{\color{blue}{1 - z}}{a}} \]
    4. Taylor expanded in z around 0 81.1%

      \[\leadsto x - \color{blue}{a \cdot y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification84.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.4 \cdot 10^{+34}:\\ \;\;\;\;x - \frac{a}{\frac{t}{y}}\\ \mathbf{elif}\;t \leq -1.95 \cdot 10^{-197}:\\ \;\;\;\;x + a \cdot \frac{z}{1 - z}\\ \mathbf{elif}\;t \leq 3.7 \cdot 10^{-190}:\\ \;\;\;\;x - y \cdot a\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{-37}:\\ \;\;\;\;x + a \cdot \frac{z}{1 - z}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{a}{\frac{t}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 90.8% accurate, 0.6× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x + \frac{z - y}{\frac{1 - z}{a}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.3000000000000001e38 or 1.15e10 < t

    1. Initial program 95.3%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Step-by-step derivation
      1. associate-/r/99.1%

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

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

      \[\leadsto x - \color{blue}{\frac{y - z}{t}} \cdot a \]

    if -2.3000000000000001e38 < t < 1.15e10

    1. Initial program 98.4%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 97.7%

      \[\leadsto x - \frac{y - z}{\frac{\color{blue}{1 - z}}{a}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification94.9%

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

Alternative 5: 88.6% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+44} \lor \neg \left(z \leq 1.1 \cdot 10^{+14}\right):\\
\;\;\;\;x + \left(a \cdot \frac{y}{z} - a\right)\\

\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.3e44 or 1.1e14 < z

    1. Initial program 94.2%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Step-by-step derivation
      1. associate-/r/99.9%

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

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

      \[\leadsto x - \frac{y - z}{\color{blue}{-1 \cdot z}} \cdot a \]
    6. Step-by-step derivation
      1. mul-1-neg94.8%

        \[\leadsto x - \frac{y - z}{\color{blue}{-z}} \cdot a \]
    7. Simplified94.8%

      \[\leadsto x - \frac{y - z}{\color{blue}{-z}} \cdot a \]
    8. Taylor expanded in y around 0 88.3%

      \[\leadsto x - \color{blue}{\left(a + -1 \cdot \frac{a \cdot y}{z}\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg88.3%

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

        \[\leadsto x - \color{blue}{\left(a - \frac{a \cdot y}{z}\right)} \]
      3. associate-/l*94.8%

        \[\leadsto x - \left(a - \color{blue}{a \cdot \frac{y}{z}}\right) \]
    10. Simplified94.8%

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

    if -1.3e44 < z < 1.1e14

    1. Initial program 99.1%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Step-by-step derivation
      1. associate-/r/99.2%

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

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

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

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

Alternative 6: 88.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+43} \lor \neg \left(z \leq 440000000000\right):\\
\;\;\;\;x + \left(\frac{a}{\frac{z}{y}} - a\right)\\

\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.10000000000000002e43 or 4.4e11 < z

    1. Initial program 94.2%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Step-by-step derivation
      1. associate-/r/99.9%

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

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

      \[\leadsto x - \frac{y - z}{\color{blue}{-1 \cdot z}} \cdot a \]
    6. Step-by-step derivation
      1. mul-1-neg94.8%

        \[\leadsto x - \frac{y - z}{\color{blue}{-z}} \cdot a \]
    7. Simplified94.8%

      \[\leadsto x - \frac{y - z}{\color{blue}{-z}} \cdot a \]
    8. Taylor expanded in y around 0 88.3%

      \[\leadsto x - \color{blue}{\left(a + -1 \cdot \frac{a \cdot y}{z}\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg88.3%

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

        \[\leadsto x - \color{blue}{\left(a - \frac{a \cdot y}{z}\right)} \]
      3. associate-/l*94.8%

        \[\leadsto x - \left(a - \color{blue}{a \cdot \frac{y}{z}}\right) \]
    10. Simplified94.8%

      \[\leadsto x - \color{blue}{\left(a - a \cdot \frac{y}{z}\right)} \]
    11. Taylor expanded in a around 0 88.3%

      \[\leadsto x - \left(a - \color{blue}{\frac{a \cdot y}{z}}\right) \]
    12. Step-by-step derivation
      1. associate-*l/94.3%

        \[\leadsto x - \left(a - \color{blue}{\frac{a}{z} \cdot y}\right) \]
      2. associate-/r/94.8%

        \[\leadsto x - \left(a - \color{blue}{\frac{a}{\frac{z}{y}}}\right) \]
    13. Simplified94.8%

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

    if -2.10000000000000002e43 < z < 4.4e11

    1. Initial program 99.1%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Step-by-step derivation
      1. associate-/r/99.2%

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

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

      \[\leadsto x - \color{blue}{\frac{y}{1 + t}} \cdot a \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.5%

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

Alternative 7: 84.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{+121}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{-11}:\\ \;\;\;\;x + a \cdot \frac{y}{-1 - t}\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \frac{z}{1 - z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -5.2e+121)
   (- x a)
   (if (<= z 1.95e-11)
     (+ x (* a (/ y (- -1.0 t))))
     (+ x (* a (/ z (- 1.0 z)))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -5.2e+121) {
		tmp = x - a;
	} else if (z <= 1.95e-11) {
		tmp = x + (a * (y / (-1.0 - t)));
	} else {
		tmp = x + (a * (z / (1.0 - z)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    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) :: tmp
    if (z <= (-5.2d+121)) then
        tmp = x - a
    else if (z <= 1.95d-11) then
        tmp = x + (a * (y / ((-1.0d0) - t)))
    else
        tmp = x + (a * (z / (1.0d0 - z)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -5.2e+121) {
		tmp = x - a;
	} else if (z <= 1.95e-11) {
		tmp = x + (a * (y / (-1.0 - t)));
	} else {
		tmp = x + (a * (z / (1.0 - z)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -5.2e+121:
		tmp = x - a
	elif z <= 1.95e-11:
		tmp = x + (a * (y / (-1.0 - t)))
	else:
		tmp = x + (a * (z / (1.0 - z)))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -5.2e+121)
		tmp = Float64(x - a);
	elseif (z <= 1.95e-11)
		tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t))));
	else
		tmp = Float64(x + Float64(a * Float64(z / Float64(1.0 - z))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -5.2e+121)
		tmp = x - a;
	elseif (z <= 1.95e-11)
		tmp = x + (a * (y / (-1.0 - t)));
	else
		tmp = x + (a * (z / (1.0 - z)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.2e+121], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.95e-11], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(z / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+121}:\\
\;\;\;\;x - a\\

\mathbf{elif}\;z \leq 1.95 \cdot 10^{-11}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\

\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{z}{1 - z}\\


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

    1. Initial program 96.5%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Step-by-step derivation
      1. associate-/r/99.9%

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

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

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

    if -5.1999999999999998e121 < z < 1.95000000000000005e-11

    1. Initial program 99.2%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Step-by-step derivation
      1. associate-/r/99.3%

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

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

      \[\leadsto x - \color{blue}{\frac{y}{1 + t}} \cdot a \]

    if 1.95000000000000005e-11 < z

    1. Initial program 92.1%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 90.4%

      \[\leadsto x - \frac{y - z}{\frac{\color{blue}{1 - z}}{a}} \]
    4. Taylor expanded in y around 0 68.9%

      \[\leadsto \color{blue}{x - -1 \cdot \frac{a \cdot z}{1 - z}} \]
    5. Step-by-step derivation
      1. sub-neg68.9%

        \[\leadsto \color{blue}{x + \left(--1 \cdot \frac{a \cdot z}{1 - z}\right)} \]
      2. mul-1-neg68.9%

        \[\leadsto x + \left(-\color{blue}{\left(-\frac{a \cdot z}{1 - z}\right)}\right) \]
      3. remove-double-neg68.9%

        \[\leadsto x + \color{blue}{\frac{a \cdot z}{1 - z}} \]
      4. associate-/l*83.9%

        \[\leadsto x + \color{blue}{a \cdot \frac{z}{1 - z}} \]
    6. Simplified83.9%

      \[\leadsto \color{blue}{x + a \cdot \frac{z}{1 - z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification89.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{+121}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{-11}:\\ \;\;\;\;x + a \cdot \frac{y}{-1 - t}\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \frac{z}{1 - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 66.5% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+33} \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x - a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.1e33 or 1 < z

    1. Initial program 94.4%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Step-by-step derivation
      1. associate-/r/99.9%

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

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

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

    if -3.1e33 < z < 1

    1. Initial program 99.1%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 73.1%

      \[\leadsto x - \frac{y - z}{\frac{\color{blue}{1 - z}}{a}} \]
    4. Taylor expanded in y around 0 63.7%

      \[\leadsto \color{blue}{x - -1 \cdot \frac{a \cdot z}{1 - z}} \]
    5. Step-by-step derivation
      1. sub-neg63.7%

        \[\leadsto \color{blue}{x + \left(--1 \cdot \frac{a \cdot z}{1 - z}\right)} \]
      2. mul-1-neg63.7%

        \[\leadsto x + \left(-\color{blue}{\left(-\frac{a \cdot z}{1 - z}\right)}\right) \]
      3. remove-double-neg63.7%

        \[\leadsto x + \color{blue}{\frac{a \cdot z}{1 - z}} \]
      4. associate-/l*63.0%

        \[\leadsto x + \color{blue}{a \cdot \frac{z}{1 - z}} \]
    6. Simplified63.0%

      \[\leadsto \color{blue}{x + a \cdot \frac{z}{1 - z}} \]
    7. Taylor expanded in z around 0 63.1%

      \[\leadsto \color{blue}{x + a \cdot z} \]
    8. Step-by-step derivation
      1. +-commutative63.1%

        \[\leadsto \color{blue}{a \cdot z + x} \]
    9. Simplified63.1%

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

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

Alternative 9: 72.2% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+121} \lor \neg \left(z \leq 3.6 \cdot 10^{-5}\right):\\
\;\;\;\;x - a\\

\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.29999999999999979e121 or 3.60000000000000009e-5 < z

    1. Initial program 93.2%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Step-by-step derivation
      1. associate-/r/99.9%

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

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

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

    if -3.29999999999999979e121 < z < 3.60000000000000009e-5

    1. Initial program 99.2%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 74.7%

      \[\leadsto x - \frac{y - z}{\frac{\color{blue}{1 - z}}{a}} \]
    4. Taylor expanded in z around 0 68.8%

      \[\leadsto x - \color{blue}{a \cdot y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification75.7%

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

Alternative 10: 66.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+66} \lor \neg \left(z \leq 54\right):\\
\;\;\;\;x - a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.99999999999999991e66 or 54 < z

    1. Initial program 93.9%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Step-by-step derivation
      1. associate-/r/99.9%

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

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

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

    if -4.99999999999999991e66 < z < 54

    1. Initial program 99.1%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Step-by-step derivation
      1. associate-/r/99.2%

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

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

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

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

Alternative 11: 54.5% accurate, 13.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
	return x;
}
real(8) function code(x, y, z, t, a)
    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
    code = x
end function
public static double code(double x, double y, double z, double t, double a) {
	return x;
}
def code(x, y, z, t, a):
	return x
function code(x, y, z, t, a)
	return x
end
function tmp = code(x, y, z, t, a)
	tmp = x;
end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}

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

    \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
  2. Step-by-step derivation
    1. associate-/r/99.5%

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification60.2%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 99.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x - \frac{y - z}{\left(t - z\right) + 1} \cdot a \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (- x (* (/ (- y z) (+ (- t z) 1.0)) a)))
double code(double x, double y, double z, double t, double a) {
	return x - (((y - z) / ((t - z) + 1.0)) * a);
}
real(8) function code(x, y, z, t, a)
    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
    code = x - (((y - z) / ((t - z) + 1.0d0)) * a)
end function
public static double code(double x, double y, double z, double t, double a) {
	return x - (((y - z) / ((t - z) + 1.0)) * a);
}
def code(x, y, z, t, a):
	return x - (((y - z) / ((t - z) + 1.0)) * a)
function code(x, y, z, t, a)
	return Float64(x - Float64(Float64(Float64(y - z) / Float64(Float64(t - z) + 1.0)) * a))
end
function tmp = code(x, y, z, t, a)
	tmp = x - (((y - z) / ((t - z) + 1.0)) * a);
end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(N[(y - z), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Reproduce

?
herbie shell --seed 2024039 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (- x (* (/ (- y z) (+ (- t z) 1.0)) a))

  (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))