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

Percentage Accurate: 85.3% → 99.3%
Time: 7.7s
Alternatives: 9
Speedup: 0.3×

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 9 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: 85.3% 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.3% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{\frac{y}{z - a}}{\frac{1}{z - t}} + x\\
t_2 := \frac{\left(z - t\right) \cdot y}{z - a}\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+291}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+256}:\\
\;\;\;\;x + t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -3.9999999999999998e291 or 2.0000000000000001e256 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 41.1%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto x + \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a}} \]
      2. lift-*.f64N/A

        \[\leadsto x + \frac{\color{blue}{y \cdot \left(z - t\right)}}{z - a} \]
      3. *-commutativeN/A

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

        \[\leadsto x + \color{blue}{\left(z - t\right) \cdot \frac{y}{z - a}} \]
      5. lift--.f64N/A

        \[\leadsto x + \color{blue}{\left(z - t\right)} \cdot \frac{y}{z - a} \]
      6. flip--N/A

        \[\leadsto x + \color{blue}{\frac{z \cdot z - t \cdot t}{z + t}} \cdot \frac{y}{z - a} \]
      7. clear-numN/A

        \[\leadsto x + \color{blue}{\frac{1}{\frac{z + t}{z \cdot z - t \cdot t}}} \cdot \frac{y}{z - a} \]
      8. associate-*l/N/A

        \[\leadsto x + \color{blue}{\frac{1 \cdot \frac{y}{z - a}}{\frac{z + t}{z \cdot z - t \cdot t}}} \]
      9. lower-/.f64N/A

        \[\leadsto x + \color{blue}{\frac{1 \cdot \frac{y}{z - a}}{\frac{z + t}{z \cdot z - t \cdot t}}} \]
      10. lower-*.f64N/A

        \[\leadsto x + \frac{\color{blue}{1 \cdot \frac{y}{z - a}}}{\frac{z + t}{z \cdot z - t \cdot t}} \]
      11. lower-/.f64N/A

        \[\leadsto x + \frac{1 \cdot \color{blue}{\frac{y}{z - a}}}{\frac{z + t}{z \cdot z - t \cdot t}} \]
      12. clear-numN/A

        \[\leadsto x + \frac{1 \cdot \frac{y}{z - a}}{\color{blue}{\frac{1}{\frac{z \cdot z - t \cdot t}{z + t}}}} \]
      13. flip--N/A

        \[\leadsto x + \frac{1 \cdot \frac{y}{z - a}}{\frac{1}{\color{blue}{z - t}}} \]
      14. lift--.f64N/A

        \[\leadsto x + \frac{1 \cdot \frac{y}{z - a}}{\frac{1}{\color{blue}{z - t}}} \]
      15. lower-/.f6499.8

        \[\leadsto x + \frac{1 \cdot \frac{y}{z - a}}{\color{blue}{\frac{1}{z - t}}} \]
    4. Applied rewrites99.8%

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

    if -3.9999999999999998e291 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.0000000000000001e256

    1. Initial program 99.9%

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

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

Alternative 2: 95.9% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 10^{+236}:\\
\;\;\;\;x + t\_2\\

\mathbf{else}:\\
\;\;\;\;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 1.00000000000000005e236 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 42.0%

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

      \[\leadsto \color{blue}{y \cdot \left(\frac{z}{z - a} - \frac{t}{z - a}\right)} \]
    4. Step-by-step derivation
      1. distribute-lft-out--N/A

        \[\leadsto \color{blue}{y \cdot \frac{z}{z - a} - y \cdot \frac{t}{z - a}} \]
      2. associate-/l*N/A

        \[\leadsto \color{blue}{\frac{y \cdot z}{z - a}} - y \cdot \frac{t}{z - a} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{z \cdot y}}{z - a} - y \cdot \frac{t}{z - a} \]
      4. associate-/l*N/A

        \[\leadsto \color{blue}{z \cdot \frac{y}{z - a}} - y \cdot \frac{t}{z - a} \]
      5. associate-/l*N/A

        \[\leadsto z \cdot \frac{y}{z - a} - \color{blue}{\frac{y \cdot t}{z - a}} \]
      6. *-commutativeN/A

        \[\leadsto z \cdot \frac{y}{z - a} - \frac{\color{blue}{t \cdot y}}{z - a} \]
      7. associate-/l*N/A

        \[\leadsto z \cdot \frac{y}{z - a} - \color{blue}{t \cdot \frac{y}{z - a}} \]
      8. distribute-rgt-out--N/A

        \[\leadsto \color{blue}{\frac{y}{z - a} \cdot \left(z - t\right)} \]
      9. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{y}{z - a} \cdot \left(z - t\right)} \]
      10. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{y}{z - a}} \cdot \left(z - t\right) \]
      11. lower--.f64N/A

        \[\leadsto \frac{y}{\color{blue}{z - a}} \cdot \left(z - t\right) \]
      12. lower--.f6491.3

        \[\leadsto \frac{y}{z - a} \cdot \color{blue}{\left(z - t\right)} \]
    5. Applied rewrites91.3%

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 1.00000000000000005e236

    1. Initial program 99.9%

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

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

Alternative 3: 83.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{z - a} \cdot \left(z - t\right)\\ t_2 := \frac{\left(z - t\right) \cdot y}{z - a}\\ \mathbf{if}\;t\_2 \leq -4 \cdot 10^{+33}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+145}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{z - a}, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (/ y (- z a)) (- z t))) (t_2 (/ (* (- z t) y) (- z a))))
   (if (<= t_2 -4e+33) t_1 (if (<= t_2 2e+145) (fma (/ z (- z a)) y x) t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y / (z - a)) * (z - t);
	double t_2 = ((z - t) * y) / (z - a);
	double tmp;
	if (t_2 <= -4e+33) {
		tmp = t_1;
	} else if (t_2 <= 2e+145) {
		tmp = fma((z / (z - a)), y, x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y / Float64(z - a)) * Float64(z - t))
	t_2 = Float64(Float64(Float64(z - t) * y) / Float64(z - a))
	tmp = 0.0
	if (t_2 <= -4e+33)
		tmp = t_1;
	elseif (t_2 <= 2e+145)
		tmp = fma(Float64(z / Float64(z - a)), y, x);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e+33], t$95$1, If[LessEqual[t$95$2, 2e+145], N[(N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+145}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{z - a}, y, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -3.9999999999999998e33 or 2e145 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 65.0%

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

      \[\leadsto \color{blue}{y \cdot \left(\frac{z}{z - a} - \frac{t}{z - a}\right)} \]
    4. Step-by-step derivation
      1. distribute-lft-out--N/A

        \[\leadsto \color{blue}{y \cdot \frac{z}{z - a} - y \cdot \frac{t}{z - a}} \]
      2. associate-/l*N/A

        \[\leadsto \color{blue}{\frac{y \cdot z}{z - a}} - y \cdot \frac{t}{z - a} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{z \cdot y}}{z - a} - y \cdot \frac{t}{z - a} \]
      4. associate-/l*N/A

        \[\leadsto \color{blue}{z \cdot \frac{y}{z - a}} - y \cdot \frac{t}{z - a} \]
      5. associate-/l*N/A

        \[\leadsto z \cdot \frac{y}{z - a} - \color{blue}{\frac{y \cdot t}{z - a}} \]
      6. *-commutativeN/A

        \[\leadsto z \cdot \frac{y}{z - a} - \frac{\color{blue}{t \cdot y}}{z - a} \]
      7. associate-/l*N/A

        \[\leadsto z \cdot \frac{y}{z - a} - \color{blue}{t \cdot \frac{y}{z - a}} \]
      8. distribute-rgt-out--N/A

        \[\leadsto \color{blue}{\frac{y}{z - a} \cdot \left(z - t\right)} \]
      9. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{y}{z - a} \cdot \left(z - t\right)} \]
      10. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{y}{z - a}} \cdot \left(z - t\right) \]
      11. lower--.f64N/A

        \[\leadsto \frac{y}{\color{blue}{z - a}} \cdot \left(z - t\right) \]
      12. lower--.f6481.8

        \[\leadsto \frac{y}{z - a} \cdot \color{blue}{\left(z - t\right)} \]
    5. Applied rewrites81.8%

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

    if -3.9999999999999998e33 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2e145

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x + \frac{y \cdot z}{z - a}} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{z - a}} + x \]
      3. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{z}{z - a} \cdot y} + x \]
      4. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{z - a}, y, x\right)} \]
      5. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{z - a}}, y, x\right) \]
      6. lower--.f6486.6

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

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

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

Alternative 4: 75.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-88}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;z \leq 3.9 \cdot 10^{-32}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\

\mathbf{elif}\;z \leq 7 \cdot 10^{+144}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-t}{z}, y, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.49999999999999991e-88 or 6.9999999999999996e144 < z

    1. Initial program 74.7%

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

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{y + x} \]
      2. lower-+.f6476.3

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

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

    if -4.49999999999999991e-88 < z < 3.9000000000000001e-32

    1. Initial program 94.0%

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

      \[\leadsto \color{blue}{x + \frac{t \cdot y}{a}} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
      3. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{y}{a} \cdot t} + x \]
      4. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, t, x\right)} \]
      5. lower-/.f6480.3

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y}{a}}, t, x\right) \]
    5. Applied rewrites80.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, t, x\right)} \]

    if 3.9000000000000001e-32 < z < 6.9999999999999996e144

    1. Initial program 97.4%

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z}} + x \]
      3. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{z - t}{z} \cdot y} + x \]
      4. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{z}, y, x\right)} \]
      5. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z - t}{z}}, y, x\right) \]
      6. lower--.f6487.6

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{z}, y, x\right)} \]
    6. Taylor expanded in t around inf

      \[\leadsto \mathsf{fma}\left(\frac{-1 \cdot t}{z}, y, x\right) \]
    7. Step-by-step derivation
      1. Applied rewrites77.4%

        \[\leadsto \mathsf{fma}\left(\frac{-t}{z}, y, x\right) \]
    8. Recombined 3 regimes into one program.
    9. Final simplification77.9%

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{-88}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{-32}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\ \mathbf{elif}\;z \leq 7 \cdot 10^{+144}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-t}{z}, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
    10. Add Preprocessing

    Alternative 5: 81.4% accurate, 0.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.6 \cdot 10^{-92}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{z - a}, y, x\right)\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-79}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z - t}{z}, y, x\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a)
     :precision binary64
     (if (<= z -3.6e-92)
       (fma (/ z (- z a)) y x)
       (if (<= z 3e-79) (fma (/ y a) t x) (fma (/ (- z t) z) y x))))
    double code(double x, double y, double z, double t, double a) {
    	double tmp;
    	if (z <= -3.6e-92) {
    		tmp = fma((z / (z - a)), y, x);
    	} else if (z <= 3e-79) {
    		tmp = fma((y / a), t, x);
    	} else {
    		tmp = fma(((z - t) / z), y, x);
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a)
    	tmp = 0.0
    	if (z <= -3.6e-92)
    		tmp = fma(Float64(z / Float64(z - a)), y, x);
    	elseif (z <= 3e-79)
    		tmp = fma(Float64(y / a), t, x);
    	else
    		tmp = fma(Float64(Float64(z - t) / z), y, x);
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.6e-92], N[(N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[z, 3e-79], N[(N[(y / a), $MachinePrecision] * t + x), $MachinePrecision], N[(N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision] * y + x), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -3.6 \cdot 10^{-92}:\\
    \;\;\;\;\mathsf{fma}\left(\frac{z}{z - a}, y, x\right)\\
    
    \mathbf{elif}\;z \leq 3 \cdot 10^{-79}:\\
    \;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(\frac{z - t}{z}, y, x\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if z < -3.60000000000000016e-92

      1. Initial program 82.9%

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

        \[\leadsto \color{blue}{x + \frac{y \cdot z}{z - a}} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

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

          \[\leadsto \color{blue}{y \cdot \frac{z}{z - a}} + x \]
        3. *-commutativeN/A

          \[\leadsto \color{blue}{\frac{z}{z - a} \cdot y} + x \]
        4. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{z - a}, y, x\right)} \]
        5. lower-/.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{z - a}}, y, x\right) \]
        6. lower--.f6482.4

          \[\leadsto \mathsf{fma}\left(\frac{z}{\color{blue}{z - a}}, y, x\right) \]
      5. Applied rewrites82.4%

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

      if -3.60000000000000016e-92 < z < 3e-79

      1. Initial program 94.6%

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

        \[\leadsto \color{blue}{x + \frac{t \cdot y}{a}} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

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

          \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
        3. *-commutativeN/A

          \[\leadsto \color{blue}{\frac{y}{a} \cdot t} + x \]
        4. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, t, x\right)} \]
        5. lower-/.f6482.1

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y}{a}}, t, x\right) \]
      5. Applied rewrites82.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, t, x\right)} \]

      if 3e-79 < z

      1. Initial program 77.4%

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

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

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

          \[\leadsto \color{blue}{y \cdot \frac{z - t}{z}} + x \]
        3. *-commutativeN/A

          \[\leadsto \color{blue}{\frac{z - t}{z} \cdot y} + x \]
        4. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{z}, y, x\right)} \]
        5. lower-/.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z - t}{z}}, y, x\right) \]
        6. lower--.f6486.7

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

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

    Alternative 6: 80.8% accurate, 0.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\frac{z}{z - a}, y, x\right)\\ \mathbf{if}\;z \leq -3.6 \cdot 10^{-92}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 95000:\\ \;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t a)
     :precision binary64
     (let* ((t_1 (fma (/ z (- z a)) y x)))
       (if (<= z -3.6e-92) t_1 (if (<= z 95000.0) (fma (/ y a) t x) t_1))))
    double code(double x, double y, double z, double t, double a) {
    	double t_1 = fma((z / (z - a)), y, x);
    	double tmp;
    	if (z <= -3.6e-92) {
    		tmp = t_1;
    	} else if (z <= 95000.0) {
    		tmp = fma((y / a), t, x);
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a)
    	t_1 = fma(Float64(z / Float64(z - a)), y, x)
    	tmp = 0.0
    	if (z <= -3.6e-92)
    		tmp = t_1;
    	elseif (z <= 95000.0)
    		tmp = fma(Float64(y / a), t, x);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[z, -3.6e-92], t$95$1, If[LessEqual[z, 95000.0], N[(N[(y / a), $MachinePrecision] * t + x), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \mathsf{fma}\left(\frac{z}{z - a}, y, x\right)\\
    \mathbf{if}\;z \leq -3.6 \cdot 10^{-92}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq 95000:\\
    \;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -3.60000000000000016e-92 or 95000 < z

      1. Initial program 79.0%

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

        \[\leadsto \color{blue}{x + \frac{y \cdot z}{z - a}} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

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

          \[\leadsto \color{blue}{y \cdot \frac{z}{z - a}} + x \]
        3. *-commutativeN/A

          \[\leadsto \color{blue}{\frac{z}{z - a} \cdot y} + x \]
        4. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{z - a}, y, x\right)} \]
        5. lower-/.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{z - a}}, y, x\right) \]
        6. lower--.f6483.4

          \[\leadsto \mathsf{fma}\left(\frac{z}{\color{blue}{z - a}}, y, x\right) \]
      5. Applied rewrites83.4%

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

      if -3.60000000000000016e-92 < z < 95000

      1. Initial program 94.4%

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

        \[\leadsto \color{blue}{x + \frac{t \cdot y}{a}} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

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

          \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
        3. *-commutativeN/A

          \[\leadsto \color{blue}{\frac{y}{a} \cdot t} + x \]
        4. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, t, x\right)} \]
        5. lower-/.f6478.1

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y}{a}}, t, x\right) \]
      5. Applied rewrites78.1%

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

    Alternative 7: 75.3% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{-88}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+19}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
    (FPCore (x y z t a)
     :precision binary64
     (if (<= z -4.5e-88) (+ x y) (if (<= z 1.45e+19) (fma (/ y a) t x) (+ x y))))
    double code(double x, double y, double z, double t, double a) {
    	double tmp;
    	if (z <= -4.5e-88) {
    		tmp = x + y;
    	} else if (z <= 1.45e+19) {
    		tmp = fma((y / a), t, x);
    	} else {
    		tmp = x + y;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a)
    	tmp = 0.0
    	if (z <= -4.5e-88)
    		tmp = Float64(x + y);
    	elseif (z <= 1.45e+19)
    		tmp = fma(Float64(y / a), t, x);
    	else
    		tmp = Float64(x + y);
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.5e-88], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.45e+19], N[(N[(y / a), $MachinePrecision] * t + x), $MachinePrecision], N[(x + y), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -4.5 \cdot 10^{-88}:\\
    \;\;\;\;x + y\\
    
    \mathbf{elif}\;z \leq 1.45 \cdot 10^{+19}:\\
    \;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;x + y\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -4.49999999999999991e-88 or 1.45e19 < z

      1. Initial program 78.3%

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

        \[\leadsto \color{blue}{x + y} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{y + x} \]
        2. lower-+.f6474.7

          \[\leadsto \color{blue}{y + x} \]
      5. Applied rewrites74.7%

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

      if -4.49999999999999991e-88 < z < 1.45e19

      1. Initial program 94.7%

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

        \[\leadsto \color{blue}{x + \frac{t \cdot y}{a}} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

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

          \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
        3. *-commutativeN/A

          \[\leadsto \color{blue}{\frac{y}{a} \cdot t} + x \]
        4. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a}, t, x\right)} \]
        5. lower-/.f6478.2

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y}{a}}, t, x\right) \]
      5. Applied rewrites78.2%

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

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

    Alternative 8: 59.9% accurate, 1.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 4.3 \cdot 10^{+206}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{a} \cdot y\\ \end{array} \end{array} \]
    (FPCore (x y z t a)
     :precision binary64
     (if (<= y 4.3e+206) (+ x y) (* (/ t a) y)))
    double code(double x, double y, double z, double t, double a) {
    	double tmp;
    	if (y <= 4.3e+206) {
    		tmp = x + y;
    	} else {
    		tmp = (t / a) * 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) :: tmp
        if (y <= 4.3d+206) then
            tmp = x + y
        else
            tmp = (t / a) * y
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t, double a) {
    	double tmp;
    	if (y <= 4.3e+206) {
    		tmp = x + y;
    	} else {
    		tmp = (t / a) * y;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a):
    	tmp = 0
    	if y <= 4.3e+206:
    		tmp = x + y
    	else:
    		tmp = (t / a) * y
    	return tmp
    
    function code(x, y, z, t, a)
    	tmp = 0.0
    	if (y <= 4.3e+206)
    		tmp = Float64(x + y);
    	else
    		tmp = Float64(Float64(t / a) * y);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a)
    	tmp = 0.0;
    	if (y <= 4.3e+206)
    		tmp = x + y;
    	else
    		tmp = (t / a) * y;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_] := If[LessEqual[y, 4.3e+206], N[(x + y), $MachinePrecision], N[(N[(t / a), $MachinePrecision] * y), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq 4.3 \cdot 10^{+206}:\\
    \;\;\;\;x + y\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{t}{a} \cdot y\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < 4.29999999999999988e206

      1. Initial program 85.8%

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

        \[\leadsto \color{blue}{x + y} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{y + x} \]
        2. lower-+.f6461.1

          \[\leadsto \color{blue}{y + x} \]
      5. Applied rewrites61.1%

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

      if 4.29999999999999988e206 < y

      1. Initial program 78.7%

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

        \[\leadsto \color{blue}{y \cdot \left(\frac{z}{z - a} - \frac{t}{z - a}\right)} \]
      4. Step-by-step derivation
        1. distribute-lft-out--N/A

          \[\leadsto \color{blue}{y \cdot \frac{z}{z - a} - y \cdot \frac{t}{z - a}} \]
        2. associate-/l*N/A

          \[\leadsto \color{blue}{\frac{y \cdot z}{z - a}} - y \cdot \frac{t}{z - a} \]
        3. *-commutativeN/A

          \[\leadsto \frac{\color{blue}{z \cdot y}}{z - a} - y \cdot \frac{t}{z - a} \]
        4. associate-/l*N/A

          \[\leadsto \color{blue}{z \cdot \frac{y}{z - a}} - y \cdot \frac{t}{z - a} \]
        5. associate-/l*N/A

          \[\leadsto z \cdot \frac{y}{z - a} - \color{blue}{\frac{y \cdot t}{z - a}} \]
        6. *-commutativeN/A

          \[\leadsto z \cdot \frac{y}{z - a} - \frac{\color{blue}{t \cdot y}}{z - a} \]
        7. associate-/l*N/A

          \[\leadsto z \cdot \frac{y}{z - a} - \color{blue}{t \cdot \frac{y}{z - a}} \]
        8. distribute-rgt-out--N/A

          \[\leadsto \color{blue}{\frac{y}{z - a} \cdot \left(z - t\right)} \]
        9. lower-*.f64N/A

          \[\leadsto \color{blue}{\frac{y}{z - a} \cdot \left(z - t\right)} \]
        10. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{y}{z - a}} \cdot \left(z - t\right) \]
        11. lower--.f64N/A

          \[\leadsto \frac{y}{\color{blue}{z - a}} \cdot \left(z - t\right) \]
        12. lower--.f6482.4

          \[\leadsto \frac{y}{z - a} \cdot \color{blue}{\left(z - t\right)} \]
      5. Applied rewrites82.4%

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

        \[\leadsto \frac{t \cdot y}{\color{blue}{a}} \]
      7. Step-by-step derivation
        1. Applied rewrites51.1%

          \[\leadsto \frac{t \cdot y}{\color{blue}{a}} \]
        2. Step-by-step derivation
          1. Applied rewrites57.6%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 4.3 \cdot 10^{+206}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{a} \cdot y\\ \end{array} \]
        5. Add Preprocessing

        Alternative 9: 60.2% accurate, 6.5× speedup?

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

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

          \[\leadsto \color{blue}{x + y} \]
        4. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \color{blue}{y + x} \]
          2. lower-+.f6457.3

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

          \[\leadsto \color{blue}{y + x} \]
        6. Final simplification57.3%

          \[\leadsto x + y \]
        7. Add Preprocessing

        Developer Target 1: 98.5% accurate, 0.8× 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 2024254 
        (FPCore (x y z t a)
          :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
          :precision binary64
        
          :alt
          (! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
        
          (+ x (/ (* y (- z t)) (- z a))))