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

Percentage Accurate: 85.8% → 98.1%
Time: 11.0s
Alternatives: 15
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 15 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.8% 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 + y \cdot \frac{z - t}{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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

Alternative 2: 71.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot \frac{z}{a}\\ \mathbf{if}\;a \leq -3.3 \cdot 10^{-124}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -8 \cdot 10^{-190}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;a \leq -2.6 \cdot 10^{-190}:\\ \;\;\;\;\frac{y \cdot z}{a - t}\\ \mathbf{elif}\;a \leq 2.4 \cdot 10^{-211}:\\ \;\;\;\;x - \frac{z}{\frac{t}{y}}\\ \mathbf{elif}\;a \leq 1.6 \cdot 10^{-94}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{-40}:\\ \;\;\;\;x - \frac{y}{\frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* y (/ z a)))))
   (if (<= a -3.3e-124)
     t_1
     (if (<= a -8e-190)
       (+ y x)
       (if (<= a -2.6e-190)
         (/ (* y z) (- a t))
         (if (<= a 2.4e-211)
           (- x (/ z (/ t y)))
           (if (<= a 1.6e-94)
             (+ y x)
             (if (<= a 7.5e-40) (- x (/ y (/ t z))) t_1))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * (z / a));
	double tmp;
	if (a <= -3.3e-124) {
		tmp = t_1;
	} else if (a <= -8e-190) {
		tmp = y + x;
	} else if (a <= -2.6e-190) {
		tmp = (y * z) / (a - t);
	} else if (a <= 2.4e-211) {
		tmp = x - (z / (t / y));
	} else if (a <= 1.6e-94) {
		tmp = y + x;
	} else if (a <= 7.5e-40) {
		tmp = x - (y / (t / z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + (y * (z / a))
    if (a <= (-3.3d-124)) then
        tmp = t_1
    else if (a <= (-8d-190)) then
        tmp = y + x
    else if (a <= (-2.6d-190)) then
        tmp = (y * z) / (a - t)
    else if (a <= 2.4d-211) then
        tmp = x - (z / (t / y))
    else if (a <= 1.6d-94) then
        tmp = y + x
    else if (a <= 7.5d-40) then
        tmp = x - (y / (t / z))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * (z / a));
	double tmp;
	if (a <= -3.3e-124) {
		tmp = t_1;
	} else if (a <= -8e-190) {
		tmp = y + x;
	} else if (a <= -2.6e-190) {
		tmp = (y * z) / (a - t);
	} else if (a <= 2.4e-211) {
		tmp = x - (z / (t / y));
	} else if (a <= 1.6e-94) {
		tmp = y + x;
	} else if (a <= 7.5e-40) {
		tmp = x - (y / (t / z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (y * (z / a))
	tmp = 0
	if a <= -3.3e-124:
		tmp = t_1
	elif a <= -8e-190:
		tmp = y + x
	elif a <= -2.6e-190:
		tmp = (y * z) / (a - t)
	elif a <= 2.4e-211:
		tmp = x - (z / (t / y))
	elif a <= 1.6e-94:
		tmp = y + x
	elif a <= 7.5e-40:
		tmp = x - (y / (t / z))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(y * Float64(z / a)))
	tmp = 0.0
	if (a <= -3.3e-124)
		tmp = t_1;
	elseif (a <= -8e-190)
		tmp = Float64(y + x);
	elseif (a <= -2.6e-190)
		tmp = Float64(Float64(y * z) / Float64(a - t));
	elseif (a <= 2.4e-211)
		tmp = Float64(x - Float64(z / Float64(t / y)));
	elseif (a <= 1.6e-94)
		tmp = Float64(y + x);
	elseif (a <= 7.5e-40)
		tmp = Float64(x - Float64(y / Float64(t / z)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (y * (z / a));
	tmp = 0.0;
	if (a <= -3.3e-124)
		tmp = t_1;
	elseif (a <= -8e-190)
		tmp = y + x;
	elseif (a <= -2.6e-190)
		tmp = (y * z) / (a - t);
	elseif (a <= 2.4e-211)
		tmp = x - (z / (t / y));
	elseif (a <= 1.6e-94)
		tmp = y + x;
	elseif (a <= 7.5e-40)
		tmp = x - (y / (t / z));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.3e-124], t$95$1, If[LessEqual[a, -8e-190], N[(y + x), $MachinePrecision], If[LessEqual[a, -2.6e-190], N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.4e-211], N[(x - N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.6e-94], N[(y + x), $MachinePrecision], If[LessEqual[a, 7.5e-40], N[(x - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -8 \cdot 10^{-190}:\\
\;\;\;\;y + x\\

\mathbf{elif}\;a \leq -2.6 \cdot 10^{-190}:\\
\;\;\;\;\frac{y \cdot z}{a - t}\\

\mathbf{elif}\;a \leq 2.4 \cdot 10^{-211}:\\
\;\;\;\;x - \frac{z}{\frac{t}{y}}\\

\mathbf{elif}\;a \leq 1.6 \cdot 10^{-94}:\\
\;\;\;\;y + x\\

\mathbf{elif}\;a \leq 7.5 \cdot 10^{-40}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z}}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -3.29999999999999984e-124 or 7.50000000000000069e-40 < a

    1. Initial program 83.2%

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

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

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

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

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

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

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

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

    if -3.29999999999999984e-124 < a < -8.0000000000000002e-190 or 2.4000000000000002e-211 < a < 1.59999999999999998e-94

    1. Initial program 77.8%

      \[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}{a - t} \cdot \left(z - t\right)} \]
    3. Simplified99.9%

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

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

    if -8.0000000000000002e-190 < a < -2.5999999999999998e-190

    1. Initial program 100.0%

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

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

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

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

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

    if -2.5999999999999998e-190 < a < 2.4000000000000002e-211

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.59999999999999998e-94 < a < 7.50000000000000069e-40

    1. Initial program 76.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.3 \cdot 10^{-124}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \mathbf{elif}\;a \leq -8 \cdot 10^{-190}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;a \leq -2.6 \cdot 10^{-190}:\\ \;\;\;\;\frac{y \cdot z}{a - t}\\ \mathbf{elif}\;a \leq 2.4 \cdot 10^{-211}:\\ \;\;\;\;x - \frac{z}{\frac{t}{y}}\\ \mathbf{elif}\;a \leq 1.6 \cdot 10^{-94}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{-40}:\\ \;\;\;\;x - \frac{y}{\frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \end{array} \]

Alternative 3: 71.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot \frac{z}{a}\\ \mathbf{if}\;a \leq -8 \cdot 10^{-122}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -4.3 \cdot 10^{-190}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;a \leq -2.9 \cdot 10^{-190}:\\ \;\;\;\;\frac{y \cdot z}{a - t}\\ \mathbf{elif}\;a \leq 8 \cdot 10^{-218}:\\ \;\;\;\;x - \frac{y \cdot z}{t}\\ \mathbf{elif}\;a \leq 5.1 \cdot 10^{-98}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;a \leq 7.2 \cdot 10^{-42}:\\ \;\;\;\;x - \frac{y}{\frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* y (/ z a)))))
   (if (<= a -8e-122)
     t_1
     (if (<= a -4.3e-190)
       (+ y x)
       (if (<= a -2.9e-190)
         (/ (* y z) (- a t))
         (if (<= a 8e-218)
           (- x (/ (* y z) t))
           (if (<= a 5.1e-98)
             (+ y x)
             (if (<= a 7.2e-42) (- x (/ y (/ t z))) t_1))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * (z / a));
	double tmp;
	if (a <= -8e-122) {
		tmp = t_1;
	} else if (a <= -4.3e-190) {
		tmp = y + x;
	} else if (a <= -2.9e-190) {
		tmp = (y * z) / (a - t);
	} else if (a <= 8e-218) {
		tmp = x - ((y * z) / t);
	} else if (a <= 5.1e-98) {
		tmp = y + x;
	} else if (a <= 7.2e-42) {
		tmp = x - (y / (t / z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + (y * (z / a))
    if (a <= (-8d-122)) then
        tmp = t_1
    else if (a <= (-4.3d-190)) then
        tmp = y + x
    else if (a <= (-2.9d-190)) then
        tmp = (y * z) / (a - t)
    else if (a <= 8d-218) then
        tmp = x - ((y * z) / t)
    else if (a <= 5.1d-98) then
        tmp = y + x
    else if (a <= 7.2d-42) then
        tmp = x - (y / (t / z))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * (z / a));
	double tmp;
	if (a <= -8e-122) {
		tmp = t_1;
	} else if (a <= -4.3e-190) {
		tmp = y + x;
	} else if (a <= -2.9e-190) {
		tmp = (y * z) / (a - t);
	} else if (a <= 8e-218) {
		tmp = x - ((y * z) / t);
	} else if (a <= 5.1e-98) {
		tmp = y + x;
	} else if (a <= 7.2e-42) {
		tmp = x - (y / (t / z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (y * (z / a))
	tmp = 0
	if a <= -8e-122:
		tmp = t_1
	elif a <= -4.3e-190:
		tmp = y + x
	elif a <= -2.9e-190:
		tmp = (y * z) / (a - t)
	elif a <= 8e-218:
		tmp = x - ((y * z) / t)
	elif a <= 5.1e-98:
		tmp = y + x
	elif a <= 7.2e-42:
		tmp = x - (y / (t / z))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(y * Float64(z / a)))
	tmp = 0.0
	if (a <= -8e-122)
		tmp = t_1;
	elseif (a <= -4.3e-190)
		tmp = Float64(y + x);
	elseif (a <= -2.9e-190)
		tmp = Float64(Float64(y * z) / Float64(a - t));
	elseif (a <= 8e-218)
		tmp = Float64(x - Float64(Float64(y * z) / t));
	elseif (a <= 5.1e-98)
		tmp = Float64(y + x);
	elseif (a <= 7.2e-42)
		tmp = Float64(x - Float64(y / Float64(t / z)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (y * (z / a));
	tmp = 0.0;
	if (a <= -8e-122)
		tmp = t_1;
	elseif (a <= -4.3e-190)
		tmp = y + x;
	elseif (a <= -2.9e-190)
		tmp = (y * z) / (a - t);
	elseif (a <= 8e-218)
		tmp = x - ((y * z) / t);
	elseif (a <= 5.1e-98)
		tmp = y + x;
	elseif (a <= 7.2e-42)
		tmp = x - (y / (t / z));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -8e-122], t$95$1, If[LessEqual[a, -4.3e-190], N[(y + x), $MachinePrecision], If[LessEqual[a, -2.9e-190], N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8e-218], N[(x - N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.1e-98], N[(y + x), $MachinePrecision], If[LessEqual[a, 7.2e-42], N[(x - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -4.3 \cdot 10^{-190}:\\
\;\;\;\;y + x\\

\mathbf{elif}\;a \leq -2.9 \cdot 10^{-190}:\\
\;\;\;\;\frac{y \cdot z}{a - t}\\

\mathbf{elif}\;a \leq 8 \cdot 10^{-218}:\\
\;\;\;\;x - \frac{y \cdot z}{t}\\

\mathbf{elif}\;a \leq 5.1 \cdot 10^{-98}:\\
\;\;\;\;y + x\\

\mathbf{elif}\;a \leq 7.2 \cdot 10^{-42}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z}}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -8.00000000000000047e-122 or 7.2000000000000004e-42 < a

    1. Initial program 83.2%

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

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

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

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

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

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

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

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

    if -8.00000000000000047e-122 < a < -4.3e-190 or 8.0000000000000003e-218 < a < 5.10000000000000022e-98

    1. Initial program 77.8%

      \[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}{a - t} \cdot \left(z - t\right)} \]
    3. Simplified99.9%

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

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

    if -4.3e-190 < a < -2.9000000000000002e-190

    1. Initial program 100.0%

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

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

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

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

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

    if -2.9000000000000002e-190 < a < 8.0000000000000003e-218

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.10000000000000022e-98 < a < 7.2000000000000004e-42

    1. Initial program 76.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -8 \cdot 10^{-122}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \mathbf{elif}\;a \leq -4.3 \cdot 10^{-190}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;a \leq -2.9 \cdot 10^{-190}:\\ \;\;\;\;\frac{y \cdot z}{a - t}\\ \mathbf{elif}\;a \leq 8 \cdot 10^{-218}:\\ \;\;\;\;x - \frac{y \cdot z}{t}\\ \mathbf{elif}\;a \leq 5.1 \cdot 10^{-98}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;a \leq 7.2 \cdot 10^{-42}:\\ \;\;\;\;x - \frac{y}{\frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \end{array} \]

Alternative 4: 86.1% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq 9 \cdot 10^{-89}:\\
\;\;\;\;x - \frac{y}{\frac{a}{t} + -1}\\

\mathbf{elif}\;z \leq 6.6 \cdot 10^{-28} \lor \neg \left(z \leq 7.2 \cdot 10^{+22}\right):\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.89999999999999983e-66

    1. Initial program 87.1%

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

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

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

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

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

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

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

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

    if -3.89999999999999983e-66 < z < 8.9999999999999998e-89

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.9999999999999998e-89 < z < 6.6000000000000003e-28 or 7.2e22 < z

    1. Initial program 83.4%

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

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

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

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

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

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

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

    if 6.6000000000000003e-28 < z < 7.2e22

    1. Initial program 62.8%

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

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{a - t} \cdot y} \]
    6. Applied egg-rr90.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.9 \cdot 10^{-66}:\\ \;\;\;\;x + y \cdot \frac{z}{a - t}\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-89}:\\ \;\;\;\;x - \frac{y}{\frac{a}{t} + -1}\\ \mathbf{elif}\;z \leq 6.6 \cdot 10^{-28} \lor \neg \left(z \leq 7.2 \cdot 10^{+22}\right):\\ \;\;\;\;x + z \cdot \frac{y}{a - t}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \end{array} \]

Alternative 5: 71.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - \frac{y}{\frac{t}{z}}\\ \mathbf{if}\;a \leq -5.4 \cdot 10^{-142}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 9.1 \cdot 10^{-209}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 2.35 \cdot 10^{-94}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;a \leq 5.4 \cdot 10^{-42}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (/ y (/ t z)))))
   (if (<= a -5.4e-142)
     (+ x (* z (/ y a)))
     (if (<= a 9.1e-209)
       t_1
       (if (<= a 2.35e-94)
         (+ y x)
         (if (<= a 5.4e-42) t_1 (+ x (* y (/ z a)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (y / (t / z));
	double tmp;
	if (a <= -5.4e-142) {
		tmp = x + (z * (y / a));
	} else if (a <= 9.1e-209) {
		tmp = t_1;
	} else if (a <= 2.35e-94) {
		tmp = y + x;
	} else if (a <= 5.4e-42) {
		tmp = t_1;
	} else {
		tmp = x + (y * (z / a));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x - (y / (t / z))
    if (a <= (-5.4d-142)) then
        tmp = x + (z * (y / a))
    else if (a <= 9.1d-209) then
        tmp = t_1
    else if (a <= 2.35d-94) then
        tmp = y + x
    else if (a <= 5.4d-42) then
        tmp = t_1
    else
        tmp = x + (y * (z / a))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (y / (t / z));
	double tmp;
	if (a <= -5.4e-142) {
		tmp = x + (z * (y / a));
	} else if (a <= 9.1e-209) {
		tmp = t_1;
	} else if (a <= 2.35e-94) {
		tmp = y + x;
	} else if (a <= 5.4e-42) {
		tmp = t_1;
	} else {
		tmp = x + (y * (z / a));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - (y / (t / z))
	tmp = 0
	if a <= -5.4e-142:
		tmp = x + (z * (y / a))
	elif a <= 9.1e-209:
		tmp = t_1
	elif a <= 2.35e-94:
		tmp = y + x
	elif a <= 5.4e-42:
		tmp = t_1
	else:
		tmp = x + (y * (z / a))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(y / Float64(t / z)))
	tmp = 0.0
	if (a <= -5.4e-142)
		tmp = Float64(x + Float64(z * Float64(y / a)));
	elseif (a <= 9.1e-209)
		tmp = t_1;
	elseif (a <= 2.35e-94)
		tmp = Float64(y + x);
	elseif (a <= 5.4e-42)
		tmp = t_1;
	else
		tmp = Float64(x + Float64(y * Float64(z / a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x - (y / (t / z));
	tmp = 0.0;
	if (a <= -5.4e-142)
		tmp = x + (z * (y / a));
	elseif (a <= 9.1e-209)
		tmp = t_1;
	elseif (a <= 2.35e-94)
		tmp = y + x;
	elseif (a <= 5.4e-42)
		tmp = t_1;
	else
		tmp = x + (y * (z / a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5.4e-142], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9.1e-209], t$95$1, If[LessEqual[a, 2.35e-94], N[(y + x), $MachinePrecision], If[LessEqual[a, 5.4e-42], t$95$1, N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq 9.1 \cdot 10^{-209}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 2.35 \cdot 10^{-94}:\\
\;\;\;\;y + x\\

\mathbf{elif}\;a \leq 5.4 \cdot 10^{-42}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -5.3999999999999996e-142

    1. Initial program 81.9%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} + x \]
      2. *-commutative77.8%

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

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

    if -5.3999999999999996e-142 < a < 9.09999999999999972e-209 or 2.35000000000000002e-94 < a < 5.39999999999999998e-42

    1. Initial program 89.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{z}}} \]
    9. Simplified73.8%

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

    if 9.09999999999999972e-209 < a < 2.35000000000000002e-94

    1. Initial program 81.0%

      \[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}{a - t} \cdot \left(z - t\right)} \]
    3. Simplified99.9%

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

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

    if 5.39999999999999998e-42 < a

    1. Initial program 83.7%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.4 \cdot 10^{-142}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 9.1 \cdot 10^{-209}:\\ \;\;\;\;x - \frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;a \leq 2.35 \cdot 10^{-94}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;a \leq 5.4 \cdot 10^{-42}:\\ \;\;\;\;x - \frac{y}{\frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \end{array} \]

Alternative 6: 71.2% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;a \leq 3.65 \cdot 10^{-208}:\\
\;\;\;\;x - \frac{z}{\frac{t}{y}}\\

\mathbf{elif}\;a \leq 1.2 \cdot 10^{-93}:\\
\;\;\;\;y + x\\

\mathbf{elif}\;a \leq 1.55 \cdot 10^{-41}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -5.3999999999999996e-142

    1. Initial program 81.9%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} + x \]
      2. *-commutative77.8%

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

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

    if -5.3999999999999996e-142 < a < 3.65000000000000001e-208

    1. Initial program 90.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.65000000000000001e-208 < a < 1.2000000000000001e-93

    1. Initial program 81.0%

      \[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}{a - t} \cdot \left(z - t\right)} \]
    3. Simplified99.9%

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

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

    if 1.2000000000000001e-93 < a < 1.55e-41

    1. Initial program 76.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.55e-41 < a

    1. Initial program 83.7%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.4 \cdot 10^{-142}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 3.65 \cdot 10^{-208}:\\ \;\;\;\;x - \frac{z}{\frac{t}{y}}\\ \mathbf{elif}\;a \leq 1.2 \cdot 10^{-93}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;a \leq 1.55 \cdot 10^{-41}:\\ \;\;\;\;x - \frac{y}{\frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \end{array} \]

Alternative 7: 71.1% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{+16}:\\
\;\;\;\;y + x\\

\mathbf{elif}\;x \leq 5.2 \cdot 10^{-82}:\\
\;\;\;\;y \cdot \frac{z - t}{a - t}\\

\mathbf{elif}\;x \leq 3.1 \cdot 10^{+32}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x < -1.45e16

    1. Initial program 72.8%

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

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

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

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

    if -1.45e16 < x < 5.2e-82

    1. Initial program 88.5%

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

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

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

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

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

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

    if 5.2e-82 < x < 3.09999999999999993e32

    1. Initial program 91.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \frac{y}{a}} + x \]
    8. Simplified78.5%

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

    if 3.09999999999999993e32 < x < 1.5499999999999999e192

    1. Initial program 89.2%

      \[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}{a - t} \cdot \left(z - t\right)} \]
    3. Simplified99.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z}{\frac{t}{y}}} \]
    9. Simplified78.0%

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

    if 1.5499999999999999e192 < x

    1. Initial program 80.1%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.45 \cdot 10^{+16}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;x \leq 5.2 \cdot 10^{-82}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;x \leq 3.1 \cdot 10^{+32}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{elif}\;x \leq 1.55 \cdot 10^{+192}:\\ \;\;\;\;x - \frac{z}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \end{array} \]

Alternative 8: 83.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+84} \lor \neg \left(y \leq 9.2 \cdot 10^{+145}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.9999999999999994e84 or 9.2e145 < y

    1. Initial program 66.6%

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

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

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

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

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

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

    if -8.9999999999999994e84 < y < 9.2e145

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

Alternative 9: 82.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+85} \lor \neg \left(y \leq 5.2 \cdot 10^{+147}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.4000000000000003e85 or 5.1999999999999997e147 < y

    1. Initial program 66.6%

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

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

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

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

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

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

    if -3.4000000000000003e85 < y < 5.1999999999999997e147

    1. Initial program 92.3%

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

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

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

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

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

Alternative 10: 82.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+85} \lor \neg \left(y \leq 6.2 \cdot 10^{+149}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.4000000000000003e85 or 6.19999999999999974e149 < y

    1. Initial program 66.6%

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

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

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

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

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

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

    if -3.4000000000000003e85 < y < 6.19999999999999974e149

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

Alternative 11: 76.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+119} \lor \neg \left(t \leq 8.5 \cdot 10^{+78}\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.5e119 or 8.50000000000000079e78 < t

    1. Initial program 64.4%

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

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

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

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

    if -2.5e119 < t < 8.50000000000000079e78

    1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

Alternative 12: 96.0% 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 84.3%

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

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

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

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

Alternative 13: 98.3% 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 84.3%

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

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

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

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

Alternative 14: 62.0% accurate, 2.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.1e142

    1. Initial program 67.9%

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

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

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

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

    if -2.1e142 < a

    1. Initial program 86.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.1 \cdot 10^{+142}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]

Alternative 15: 51.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 84.3%

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification46.7%

    \[\leadsto x \]

Developer target: 98.3% 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 2023195 
(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))))