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

Percentage Accurate: 85.6% → 98.1%
Time: 8.8s
Alternatives: 10
Speedup: 1.0×

Specification

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

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

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

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

Alternative 1: 98.1% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 2: 82.1% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t \leq 7.5 \cdot 10^{-34}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 1.4 \cdot 10^{-28}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 5.5 \cdot 10^{+102}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 5 \cdot 10^{+118}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 7 \cdot 10^{+155}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.28000000000000003e66 or 6.99999999999999969e155 < t

    1. Initial program 72.9%

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

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

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

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

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

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

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

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

    if -1.28000000000000003e66 < t < 7.5000000000000004e-34 or 1.3999999999999999e-28 < t < 5.49999999999999981e102 or 4.99999999999999972e118 < t < 6.99999999999999969e155

    1. Initial program 96.8%

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

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

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

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

    if 7.5000000000000004e-34 < t < 1.3999999999999999e-28 or 5.49999999999999981e102 < t < 4.99999999999999972e118

    1. Initial program 91.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - \frac{t \cdot y}{a - t}} \]
      3. *-commutative91.7%

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a - t}{t}}} \]
      5. div-sub99.9%

        \[\leadsto x - \frac{y}{\color{blue}{\frac{a}{t} - \frac{t}{t}}} \]
      6. sub-neg99.9%

        \[\leadsto x - \frac{y}{\color{blue}{\frac{a}{t} + \left(-\frac{t}{t}\right)}} \]
      7. *-inverses99.9%

        \[\leadsto x - \frac{y}{\frac{a}{t} + \left(-\color{blue}{1}\right)} \]
      8. metadata-eval99.9%

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

      \[\leadsto \color{blue}{x - \frac{y}{\frac{a}{t} + -1}} \]
    7. Taylor expanded in x around 0 99.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{y}{\frac{a}{t} - 1}} \]
    8. Step-by-step derivation
      1. sub-neg99.9%

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

        \[\leadsto -1 \cdot \frac{y}{\frac{a}{t} + \color{blue}{-1}} \]
      3. associate-*r/99.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot y}{\frac{a}{t} + -1}} \]
      4. neg-mul-199.9%

        \[\leadsto \frac{\color{blue}{-y}}{\frac{a}{t} + -1} \]
      5. +-commutative99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.28 \cdot 10^{+66}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{-34}:\\ \;\;\;\;x + \frac{y \cdot z}{a - t}\\ \mathbf{elif}\;t \leq 1.4 \cdot 10^{-28}:\\ \;\;\;\;\frac{-y}{\frac{a}{t} + -1}\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{+102}:\\ \;\;\;\;x + \frac{y \cdot z}{a - t}\\ \mathbf{elif}\;t \leq 5 \cdot 10^{+118}:\\ \;\;\;\;\frac{-y}{\frac{a}{t} + -1}\\ \mathbf{elif}\;t \leq 7 \cdot 10^{+155}:\\ \;\;\;\;x + \frac{y \cdot z}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 3: 73.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-y}{\frac{a}{t} + -1}\\ t_2 := x + \frac{y \cdot z}{a}\\ \mathbf{if}\;t \leq -7.4 \cdot 10^{+33}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{-55}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{-24}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{+102}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 6 \cdot 10^{+118}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{+142}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- y) (+ (/ a t) -1.0))) (t_2 (+ x (/ (* y z) a))))
   (if (<= t -7.4e+33)
     (+ x y)
     (if (<= t 4.8e-55)
       (+ x (/ y (/ a z)))
       (if (<= t 4.8e-24)
         t_1
         (if (<= t 1.65e+102)
           t_2
           (if (<= t 6e+118) t_1 (if (<= t 3.4e+142) t_2 (+ x y)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = -y / ((a / t) + -1.0);
	double t_2 = x + ((y * z) / a);
	double tmp;
	if (t <= -7.4e+33) {
		tmp = x + y;
	} else if (t <= 4.8e-55) {
		tmp = x + (y / (a / z));
	} else if (t <= 4.8e-24) {
		tmp = t_1;
	} else if (t <= 1.65e+102) {
		tmp = t_2;
	} else if (t <= 6e+118) {
		tmp = t_1;
	} else if (t <= 3.4e+142) {
		tmp = t_2;
	} 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) :: t_2
    real(8) :: tmp
    t_1 = -y / ((a / t) + (-1.0d0))
    t_2 = x + ((y * z) / a)
    if (t <= (-7.4d+33)) then
        tmp = x + y
    else if (t <= 4.8d-55) then
        tmp = x + (y / (a / z))
    else if (t <= 4.8d-24) then
        tmp = t_1
    else if (t <= 1.65d+102) then
        tmp = t_2
    else if (t <= 6d+118) then
        tmp = t_1
    else if (t <= 3.4d+142) then
        tmp = t_2
    else
        tmp = x + y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = -y / ((a / t) + -1.0);
	double t_2 = x + ((y * z) / a);
	double tmp;
	if (t <= -7.4e+33) {
		tmp = x + y;
	} else if (t <= 4.8e-55) {
		tmp = x + (y / (a / z));
	} else if (t <= 4.8e-24) {
		tmp = t_1;
	} else if (t <= 1.65e+102) {
		tmp = t_2;
	} else if (t <= 6e+118) {
		tmp = t_1;
	} else if (t <= 3.4e+142) {
		tmp = t_2;
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = -y / ((a / t) + -1.0)
	t_2 = x + ((y * z) / a)
	tmp = 0
	if t <= -7.4e+33:
		tmp = x + y
	elif t <= 4.8e-55:
		tmp = x + (y / (a / z))
	elif t <= 4.8e-24:
		tmp = t_1
	elif t <= 1.65e+102:
		tmp = t_2
	elif t <= 6e+118:
		tmp = t_1
	elif t <= 3.4e+142:
		tmp = t_2
	else:
		tmp = x + y
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(-y) / Float64(Float64(a / t) + -1.0))
	t_2 = Float64(x + Float64(Float64(y * z) / a))
	tmp = 0.0
	if (t <= -7.4e+33)
		tmp = Float64(x + y);
	elseif (t <= 4.8e-55)
		tmp = Float64(x + Float64(y / Float64(a / z)));
	elseif (t <= 4.8e-24)
		tmp = t_1;
	elseif (t <= 1.65e+102)
		tmp = t_2;
	elseif (t <= 6e+118)
		tmp = t_1;
	elseif (t <= 3.4e+142)
		tmp = t_2;
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = -y / ((a / t) + -1.0);
	t_2 = x + ((y * z) / a);
	tmp = 0.0;
	if (t <= -7.4e+33)
		tmp = x + y;
	elseif (t <= 4.8e-55)
		tmp = x + (y / (a / z));
	elseif (t <= 4.8e-24)
		tmp = t_1;
	elseif (t <= 1.65e+102)
		tmp = t_2;
	elseif (t <= 6e+118)
		tmp = t_1;
	elseif (t <= 3.4e+142)
		tmp = t_2;
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-y) / N[(N[(a / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.4e+33], N[(x + y), $MachinePrecision], If[LessEqual[t, 4.8e-55], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.8e-24], t$95$1, If[LessEqual[t, 1.65e+102], t$95$2, If[LessEqual[t, 6e+118], t$95$1, If[LessEqual[t, 3.4e+142], t$95$2, N[(x + y), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;t \leq 4.8 \cdot 10^{-24}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 1.65 \cdot 10^{+102}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 6 \cdot 10^{+118}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 3.4 \cdot 10^{+142}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -7.3999999999999997e33 or 3.3999999999999998e142 < t

    1. Initial program 75.1%

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

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

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

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

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

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

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

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

    if -7.3999999999999997e33 < t < 4.79999999999999983e-55

    1. Initial program 97.5%

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

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

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

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

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

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

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

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

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

    if 4.79999999999999983e-55 < t < 4.7999999999999996e-24 or 1.64999999999999999e102 < t < 6e118

    1. Initial program 93.9%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - \frac{t \cdot y}{a - t}} \]
      3. *-commutative74.7%

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a - t}{t}}} \]
      5. div-sub80.6%

        \[\leadsto x - \frac{y}{\color{blue}{\frac{a}{t} - \frac{t}{t}}} \]
      6. sub-neg80.6%

        \[\leadsto x - \frac{y}{\color{blue}{\frac{a}{t} + \left(-\frac{t}{t}\right)}} \]
      7. *-inverses80.6%

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

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

      \[\leadsto \color{blue}{x - \frac{y}{\frac{a}{t} + -1}} \]
    7. Taylor expanded in x around 0 80.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{y}{\frac{a}{t} - 1}} \]
    8. Step-by-step derivation
      1. sub-neg80.6%

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

        \[\leadsto -1 \cdot \frac{y}{\frac{a}{t} + \color{blue}{-1}} \]
      3. associate-*r/80.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot y}{\frac{a}{t} + -1}} \]
      4. neg-mul-180.6%

        \[\leadsto \frac{\color{blue}{-y}}{\frac{a}{t} + -1} \]
      5. +-commutative80.6%

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

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

    if 4.7999999999999996e-24 < t < 1.64999999999999999e102 or 6e118 < t < 3.3999999999999998e142

    1. Initial program 92.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7.4 \cdot 10^{+33}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{-55}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{-24}:\\ \;\;\;\;\frac{-y}{\frac{a}{t} + -1}\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{+102}:\\ \;\;\;\;x + \frac{y \cdot z}{a}\\ \mathbf{elif}\;t \leq 6 \cdot 10^{+118}:\\ \;\;\;\;\frac{-y}{\frac{a}{t} + -1}\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{+142}:\\ \;\;\;\;x + \frac{y \cdot z}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 4: 73.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{y \cdot z}{a}\\ \mathbf{if}\;t \leq -3.1 \cdot 10^{+34}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{-55}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.08 \cdot 10^{-23}:\\ \;\;\;\;y \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{elif}\;t \leq 6 \cdot 10^{+99}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (/ (* y z) a))))
   (if (<= t -3.1e+34)
     (+ x y)
     (if (<= t 4.8e-55)
       t_1
       (if (<= t 1.08e-23)
         (* y (- 1.0 (/ z t)))
         (if (<= t 6e+99) t_1 (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y * z) / a);
	double tmp;
	if (t <= -3.1e+34) {
		tmp = x + y;
	} else if (t <= 4.8e-55) {
		tmp = t_1;
	} else if (t <= 1.08e-23) {
		tmp = y * (1.0 - (z / t));
	} else if (t <= 6e+99) {
		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 + ((y * z) / a)
    if (t <= (-3.1d+34)) then
        tmp = x + y
    else if (t <= 4.8d-55) then
        tmp = t_1
    else if (t <= 1.08d-23) then
        tmp = y * (1.0d0 - (z / t))
    else if (t <= 6d+99) 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 + ((y * z) / a);
	double tmp;
	if (t <= -3.1e+34) {
		tmp = x + y;
	} else if (t <= 4.8e-55) {
		tmp = t_1;
	} else if (t <= 1.08e-23) {
		tmp = y * (1.0 - (z / t));
	} else if (t <= 6e+99) {
		tmp = t_1;
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((y * z) / a)
	tmp = 0
	if t <= -3.1e+34:
		tmp = x + y
	elif t <= 4.8e-55:
		tmp = t_1
	elif t <= 1.08e-23:
		tmp = y * (1.0 - (z / t))
	elif t <= 6e+99:
		tmp = t_1
	else:
		tmp = x + y
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(y * z) / a))
	tmp = 0.0
	if (t <= -3.1e+34)
		tmp = Float64(x + y);
	elseif (t <= 4.8e-55)
		tmp = t_1;
	elseif (t <= 1.08e-23)
		tmp = Float64(y * Float64(1.0 - Float64(z / t)));
	elseif (t <= 6e+99)
		tmp = t_1;
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + ((y * z) / a);
	tmp = 0.0;
	if (t <= -3.1e+34)
		tmp = x + y;
	elseif (t <= 4.8e-55)
		tmp = t_1;
	elseif (t <= 1.08e-23)
		tmp = y * (1.0 - (z / t));
	elseif (t <= 6e+99)
		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[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.1e+34], N[(x + y), $MachinePrecision], If[LessEqual[t, 4.8e-55], t$95$1, If[LessEqual[t, 1.08e-23], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6e+99], t$95$1, N[(x + y), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 4.8 \cdot 10^{-55}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 1.08 \cdot 10^{-23}:\\
\;\;\;\;y \cdot \left(1 - \frac{z}{t}\right)\\

\mathbf{elif}\;t \leq 6 \cdot 10^{+99}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.09999999999999977e34 or 6.00000000000000029e99 < t

    1. Initial program 76.3%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    6. Simplified82.0%

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

    if -3.09999999999999977e34 < t < 4.79999999999999983e-55 or 1.08000000000000003e-23 < t < 6.00000000000000029e99

    1. Initial program 96.5%

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

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

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

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

    if 4.79999999999999983e-55 < t < 1.08000000000000003e-23

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{z - t}}} \]
    6. Simplified67.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.1 \cdot 10^{+34}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{-55}:\\ \;\;\;\;x + \frac{y \cdot z}{a}\\ \mathbf{elif}\;t \leq 1.08 \cdot 10^{-23}:\\ \;\;\;\;y \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{elif}\;t \leq 6 \cdot 10^{+99}:\\ \;\;\;\;x + \frac{y \cdot z}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 5: 83.3% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.4e41 or 2.30000000000000012e39 < z

    1. Initial program 92.0%

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

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

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

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

    if -1.4e41 < z < 2.30000000000000012e39

    1. Initial program 85.4%

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

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

      \[\leadsto \color{blue}{x + \frac{y}{\frac{a - t}{z - t}}} \]
    4. Step-by-step derivation
      1. clear-num99.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{t}{\frac{a - t}{y}}} \]
    11. Simplified92.9%

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

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

Alternative 6: 84.5% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.8e40 or 4.90000000000000002e38 < z

    1. Initial program 92.0%

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

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

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

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

    if -4.8e40 < z < 4.90000000000000002e38

    1. Initial program 85.4%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - \frac{t \cdot y}{a - t}} \]
      3. *-commutative81.5%

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a - t}{t}}} \]
      5. div-sub95.4%

        \[\leadsto x - \frac{y}{\color{blue}{\frac{a}{t} - \frac{t}{t}}} \]
      6. sub-neg95.4%

        \[\leadsto x - \frac{y}{\color{blue}{\frac{a}{t} + \left(-\frac{t}{t}\right)}} \]
      7. *-inverses95.4%

        \[\leadsto x - \frac{y}{\frac{a}{t} + \left(-\color{blue}{1}\right)} \]
      8. metadata-eval95.4%

        \[\leadsto x - \frac{y}{\frac{a}{t} + \color{blue}{-1}} \]
    6. Simplified95.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{+40} \lor \neg \left(z \leq 4.9 \cdot 10^{+38}\right):\\ \;\;\;\;x + \frac{y \cdot z}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\frac{a}{t} + -1}\\ \end{array} \]

Alternative 7: 70.1% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -0.00610000000000000039 or 1.7e93 < a

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

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

    if -0.00610000000000000039 < a < 1.7e93

    1. Initial program 86.9%

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

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

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

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

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

      \[\leadsto \color{blue}{x + y} \]
    5. Step-by-step derivation
      1. +-commutative71.9%

        \[\leadsto \color{blue}{y + x} \]
    6. Simplified71.9%

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

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

Alternative 8: 96.2% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

Alternative 9: 60.5% accurate, 3.7× speedup?

\[\begin{array}{l} \\ x + y \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x y))
double code(double x, double y, double z, double t, double a) {
	return x + y;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + y
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + y;
}
def code(x, y, z, t, a):
	return x + y
function code(x, y, z, t, a)
	return Float64(x + y)
end
function tmp = code(x, y, z, t, a)
	tmp = x + y;
end
code[x_, y_, z_, t_, a_] := N[(x + y), $MachinePrecision]
\begin{array}{l}

\\
x + y
\end{array}
Derivation
  1. Initial program 88.2%

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{y + x} \]
  7. Final simplification66.3%

    \[\leadsto x + y \]

Alternative 10: 51.5% 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 88.2%

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification52.9%

    \[\leadsto x \]

Developer target: 98.1% accurate, 1.0× speedup?

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

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

Reproduce

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

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

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