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

Percentage Accurate: 85.4% → 98.1%
Time: 9.1s
Alternatives: 12
Speedup: 1.0×

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 12 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.4% 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: 98.1% 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}
Derivation
  1. Initial program 87.4%

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

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

    \[\leadsto \color{blue}{x + \frac{y}{\frac{z - a}{z - t}}} \]
  4. Final simplification97.9%

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

Alternative 2: 73.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - t \cdot \frac{y}{z}\\ \mathbf{if}\;z \leq -8.5 \cdot 10^{+92}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-27}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3.25 \cdot 10^{-87}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{-116}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-194}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+33}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (* t (/ y z)))))
   (if (<= z -8.5e+92)
     (+ x y)
     (if (<= z -1.8e-27)
       t_1
       (if (<= z -3.25e-87)
         (+ x (/ y (/ a t)))
         (if (<= z -7.2e-116)
           t_1
           (if (<= z 1.1e-194)
             (+ x (* y (/ t a)))
             (if (<= z 3.8e+33) t_1 (+ x y)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (t * (y / z));
	double tmp;
	if (z <= -8.5e+92) {
		tmp = x + y;
	} else if (z <= -1.8e-27) {
		tmp = t_1;
	} else if (z <= -3.25e-87) {
		tmp = x + (y / (a / t));
	} else if (z <= -7.2e-116) {
		tmp = t_1;
	} else if (z <= 1.1e-194) {
		tmp = x + (y * (t / a));
	} else if (z <= 3.8e+33) {
		tmp = t_1;
	} else {
		tmp = x + y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x - (t * (y / z))
    if (z <= (-8.5d+92)) then
        tmp = x + y
    else if (z <= (-1.8d-27)) then
        tmp = t_1
    else if (z <= (-3.25d-87)) then
        tmp = x + (y / (a / t))
    else if (z <= (-7.2d-116)) then
        tmp = t_1
    else if (z <= 1.1d-194) then
        tmp = x + (y * (t / a))
    else if (z <= 3.8d+33) then
        tmp = t_1
    else
        tmp = x + y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (t * (y / z));
	double tmp;
	if (z <= -8.5e+92) {
		tmp = x + y;
	} else if (z <= -1.8e-27) {
		tmp = t_1;
	} else if (z <= -3.25e-87) {
		tmp = x + (y / (a / t));
	} else if (z <= -7.2e-116) {
		tmp = t_1;
	} else if (z <= 1.1e-194) {
		tmp = x + (y * (t / a));
	} else if (z <= 3.8e+33) {
		tmp = t_1;
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - (t * (y / z))
	tmp = 0
	if z <= -8.5e+92:
		tmp = x + y
	elif z <= -1.8e-27:
		tmp = t_1
	elif z <= -3.25e-87:
		tmp = x + (y / (a / t))
	elif z <= -7.2e-116:
		tmp = t_1
	elif z <= 1.1e-194:
		tmp = x + (y * (t / a))
	elif z <= 3.8e+33:
		tmp = t_1
	else:
		tmp = x + y
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(t * Float64(y / z)))
	tmp = 0.0
	if (z <= -8.5e+92)
		tmp = Float64(x + y);
	elseif (z <= -1.8e-27)
		tmp = t_1;
	elseif (z <= -3.25e-87)
		tmp = Float64(x + Float64(y / Float64(a / t)));
	elseif (z <= -7.2e-116)
		tmp = t_1;
	elseif (z <= 1.1e-194)
		tmp = Float64(x + Float64(y * Float64(t / a)));
	elseif (z <= 3.8e+33)
		tmp = t_1;
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x - (t * (y / z));
	tmp = 0.0;
	if (z <= -8.5e+92)
		tmp = x + y;
	elseif (z <= -1.8e-27)
		tmp = t_1;
	elseif (z <= -3.25e-87)
		tmp = x + (y / (a / t));
	elseif (z <= -7.2e-116)
		tmp = t_1;
	elseif (z <= 1.1e-194)
		tmp = x + (y * (t / a));
	elseif (z <= 3.8e+33)
		tmp = t_1;
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.5e+92], N[(x + y), $MachinePrecision], If[LessEqual[z, -1.8e-27], t$95$1, If[LessEqual[z, -3.25e-87], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.2e-116], t$95$1, If[LessEqual[z, 1.1e-194], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+33], t$95$1, N[(x + y), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.8 \cdot 10^{-27}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -3.25 \cdot 10^{-87}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\

\mathbf{elif}\;z \leq -7.2 \cdot 10^{-116}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 1.1 \cdot 10^{-194}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\

\mathbf{elif}\;z \leq 3.8 \cdot 10^{+33}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.5000000000000001e92 or 3.80000000000000002e33 < z

    1. Initial program 75.0%

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

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

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

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

    if -8.5000000000000001e92 < z < -1.7999999999999999e-27 or -3.2500000000000001e-87 < z < -7.19999999999999951e-116 or 1.1000000000000001e-194 < z < 3.80000000000000002e33

    1. Initial program 98.6%

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

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

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

      \[\leadsto x + \color{blue}{-1 \cdot \frac{y \cdot t}{z - a}} \]
    5. Step-by-step derivation
      1. associate-*r/81.9%

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

        \[\leadsto x + \frac{\color{blue}{-y \cdot t}}{z - a} \]
      3. distribute-rgt-neg-out81.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - \frac{y \cdot t}{z}} \]
      4. *-commutative73.5%

        \[\leadsto x - \frac{\color{blue}{t \cdot y}}{z} \]
      5. associate-*r/72.2%

        \[\leadsto x - \color{blue}{t \cdot \frac{y}{z}} \]
    9. Simplified72.2%

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

    if -1.7999999999999999e-27 < z < -3.2500000000000001e-87

    1. Initial program 87.5%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} + x \]
    6. Simplified87.0%

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

    if -7.19999999999999951e-116 < z < 1.1000000000000001e-194

    1. Initial program 90.5%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{+92}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-27}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -3.25 \cdot 10^{-87}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{-116}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-194}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+33}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 3: 87.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.6 \cdot 10^{-77} \lor \neg \left(t \leq 5 \cdot 10^{-63}\right):\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9.59999999999999961e-77 or 5.0000000000000002e-63 < t

    1. Initial program 86.1%

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

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

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

      \[\leadsto x + \color{blue}{-1 \cdot \frac{y \cdot t}{z - a}} \]
    5. Step-by-step derivation
      1. associate-*r/82.5%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x + -1 \cdot \frac{y \cdot t}{z - a}} \]
      2. neg-mul-182.5%

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

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

        \[\leadsto x - \frac{\color{blue}{t \cdot y}}{z - a} \]
      5. associate-*r/88.6%

        \[\leadsto x - \color{blue}{t \cdot \frac{y}{z - a}} \]
    9. Simplified88.6%

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

    if -9.59999999999999961e-77 < t < 5.0000000000000002e-63

    1. Initial program 89.2%

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

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

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

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

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

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

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

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

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

Alternative 4: 79.9% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;a \leq 1.28 \cdot 10^{-51}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.9000000000000002e-6

    1. Initial program 86.8%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} + x \]
    6. Simplified73.3%

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

    if -2.9000000000000002e-6 < a < 1.28000000000000004e-51

    1. Initial program 89.5%

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

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

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

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

    if 1.28000000000000004e-51 < a

    1. Initial program 84.1%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.9 \cdot 10^{-6}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;a \leq 1.28 \cdot 10^{-51}:\\ \;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \end{array} \]

Alternative 5: 80.4% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;a \leq 1.38 \cdot 10^{-52}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.6000000000000001e-11

    1. Initial program 86.8%

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

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

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

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

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

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

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

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

    if -2.6000000000000001e-11 < a < 1.38000000000000008e-52

    1. Initial program 89.5%

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

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

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

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

    if 1.38000000000000008e-52 < a

    1. Initial program 84.1%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.6 \cdot 10^{-11}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{elif}\;a \leq 1.38 \cdot 10^{-52}:\\ \;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \end{array} \]

Alternative 6: 63.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{+80} \lor \neg \left(y \leq 9.2 \cdot 10^{+159}\right):\\
\;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.49999999999999993e80 or 9.19999999999999981e159 < y

    1. Initial program 69.2%

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

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

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

      \[\leadsto x + \frac{y}{\color{blue}{\frac{z}{z - t}}} \]
    5. Taylor expanded in y around inf 51.1%

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

    if -1.49999999999999993e80 < y < 9.19999999999999981e159

    1. Initial program 94.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.5 \cdot 10^{+80} \lor \neg \left(y \leq 9.2 \cdot 10^{+159}\right):\\ \;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 7: 76.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -6 \cdot 10^{-27}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 240000000:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -6e-27)
   (+ x y)
   (if (<= z 240000000.0) (+ x (* t (/ y a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -6e-27) {
		tmp = x + y;
	} else if (z <= 240000000.0) {
		tmp = x + (t * (y / a));
	} else {
		tmp = x + y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z <= (-6d-27)) then
        tmp = x + y
    else if (z <= 240000000.0d0) then
        tmp = x + (t * (y / a))
    else
        tmp = x + y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -6e-27) {
		tmp = x + y;
	} else if (z <= 240000000.0) {
		tmp = x + (t * (y / a));
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -6e-27:
		tmp = x + y
	elif z <= 240000000.0:
		tmp = x + (t * (y / a))
	else:
		tmp = x + y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -6e-27)
		tmp = Float64(x + y);
	elseif (z <= 240000000.0)
		tmp = Float64(x + Float64(t * Float64(y / a)));
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -6e-27)
		tmp = x + y;
	elseif (z <= 240000000.0)
		tmp = x + (t * (y / a));
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6e-27], N[(x + y), $MachinePrecision], If[LessEqual[z, 240000000.0], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 240000000:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.0000000000000002e-27 or 2.4e8 < z

    1. Initial program 81.6%

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

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

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

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

    if -6.0000000000000002e-27 < z < 2.4e8

    1. Initial program 92.8%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{t \cdot \frac{y}{a}} \]
    6. Simplified74.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6 \cdot 10^{-27}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 240000000:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 8: 75.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.15 \cdot 10^{+102}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 5200000000:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -2.15e+102)
   (+ x y)
   (if (<= z 5200000000.0) (+ x (* y (/ t a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2.15e+102) {
		tmp = x + y;
	} else if (z <= 5200000000.0) {
		tmp = x + (y * (t / a));
	} else {
		tmp = x + y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z <= (-2.15d+102)) then
        tmp = x + y
    else if (z <= 5200000000.0d0) then
        tmp = x + (y * (t / a))
    else
        tmp = x + y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2.15e+102) {
		tmp = x + y;
	} else if (z <= 5200000000.0) {
		tmp = x + (y * (t / a));
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -2.15e+102:
		tmp = x + y
	elif z <= 5200000000.0:
		tmp = x + (y * (t / a))
	else:
		tmp = x + y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -2.15e+102)
		tmp = Float64(x + y);
	elseif (z <= 5200000000.0)
		tmp = Float64(x + Float64(y * Float64(t / a)));
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -2.15e+102)
		tmp = x + y;
	elseif (z <= 5200000000.0)
		tmp = x + (y * (t / a));
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.15e+102], N[(x + y), $MachinePrecision], If[LessEqual[z, 5200000000.0], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 5200000000:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.15e102 or 5.2e9 < z

    1. Initial program 76.8%

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

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

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

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

    if -2.15e102 < z < 5.2e9

    1. Initial program 93.5%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.15 \cdot 10^{+102}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 5200000000:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 9: 75.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.16 \cdot 10^{+102}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 4600000:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -2.16e+102)
   (+ x y)
   (if (<= z 4600000.0) (+ x (/ y (/ a t))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2.16e+102) {
		tmp = x + y;
	} else if (z <= 4600000.0) {
		tmp = x + (y / (a / t));
	} else {
		tmp = x + y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z <= (-2.16d+102)) then
        tmp = x + y
    else if (z <= 4600000.0d0) then
        tmp = x + (y / (a / t))
    else
        tmp = x + y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2.16e+102) {
		tmp = x + y;
	} else if (z <= 4600000.0) {
		tmp = x + (y / (a / t));
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -2.16e+102:
		tmp = x + y
	elif z <= 4600000.0:
		tmp = x + (y / (a / t))
	else:
		tmp = x + y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -2.16e+102)
		tmp = Float64(x + y);
	elseif (z <= 4600000.0)
		tmp = Float64(x + Float64(y / Float64(a / t)));
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -2.16e+102)
		tmp = x + y;
	elseif (z <= 4600000.0)
		tmp = x + (y / (a / t));
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.16e+102], N[(x + y), $MachinePrecision], If[LessEqual[z, 4600000.0], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 4600000:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.16000000000000005e102 or 4.6e6 < z

    1. Initial program 76.8%

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

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

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

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

    if -2.16000000000000005e102 < z < 4.6e6

    1. Initial program 93.5%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} + x \]
    6. Simplified72.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.16 \cdot 10^{+102}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 4600000:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 10: 95.9% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 11: 63.3% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{-27}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-27}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1.5e-27) (+ x y) (if (<= z 8.5e-27) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.5e-27) {
		tmp = x + y;
	} else if (z <= 8.5e-27) {
		tmp = x;
	} else {
		tmp = x + y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z <= (-1.5d-27)) then
        tmp = x + y
    else if (z <= 8.5d-27) then
        tmp = x
    else
        tmp = x + y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.5e-27) {
		tmp = x + y;
	} else if (z <= 8.5e-27) {
		tmp = x;
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1.5e-27:
		tmp = x + y
	elif z <= 8.5e-27:
		tmp = x
	else:
		tmp = x + y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1.5e-27)
		tmp = Float64(x + y);
	elseif (z <= 8.5e-27)
		tmp = x;
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1.5e-27)
		tmp = x + y;
	elseif (z <= 8.5e-27)
		tmp = x;
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.5e-27], N[(x + y), $MachinePrecision], If[LessEqual[z, 8.5e-27], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 8.5 \cdot 10^{-27}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.5000000000000001e-27 or 8.50000000000000033e-27 < z

    1. Initial program 82.9%

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

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

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

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

    if -1.5000000000000001e-27 < z < 8.50000000000000033e-27

    1. Initial program 92.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{-27}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-27}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 12: 50.1% 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 87.4%

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification51.1%

    \[\leadsto x \]

Developer target: 98.1% 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 2023196 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
  :precision binary64

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

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