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

Percentage Accurate: 84.8% → 99.3%
Time: 8.4s
Alternatives: 11
Speedup: 0.8×

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 11 alternatives:

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

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

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

\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 1.9999999999999998e250 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 44.6%

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

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

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

      \[\leadsto x + \color{blue}{{\left(\frac{z - a}{y \cdot \left(z - t\right)}\right)}^{-1}} \]
    5. Step-by-step derivation
      1. unpow-144.7%

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

        \[\leadsto x + \frac{1}{\color{blue}{\frac{\frac{z - a}{y}}{z - t}}} \]
    6. Simplified99.9%

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 1.9999999999999998e250

    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{y \cdot \left(z - t\right)}{z - a} \leq -\infty \lor \neg \left(\frac{y \cdot \left(z - t\right)}{z - a} \leq 2 \cdot 10^{+250}\right):\\ \;\;\;\;x - \frac{1}{\frac{\frac{z - a}{y}}{t - z}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 98.3% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right) \end{array} \]
(FPCore (x y z t a) :precision binary64 (fma y (/ (- z t) (- z a)) x))
double code(double x, double y, double z, double t, double a) {
	return fma(y, ((z - t) / (z - a)), x);
}
function code(x, y, z, t, a)
	return fma(y, Float64(Float64(z - t) / Float64(z - a)), x)
end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)
\end{array}
Derivation
  1. Initial program 86.7%

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
  4. Add Preprocessing
  5. Final simplification97.0%

    \[\leadsto \mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right) \]
  6. Add Preprocessing

Alternative 3: 77.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - y \cdot \left(\frac{t}{z} + -1\right)\\ \mathbf{if}\;a \leq -6.2 \cdot 10^{+62}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq -4 \cdot 10^{-169}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -7.4 \cdot 10^{-220}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;a \leq 7 \cdot 10^{+56}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (* y (+ (/ t z) -1.0)))))
   (if (<= a -6.2e+62)
     (+ x (* t (/ y a)))
     (if (<= a -4e-169)
       t_1
       (if (<= a -7.4e-220)
         (+ x (/ (* y t) a))
         (if (<= a 7e+56) t_1 (+ x (/ y (/ a t)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (y * ((t / z) + -1.0));
	double tmp;
	if (a <= -6.2e+62) {
		tmp = x + (t * (y / a));
	} else if (a <= -4e-169) {
		tmp = t_1;
	} else if (a <= -7.4e-220) {
		tmp = x + ((y * t) / a);
	} else if (a <= 7e+56) {
		tmp = t_1;
	} else {
		tmp = x + (y / (a / t));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x - (y * ((t / z) + (-1.0d0)))
    if (a <= (-6.2d+62)) then
        tmp = x + (t * (y / a))
    else if (a <= (-4d-169)) then
        tmp = t_1
    else if (a <= (-7.4d-220)) then
        tmp = x + ((y * t) / a)
    else if (a <= 7d+56) then
        tmp = t_1
    else
        tmp = x + (y / (a / t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (y * ((t / z) + -1.0));
	double tmp;
	if (a <= -6.2e+62) {
		tmp = x + (t * (y / a));
	} else if (a <= -4e-169) {
		tmp = t_1;
	} else if (a <= -7.4e-220) {
		tmp = x + ((y * t) / a);
	} else if (a <= 7e+56) {
		tmp = t_1;
	} else {
		tmp = x + (y / (a / t));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - (y * ((t / z) + -1.0))
	tmp = 0
	if a <= -6.2e+62:
		tmp = x + (t * (y / a))
	elif a <= -4e-169:
		tmp = t_1
	elif a <= -7.4e-220:
		tmp = x + ((y * t) / a)
	elif a <= 7e+56:
		tmp = t_1
	else:
		tmp = x + (y / (a / t))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(y * Float64(Float64(t / z) + -1.0)))
	tmp = 0.0
	if (a <= -6.2e+62)
		tmp = Float64(x + Float64(t * Float64(y / a)));
	elseif (a <= -4e-169)
		tmp = t_1;
	elseif (a <= -7.4e-220)
		tmp = Float64(x + Float64(Float64(y * t) / a));
	elseif (a <= 7e+56)
		tmp = t_1;
	else
		tmp = Float64(x + Float64(y / Float64(a / t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x - (y * ((t / z) + -1.0));
	tmp = 0.0;
	if (a <= -6.2e+62)
		tmp = x + (t * (y / a));
	elseif (a <= -4e-169)
		tmp = t_1;
	elseif (a <= -7.4e-220)
		tmp = x + ((y * t) / a);
	elseif (a <= 7e+56)
		tmp = t_1;
	else
		tmp = x + (y / (a / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y * N[(N[(t / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6.2e+62], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -4e-169], t$95$1, If[LessEqual[a, -7.4e-220], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7e+56], t$95$1, N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -4 \cdot 10^{-169}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq -7.4 \cdot 10^{-220}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\

\mathbf{elif}\;a \leq 7 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -6.20000000000000029e62

    1. Initial program 84.0%

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

      \[\leadsto x + \color{blue}{\frac{t \cdot y}{a}} \]
    4. Step-by-step derivation
      1. associate-/l*87.0%

        \[\leadsto x + \color{blue}{t \cdot \frac{y}{a}} \]
      2. *-commutative87.0%

        \[\leadsto x + \color{blue}{\frac{y}{a} \cdot t} \]
    5. Applied egg-rr87.0%

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

    if -6.20000000000000029e62 < a < -4.00000000000000008e-169 or -7.4000000000000003e-220 < a < 6.99999999999999999e56

    1. Initial program 84.9%

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

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

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

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

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

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

    if -4.00000000000000008e-169 < a < -7.4000000000000003e-220

    1. Initial program 99.7%

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

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

    if 6.99999999999999999e56 < a

    1. Initial program 90.6%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf 81.5%

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

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

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

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

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

      \[\leadsto x - y \cdot \color{blue}{\left(-1 \cdot \frac{t}{a}\right)} \]
    9. Step-by-step derivation
      1. neg-mul-187.4%

        \[\leadsto x - y \cdot \color{blue}{\left(-\frac{t}{a}\right)} \]
      2. distribute-neg-frac287.4%

        \[\leadsto x - y \cdot \color{blue}{\frac{t}{-a}} \]
    10. Simplified87.4%

      \[\leadsto x - y \cdot \color{blue}{\frac{t}{-a}} \]
    11. Step-by-step derivation
      1. *-commutative87.4%

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

        \[\leadsto x - \color{blue}{\frac{t \cdot y}{-a}} \]
      3. add-sqr-sqrt0.0%

        \[\leadsto x - \frac{t \cdot y}{\color{blue}{\sqrt{-a} \cdot \sqrt{-a}}} \]
      4. sqrt-unprod65.4%

        \[\leadsto x - \frac{t \cdot y}{\color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}}} \]
      5. sqr-neg65.4%

        \[\leadsto x - \frac{t \cdot y}{\sqrt{\color{blue}{a \cdot a}}} \]
      6. sqrt-unprod65.4%

        \[\leadsto x - \frac{t \cdot y}{\color{blue}{\sqrt{a} \cdot \sqrt{a}}} \]
      7. add-sqr-sqrt65.4%

        \[\leadsto x - \frac{t \cdot y}{\color{blue}{a}} \]
      8. frac-2neg65.4%

        \[\leadsto x - \color{blue}{\frac{-t \cdot y}{-a}} \]
      9. *-commutative65.4%

        \[\leadsto x - \frac{-\color{blue}{y \cdot t}}{-a} \]
      10. distribute-lft-neg-in65.4%

        \[\leadsto x - \frac{\color{blue}{\left(-y\right) \cdot t}}{-a} \]
      11. associate-*r/68.4%

        \[\leadsto x - \color{blue}{\left(-y\right) \cdot \frac{t}{-a}} \]
      12. clear-num68.4%

        \[\leadsto x - \left(-y\right) \cdot \color{blue}{\frac{1}{\frac{-a}{t}}} \]
      13. un-div-inv68.4%

        \[\leadsto x - \color{blue}{\frac{-y}{\frac{-a}{t}}} \]
      14. add-sqr-sqrt0.0%

        \[\leadsto x - \frac{-y}{\frac{\color{blue}{\sqrt{-a} \cdot \sqrt{-a}}}{t}} \]
      15. sqrt-unprod75.0%

        \[\leadsto x - \frac{-y}{\frac{\color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}}}{t}} \]
      16. sqr-neg75.0%

        \[\leadsto x - \frac{-y}{\frac{\sqrt{\color{blue}{a \cdot a}}}{t}} \]
      17. sqrt-unprod87.4%

        \[\leadsto x - \frac{-y}{\frac{\color{blue}{\sqrt{a} \cdot \sqrt{a}}}{t}} \]
      18. add-sqr-sqrt87.4%

        \[\leadsto x - \frac{-y}{\frac{\color{blue}{a}}{t}} \]
    12. Applied egg-rr87.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6.2 \cdot 10^{+62}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq -4 \cdot 10^{-169}:\\ \;\;\;\;x - y \cdot \left(\frac{t}{z} + -1\right)\\ \mathbf{elif}\;a \leq -7.4 \cdot 10^{-220}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;a \leq 7 \cdot 10^{+56}:\\ \;\;\;\;x - y \cdot \left(\frac{t}{z} + -1\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 91.8% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.08 \cdot 10^{+91} \lor \neg \left(z \leq 2.2 \cdot 10^{+200}\right):\\
\;\;\;\;x - y \cdot \left(\frac{t}{z} + -1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.08e91 or 2.2e200 < z

    1. Initial program 63.9%

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z - t}{z}} \]
      2. div-sub100.0%

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

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

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

    if -1.08e91 < z < 2.2e200

    1. Initial program 94.4%

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

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

Alternative 5: 86.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+25} \lor \neg \left(z \leq 1.05 \cdot 10^{+23}\right):\\
\;\;\;\;x - y \cdot \left(\frac{t}{z} + -1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.00000000000000072e25 or 1.0500000000000001e23 < z

    1. Initial program 77.5%

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z - t}{z}} \]
      2. div-sub89.0%

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

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

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

    if -8.00000000000000072e25 < z < 1.0500000000000001e23

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 87.5% accurate, 0.6× speedup?

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

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


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

    1. Initial program 77.5%

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z - t}{z}} \]
      2. div-sub89.0%

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

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

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

    if -3.5e22 < z < 3.3000000000000001e25

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 77.8% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.50000000000000005e25 or 1.25e12 < z

    1. Initial program 78.2%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 80.0%

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified80.0%

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

    if -6.50000000000000005e25 < z < 1.25e12

    1. Initial program 95.3%

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

      \[\leadsto x + \color{blue}{\frac{t \cdot y}{a}} \]
    4. Step-by-step derivation
      1. *-un-lft-identity78.5%

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

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

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

        \[\leadsto x + \color{blue}{\frac{1 \cdot t}{a}} \cdot y \]
      5. *-un-lft-identity78.4%

        \[\leadsto x + \frac{\color{blue}{t}}{a} \cdot y \]
    5. Applied egg-rr78.4%

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

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

Alternative 8: 77.6% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.6500000000000002e28 or 1.02e13 < z

    1. Initial program 78.2%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 80.0%

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified80.0%

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

    if -2.6500000000000002e28 < z < 1.02e13

    1. Initial program 95.3%

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

      \[\leadsto x + \color{blue}{\frac{t \cdot y}{a}} \]
    4. Step-by-step derivation
      1. associate-/l*79.5%

        \[\leadsto x + \color{blue}{t \cdot \frac{y}{a}} \]
      2. *-commutative79.5%

        \[\leadsto x + \color{blue}{\frac{y}{a} \cdot t} \]
    5. Applied egg-rr79.5%

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

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

Alternative 9: 63.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.6 \cdot 10^{+62}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 2.8 \cdot 10^{+220}:\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.59999999999999992e62 or 2.8000000000000001e220 < a

    1. Initial program 82.6%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 71.7%

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

    if -1.59999999999999992e62 < a < 2.8000000000000001e220

    1. Initial program 87.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified68.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.6 \cdot 10^{+62}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 2.8 \cdot 10^{+220}:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 98.4% accurate, 0.8× speedup?

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

\\
x + \frac{-1}{\frac{\frac{z - a}{t - z}}{y}}
\end{array}
Derivation
  1. Initial program 86.7%

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

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

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

    \[\leadsto x + \color{blue}{{\left(\frac{z - a}{y \cdot \left(z - t\right)}\right)}^{-1}} \]
  5. Step-by-step derivation
    1. unpow-186.6%

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

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

      \[\leadsto x + \frac{1}{\color{blue}{\frac{\frac{z - a}{z - t}}{y}}} \]
  6. Simplified96.8%

    \[\leadsto x + \color{blue}{\frac{1}{\frac{\frac{z - a}{z - t}}{y}}} \]
  7. Final simplification96.8%

    \[\leadsto x + \frac{-1}{\frac{\frac{z - a}{t - z}}{y}} \]
  8. Add Preprocessing

Alternative 11: 51.0% 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.7%

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in y around 0 52.2%

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

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 98.5% 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 2024130 
(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))))