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

Percentage Accurate: 85.5% → 98.1%
Time: 9.9s
Alternatives: 13
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 13 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.5% 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{z - t}{a - t} \cdot y \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (* (/ (- z t) (- a t)) y)))
double code(double x, double y, double z, double t, double a) {
	return x + (((z - t) / (a - t)) * 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 + (((z - t) / (a - t)) * y)
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (((z - t) / (a - t)) * y);
}
def code(x, y, z, t, a):
	return x + (((z - t) / (a - t)) * y)
function code(x, y, z, t, a)
	return Float64(x + Float64(Float64(Float64(z - t) / Float64(a - t)) * y))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (((z - t) / (a - t)) * y);
end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[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. Add Preprocessing
  5. Step-by-step derivation
    1. clear-num99.8%

      \[\leadsto x + \color{blue}{\frac{1}{\frac{\frac{a - t}{z - t}}{y}}} \]
    2. associate-/r/99.8%

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

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

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

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

Alternative 2: 62.0% accurate, 0.5× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.7e108 or 6.20000000000000038e98 < a

    1. Initial program 83.8%

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

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

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

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

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

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

    if -2.7e108 < a < -2.7499999999999999e-220 or -4.2000000000000002e-299 < a < 6.20000000000000038e98

    1. Initial program 84.5%

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

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

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

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

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

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

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

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

    if -2.7499999999999999e-220 < a < -4.2000000000000002e-299

    1. Initial program 88.9%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.7 \cdot 10^{+108}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -2.75 \cdot 10^{-220}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;a \leq -4.2 \cdot 10^{-299}:\\ \;\;\;\;y \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{elif}\;a \leq 6.2 \cdot 10^{+98}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 76.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+136}:\\
\;\;\;\;x + y\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.05e136 or 7.2000000000000002e42 < t

    1. Initial program 71.3%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified82.1%

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

    if -1.05e136 < t < -6.5000000000000001e73

    1. Initial program 99.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. Add Preprocessing
    5. Taylor expanded in z around inf 93.5%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{z}}} \]
      4. associate-/r/86.9%

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

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

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

        \[\leadsto x - \color{blue}{y \cdot \frac{z}{t}} \]
    11. Simplified86.8%

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

    if -6.5000000000000001e73 < t < 7.2000000000000002e42

    1. Initial program 91.6%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.05 \cdot 10^{+136}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -6.5 \cdot 10^{+73}:\\ \;\;\;\;x - y \cdot \frac{z}{t}\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{+42}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 76.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+135}:\\
\;\;\;\;x + y\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -7.0000000000000005e135 or 4.7999999999999997e42 < t

    1. Initial program 71.3%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified82.1%

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

    if -7.0000000000000005e135 < t < -3.09999999999999988e72

    1. Initial program 99.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. Add Preprocessing
    5. Taylor expanded in z around inf 93.5%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{z}}} \]
      4. associate-/r/86.9%

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

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

    if -3.09999999999999988e72 < t < 4.7999999999999997e42

    1. Initial program 91.6%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7 \cdot 10^{+135}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -3.1 \cdot 10^{+72}:\\ \;\;\;\;x - z \cdot \frac{y}{t}\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{+42}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 76.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+136}:\\
\;\;\;\;x + y\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.05e136 or 3.39999999999999975e42 < t

    1. Initial program 71.3%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified82.1%

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

    if -1.05e136 < t < -2.3e73

    1. Initial program 99.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. Add Preprocessing
    5. Taylor expanded in z around inf 93.5%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{z}}} \]
      4. associate-/r/86.9%

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

      \[\leadsto \color{blue}{x - \frac{y}{t} \cdot z} \]
    9. Step-by-step derivation
      1. *-commutative86.9%

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

        \[\leadsto x - z \cdot \color{blue}{\frac{1}{\frac{t}{y}}} \]
      3. un-div-inv87.1%

        \[\leadsto x - \color{blue}{\frac{z}{\frac{t}{y}}} \]
    10. Applied egg-rr87.1%

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

    if -2.3e73 < t < 3.39999999999999975e42

    1. Initial program 91.6%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.05 \cdot 10^{+136}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -2.3 \cdot 10^{+73}:\\ \;\;\;\;x - \frac{z}{\frac{t}{y}}\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{+42}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 84.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.15 \cdot 10^{+136} \lor \neg \left(t \leq 1.02 \cdot 10^{+58}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.1499999999999999e136 or 1.02000000000000005e58 < t

    1. Initial program 70.7%

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

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

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

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

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

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

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

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

    if -2.1499999999999999e136 < t < 1.02000000000000005e58

    1. Initial program 92.5%

      \[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. Add Preprocessing
    5. Taylor expanded in z around inf 81.4%

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

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

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

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

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

Alternative 7: 84.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{+137} \lor \neg \left(t \leq 5.6 \cdot 10^{+63}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.5000000000000002e137 or 5.59999999999999974e63 < t

    1. Initial program 70.7%

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

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

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

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

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

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

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

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

    if -6.5000000000000002e137 < t < 5.59999999999999974e63

    1. Initial program 92.5%

      \[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. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto x + \color{blue}{\frac{1}{\frac{\frac{a - t}{z - t}}{y}}} \]
      2. associate-/r/99.8%

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

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

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

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

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

Alternative 8: 87.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{-49} \lor \neg \left(z \leq 1.05 \cdot 10^{+56}\right):\\ \;\;\;\;x + y \cdot \frac{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 -1.2e-49) (not (<= z 1.05e+56)))
   (+ 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 <= -1.2e-49) || !(z <= 1.05e+56)) {
		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 <= (-1.2d-49)) .or. (.not. (z <= 1.05d+56))) 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 <= -1.2e-49) || !(z <= 1.05e+56)) {
		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 <= -1.2e-49) or not (z <= 1.05e+56):
		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 <= -1.2e-49) || !(z <= 1.05e+56))
		tmp = Float64(x + Float64(y * Float64(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 <= -1.2e-49) || ~((z <= 1.05e+56)))
		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, -1.2e-49], N[Not[LessEqual[z, 1.05e+56]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $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 -1.2 \cdot 10^{-49} \lor \neg \left(z \leq 1.05 \cdot 10^{+56}\right):\\
\;\;\;\;x + y \cdot \frac{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 < -1.19999999999999996e-49 or 1.05000000000000009e56 < z

    1. Initial program 80.6%

      \[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. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto x + \color{blue}{\frac{1}{\frac{\frac{a - t}{z - t}}{y}}} \]
      2. associate-/r/99.8%

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

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

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

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

    if -1.19999999999999996e-49 < z < 1.05000000000000009e56

    1. Initial program 88.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 75.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{-7} \lor \neg \left(t \leq 1.5 \cdot 10^{+42}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7.5000000000000002e-7 or 1.50000000000000014e42 < t

    1. Initial program 76.7%

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

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

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

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

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

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

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

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

    if -7.5000000000000002e-7 < t < 1.50000000000000014e42

    1. Initial program 92.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}{\frac{a - t}{z - t}}} \]
    3. Simplified99.9%

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

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

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

Alternative 10: 76.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.2 \cdot 10^{+86} \lor \neg \left(t \leq 8 \cdot 10^{+42}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7.20000000000000011e86 or 8.00000000000000036e42 < t

    1. Initial program 74.0%

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

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

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

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

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

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

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

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

    if -7.20000000000000011e86 < t < 8.00000000000000036e42

    1. Initial program 91.9%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}} + x} \]
    8. Step-by-step derivation
      1. clear-num77.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{a}{z}}{y}}} + x \]
      2. associate-/r/77.1%

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

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

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

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

Alternative 11: 76.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{+86} \lor \neg \left(t \leq 2.4 \cdot 10^{+42}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.10000000000000002e86 or 2.3999999999999999e42 < t

    1. Initial program 74.0%

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

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

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

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

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

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

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

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

    if -1.10000000000000002e86 < t < 2.3999999999999999e42

    1. Initial program 91.9%

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

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

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

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

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

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

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

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

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

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

Alternative 12: 62.6% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;a \leq 7.2 \cdot 10^{+99}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.08e109 or 7.2000000000000003e99 < a

    1. Initial program 83.8%

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

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

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

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

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

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

    if -1.08e109 < a < 7.2000000000000003e99

    1. Initial program 84.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified66.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.08 \cdot 10^{+109}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 7.2 \cdot 10^{+99}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 49.8% 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.6%

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification53.1%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 98.2% 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 2024021 
(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))))