Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A

Percentage Accurate: 84.7% → 99.0%
Time: 12.4s
Alternatives: 13
Speedup: 0.6×

Specification

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

\\
x + \frac{y \cdot \left(z - t\right)}{z - 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 13 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: 84.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(z - t\right) \cdot y}{z - a}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;y \cdot \left(\frac{z - t}{z - a} + \frac{x}{y}\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-56}:\\ \;\;\;\;x + t\_1\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z - t}{\frac{z - a}{y}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* (- z t) y) (- z a))))
   (if (<= t_1 (- INFINITY))
     (* y (+ (/ (- z t) (- z a)) (/ x y)))
     (if (<= t_1 2e-56) (+ x t_1) (+ x (/ (- z t) (/ (- z a) y)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = ((z - t) * y) / (z - a);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = y * (((z - t) / (z - a)) + (x / y));
	} else if (t_1 <= 2e-56) {
		tmp = x + t_1;
	} else {
		tmp = x + ((z - t) / ((z - a) / y));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = ((z - t) * y) / (z - a);
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = y * (((z - t) / (z - a)) + (x / y));
	} else if (t_1 <= 2e-56) {
		tmp = x + t_1;
	} else {
		tmp = x + ((z - t) / ((z - a) / y));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = ((z - t) * y) / (z - a)
	tmp = 0
	if t_1 <= -math.inf:
		tmp = y * (((z - t) / (z - a)) + (x / y))
	elif t_1 <= 2e-56:
		tmp = x + t_1
	else:
		tmp = x + ((z - t) / ((z - a) / y))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(Float64(z - t) * y) / Float64(z - a))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(y * Float64(Float64(Float64(z - t) / Float64(z - a)) + Float64(x / y)));
	elseif (t_1 <= 2e-56)
		tmp = Float64(x + t_1);
	else
		tmp = Float64(x + Float64(Float64(z - t) / Float64(Float64(z - a) / y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = ((z - t) * y) / (z - a);
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = y * (((z - t) / (z - a)) + (x / y));
	elseif (t_1 <= 2e-56)
		tmp = x + t_1;
	else
		tmp = x + ((z - t) / ((z - a) / y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-56], N[(x + t$95$1), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-56}:\\
\;\;\;\;x + t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0

    1. Initial program 28.5%

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

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

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

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

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.0000000000000001e-56

    1. Initial program 99.2%

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

    if 2.0000000000000001e-56 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 83.7%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative83.7%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define94.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified94.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine94.6%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a} + x} \]
      2. associate-/l*83.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{\frac{z - a}{y}}} + x \]
    8. Applied egg-rr99.8%

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

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

Alternative 2: 98.1% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.45 \cdot 10^{-147}:\\ \;\;\;\;x + \frac{z - t}{\frac{z - a}{y}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= x -1.45e-147)
   (+ x (/ (- z t) (/ (- z a) y)))
   (fma y (/ (- z t) (- z a)) x)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (x <= -1.45e-147) {
		tmp = x + ((z - t) / ((z - a) / y));
	} else {
		tmp = fma(y, ((z - t) / (z - a)), x);
	}
	return tmp;
}
function code(x, y, z, t, a)
	tmp = 0.0
	if (x <= -1.45e-147)
		tmp = Float64(x + Float64(Float64(z - t) / Float64(Float64(z - a) / y)));
	else
		tmp = fma(y, Float64(Float64(z - t) / Float64(z - a)), x);
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.45e-147], N[(x + N[(N[(z - t), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{-147}:\\
\;\;\;\;x + \frac{z - t}{\frac{z - a}{y}}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.4500000000000001e-147

    1. Initial program 85.9%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative85.9%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define94.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified94.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine94.7%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a} + x} \]
      2. associate-/l*85.9%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{\frac{z - a}{y}}} + x \]
    8. Applied egg-rr99.0%

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

    if -1.4500000000000001e-147 < x

    1. Initial program 87.6%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define99.2%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification99.1%

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

Alternative 3: 73.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{z - t}{z - a}\\ \mathbf{if}\;z \leq -3.2 \cdot 10^{+132}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{+66}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.22 \cdot 10^{+28}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 2.85 \cdot 10^{+23}:\\ \;\;\;\;x + \frac{t \cdot y}{a}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+99}:\\ \;\;\;\;x - \frac{t \cdot y}{z}\\ \mathbf{elif}\;z \leq 1.12 \cdot 10^{+154}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ (- z t) (- z a)))))
   (if (<= z -3.2e+132)
     (+ x y)
     (if (<= z -1.95e+66)
       t_1
       (if (<= z -1.22e+28)
         (+ x y)
         (if (<= z 2.85e+23)
           (+ x (/ (* t y) a))
           (if (<= z 5e+99)
             (- x (/ (* t y) z))
             (if (<= z 1.12e+154) t_1 (+ x y)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * ((z - t) / (z - a));
	double tmp;
	if (z <= -3.2e+132) {
		tmp = x + y;
	} else if (z <= -1.95e+66) {
		tmp = t_1;
	} else if (z <= -1.22e+28) {
		tmp = x + y;
	} else if (z <= 2.85e+23) {
		tmp = x + ((t * y) / a);
	} else if (z <= 5e+99) {
		tmp = x - ((t * y) / z);
	} else if (z <= 1.12e+154) {
		tmp = t_1;
	} else {
		tmp = x + y;
	}
	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) :: tmp
    t_1 = y * ((z - t) / (z - a))
    if (z <= (-3.2d+132)) then
        tmp = x + y
    else if (z <= (-1.95d+66)) then
        tmp = t_1
    else if (z <= (-1.22d+28)) then
        tmp = x + y
    else if (z <= 2.85d+23) then
        tmp = x + ((t * y) / a)
    else if (z <= 5d+99) then
        tmp = x - ((t * y) / z)
    else if (z <= 1.12d+154) then
        tmp = t_1
    else
        tmp = x + y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y * ((z - t) / (z - a));
	double tmp;
	if (z <= -3.2e+132) {
		tmp = x + y;
	} else if (z <= -1.95e+66) {
		tmp = t_1;
	} else if (z <= -1.22e+28) {
		tmp = x + y;
	} else if (z <= 2.85e+23) {
		tmp = x + ((t * y) / a);
	} else if (z <= 5e+99) {
		tmp = x - ((t * y) / z);
	} else if (z <= 1.12e+154) {
		tmp = t_1;
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * ((z - t) / (z - a))
	tmp = 0
	if z <= -3.2e+132:
		tmp = x + y
	elif z <= -1.95e+66:
		tmp = t_1
	elif z <= -1.22e+28:
		tmp = x + y
	elif z <= 2.85e+23:
		tmp = x + ((t * y) / a)
	elif z <= 5e+99:
		tmp = x - ((t * y) / z)
	elif z <= 1.12e+154:
		tmp = t_1
	else:
		tmp = x + y
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(Float64(z - t) / Float64(z - a)))
	tmp = 0.0
	if (z <= -3.2e+132)
		tmp = Float64(x + y);
	elseif (z <= -1.95e+66)
		tmp = t_1;
	elseif (z <= -1.22e+28)
		tmp = Float64(x + y);
	elseif (z <= 2.85e+23)
		tmp = Float64(x + Float64(Float64(t * y) / a));
	elseif (z <= 5e+99)
		tmp = Float64(x - Float64(Float64(t * y) / z));
	elseif (z <= 1.12e+154)
		tmp = t_1;
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * ((z - t) / (z - a));
	tmp = 0.0;
	if (z <= -3.2e+132)
		tmp = x + y;
	elseif (z <= -1.95e+66)
		tmp = t_1;
	elseif (z <= -1.22e+28)
		tmp = x + y;
	elseif (z <= 2.85e+23)
		tmp = x + ((t * y) / a);
	elseif (z <= 5e+99)
		tmp = x - ((t * y) / z);
	elseif (z <= 1.12e+154)
		tmp = t_1;
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e+132], N[(x + y), $MachinePrecision], If[LessEqual[z, -1.95e+66], t$95$1, If[LessEqual[z, -1.22e+28], N[(x + y), $MachinePrecision], If[LessEqual[z, 2.85e+23], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e+99], N[(x - N[(N[(t * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.12e+154], t$95$1, N[(x + y), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \frac{z - t}{z - a}\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+132}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;z \leq -1.95 \cdot 10^{+66}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -1.22 \cdot 10^{+28}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;z \leq 2.85 \cdot 10^{+23}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\

\mathbf{elif}\;z \leq 5 \cdot 10^{+99}:\\
\;\;\;\;x - \frac{t \cdot y}{z}\\

\mathbf{elif}\;z \leq 1.12 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.1999999999999997e132 or -1.9500000000000002e66 < z < -1.2199999999999999e28 or 1.11999999999999994e154 < z

    1. Initial program 73.2%

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

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative85.3%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified85.3%

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

    if -3.1999999999999997e132 < z < -1.9500000000000002e66 or 5.00000000000000008e99 < z < 1.11999999999999994e154

    1. Initial program 63.8%

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a}} \]
    4. Step-by-step derivation
      1. associate-*r/78.6%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} \]
    5. Simplified78.6%

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

    if -1.2199999999999999e28 < z < 2.85e23

    1. Initial program 99.1%

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

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

    if 2.85e23 < z < 5.00000000000000008e99

    1. Initial program 89.4%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative89.4%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define99.8%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine99.8%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a} + x} \]
      2. associate-/l*89.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z}} + x \]
    8. Taylor expanded in z around 0 73.3%

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

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{z} + x \]
      2. distribute-lft-neg-out73.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+132}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{+66}:\\ \;\;\;\;y \cdot \frac{z - t}{z - a}\\ \mathbf{elif}\;z \leq -1.22 \cdot 10^{+28}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 2.85 \cdot 10^{+23}:\\ \;\;\;\;x + \frac{t \cdot y}{a}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+99}:\\ \;\;\;\;x - \frac{t \cdot y}{z}\\ \mathbf{elif}\;z \leq 1.12 \cdot 10^{+154}:\\ \;\;\;\;y \cdot \frac{z - t}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 96.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(z - t\right) \cdot y}{z - a}\\ \mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 10^{+261}\right):\\ \;\;\;\;y \cdot \frac{z - t}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* (- z t) y) (- z a))))
   (if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+261)))
     (* y (/ (- z t) (- z a)))
     (+ x t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = ((z - t) * y) / (z - a);
	double tmp;
	if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+261)) {
		tmp = y * ((z - t) / (z - a));
	} else {
		tmp = x + t_1;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = ((z - t) * y) / (z - a);
	double tmp;
	if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+261)) {
		tmp = y * ((z - t) / (z - a));
	} else {
		tmp = x + t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = ((z - t) * y) / (z - a)
	tmp = 0
	if (t_1 <= -math.inf) or not (t_1 <= 1e+261):
		tmp = y * ((z - t) / (z - a))
	else:
		tmp = x + t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(Float64(z - t) * y) / Float64(z - a))
	tmp = 0.0
	if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e+261))
		tmp = Float64(y * Float64(Float64(z - t) / Float64(z - a)));
	else
		tmp = Float64(x + t_1);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = ((z - t) * y) / (z - a);
	tmp = 0.0;
	if ((t_1 <= -Inf) || ~((t_1 <= 1e+261)))
		tmp = y * ((z - t) / (z - a));
	else
		tmp = x + t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+261]], $MachinePrecision]], N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0 or 9.9999999999999993e260 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 33.1%

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a}} \]
    4. Step-by-step derivation
      1. associate-*r/87.8%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} \]
    5. Simplified87.8%

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 9.9999999999999993e260

    1. Initial program 99.3%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification97.2%

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

Alternative 5: 99.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(z - t\right) \cdot y}{z - a}\\ \mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{-56}\right):\\ \;\;\;\;x + \frac{y}{a - z} \cdot \left(t - z\right)\\ \mathbf{else}:\\ \;\;\;\;x + t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* (- z t) y) (- z a))))
   (if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e-56)))
     (+ x (* (/ y (- a z)) (- t z)))
     (+ x t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = ((z - t) * y) / (z - a);
	double tmp;
	if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e-56)) {
		tmp = x + ((y / (a - z)) * (t - z));
	} else {
		tmp = x + t_1;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = ((z - t) * y) / (z - a);
	double tmp;
	if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e-56)) {
		tmp = x + ((y / (a - z)) * (t - z));
	} else {
		tmp = x + t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = ((z - t) * y) / (z - a)
	tmp = 0
	if (t_1 <= -math.inf) or not (t_1 <= 2e-56):
		tmp = x + ((y / (a - z)) * (t - z))
	else:
		tmp = x + t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(Float64(z - t) * y) / Float64(z - a))
	tmp = 0.0
	if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e-56))
		tmp = Float64(x + Float64(Float64(y / Float64(a - z)) * Float64(t - z)));
	else
		tmp = Float64(x + t_1);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = ((z - t) * y) / (z - a);
	tmp = 0.0;
	if ((t_1 <= -Inf) || ~((t_1 <= 2e-56)))
		tmp = x + ((y / (a - z)) * (t - z));
	else
		tmp = x + t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e-56]], $MachinePrecision]], N[(x + N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{\left(z - t\right) \cdot y}{z - a}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{-56}\right):\\
\;\;\;\;x + \frac{y}{a - z} \cdot \left(t - z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0 or 2.0000000000000001e-56 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 67.7%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative67.7%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define96.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified96.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine96.1%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a} + x} \]
      2. associate-/l*67.7%

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

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

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

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

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

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.0000000000000001e-56

    1. Initial program 99.2%

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

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

Alternative 6: 99.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(z - t\right) \cdot y}{z - a}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;x + \frac{y}{a - z} \cdot \left(t - z\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-56}:\\ \;\;\;\;x + t\_1\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z - t}{\frac{z - a}{y}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* (- z t) y) (- z a))))
   (if (<= t_1 (- INFINITY))
     (+ x (* (/ y (- a z)) (- t z)))
     (if (<= t_1 2e-56) (+ x t_1) (+ x (/ (- z t) (/ (- z a) y)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = ((z - t) * y) / (z - a);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = x + ((y / (a - z)) * (t - z));
	} else if (t_1 <= 2e-56) {
		tmp = x + t_1;
	} else {
		tmp = x + ((z - t) / ((z - a) / y));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = ((z - t) * y) / (z - a);
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = x + ((y / (a - z)) * (t - z));
	} else if (t_1 <= 2e-56) {
		tmp = x + t_1;
	} else {
		tmp = x + ((z - t) / ((z - a) / y));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = ((z - t) * y) / (z - a)
	tmp = 0
	if t_1 <= -math.inf:
		tmp = x + ((y / (a - z)) * (t - z))
	elif t_1 <= 2e-56:
		tmp = x + t_1
	else:
		tmp = x + ((z - t) / ((z - a) / y))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(Float64(z - t) * y) / Float64(z - a))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(x + Float64(Float64(y / Float64(a - z)) * Float64(t - z)));
	elseif (t_1 <= 2e-56)
		tmp = Float64(x + t_1);
	else
		tmp = Float64(x + Float64(Float64(z - t) / Float64(Float64(z - a) / y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = ((z - t) * y) / (z - a);
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = x + ((y / (a - z)) * (t - z));
	elseif (t_1 <= 2e-56)
		tmp = x + t_1;
	else
		tmp = x + ((z - t) / ((z - a) / y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-56], N[(x + t$95$1), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-56}:\\
\;\;\;\;x + t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0

    1. Initial program 28.5%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative28.5%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define99.9%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine99.9%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a} + x} \]
      2. associate-/l*28.5%

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

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

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

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

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

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.0000000000000001e-56

    1. Initial program 99.2%

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

    if 2.0000000000000001e-56 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 83.7%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative83.7%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define94.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified94.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine94.6%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a} + x} \]
      2. associate-/l*83.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{\frac{z - a}{y}}} + x \]
    8. Applied egg-rr99.8%

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

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

Alternative 7: 80.3% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 73.9%

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z}} + x \]
    5. Simplified86.2%

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

    if -6.8e22 < z < 6.8e22

    1. Initial program 99.1%

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

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

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

Alternative 8: 82.9% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.3500000000000001e-22 or 1.35e6 < a

    1. Initial program 87.4%

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

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

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

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

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

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

    if -1.3500000000000001e-22 < a < 1.35e6

    1. Initial program 86.3%

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

      \[\leadsto \color{blue}{x + \frac{y \cdot \left(z - t\right)}{z}} \]
    4. Step-by-step derivation
      1. +-commutative77.0%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z}} + x \]
    5. Simplified86.1%

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

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

Alternative 9: 82.8% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.6999999999999999e-22 or 4.1e7 < a

    1. Initial program 87.4%

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

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

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

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    6. Step-by-step derivation
      1. clear-num86.5%

        \[\leadsto x - y \cdot \color{blue}{\frac{1}{\frac{a}{z - t}}} \]
      2. un-div-inv86.6%

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{z - t}}} \]
    7. Applied egg-rr86.6%

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

    if -1.6999999999999999e-22 < a < 4.1e7

    1. Initial program 86.3%

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

      \[\leadsto \color{blue}{x + \frac{y \cdot \left(z - t\right)}{z}} \]
    4. Step-by-step derivation
      1. +-commutative77.0%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z}} + x \]
    5. Simplified86.1%

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

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

Alternative 10: 88.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+27} \lor \neg \left(z \leq 5 \cdot 10^{+49}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.0000000000000001e27 or 5.0000000000000004e49 < z

    1. Initial program 73.2%

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

      \[\leadsto \color{blue}{x + \frac{y \cdot \left(z - t\right)}{z}} \]
    4. Step-by-step derivation
      1. +-commutative65.7%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z}} + x \]
    5. Simplified87.0%

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

    if -4.0000000000000001e27 < z < 5.0000000000000004e49

    1. Initial program 98.4%

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

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

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

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

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

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

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

        \[\leadsto x + t \cdot \frac{y}{\color{blue}{\left(-z\right) + \left(-\left(-a\right)\right)}} \]
      7. remove-double-neg92.5%

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

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

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

Alternative 11: 75.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+21} \lor \neg \left(z \leq 3.5 \cdot 10^{+49}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.25e21 or 3.49999999999999975e49 < z

    1. Initial program 73.2%

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

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

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified76.6%

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

    if -2.25e21 < z < 3.49999999999999975e49

    1. Initial program 98.4%

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

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

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

Alternative 12: 62.6% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.3e20 or 1.00000000000000001e43 < z

    1. Initial program 73.7%

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

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

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified75.4%

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

    if -1.3e20 < z < 1.00000000000000001e43

    1. Initial program 98.4%

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

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

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

Alternative 13: 50.3% accurate, 11.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 86.9%

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification53.1%

    \[\leadsto x \]
  5. Add Preprocessing

Developer target: 98.3% accurate, 1.0× speedup?

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

\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}

Reproduce

?
herbie shell --seed 2024055 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
  :precision binary64

  :alt
  (+ x (/ y (/ (- z a) (- z t))))

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