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

Percentage Accurate: 85.8% → 99.2%
Time: 10.1s
Alternatives: 13
Speedup: 0.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 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.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.2% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+256}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+263}:\\ \;\;\;\;x - \frac{y \cdot \left(t - z\right)}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z - t}{\frac{z - a}{y}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* y (- z t)) (- z a))))
   (if (<= t_1 -5e+256)
     (fma (/ y (- z a)) (- z t) x)
     (if (<= t_1 2e+263)
       (- x (/ (* y (- t z)) (- z a)))
       (+ x (/ (- z t) (/ (- z a) y)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y * (z - t)) / (z - a);
	double tmp;
	if (t_1 <= -5e+256) {
		tmp = fma((y / (z - a)), (z - t), x);
	} else if (t_1 <= 2e+263) {
		tmp = x - ((y * (t - z)) / (z - a));
	} else {
		tmp = x + ((z - t) / ((z - a) / y));
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a))
	tmp = 0.0
	if (t_1 <= -5e+256)
		tmp = fma(Float64(y / Float64(z - a)), Float64(z - t), x);
	elseif (t_1 <= 2e+263)
		tmp = Float64(x - Float64(Float64(y * Float64(t - z)) / Float64(z - a)));
	else
		tmp = Float64(x + Float64(Float64(z - t) / Float64(Float64(z - a) / y)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+256], N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 2e+263], N[(x - N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+256}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+263}:\\
\;\;\;\;x - \frac{y \cdot \left(t - z\right)}{z - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -5.00000000000000015e256

    1. Initial program 46.7%

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

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

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

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

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

    if -5.00000000000000015e256 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.00000000000000003e263

    1. Initial program 99.6%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Add Preprocessing

    if 2.00000000000000003e263 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 42.4%

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

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

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

      \[\leadsto \color{blue}{x + \frac{z - t}{\frac{z - a}{y}}} \]
    4. Add Preprocessing
  3. Recombined 3 regimes into one program.
  4. Final simplification99.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z - t\right)}{z - a} \leq -5 \cdot 10^{+256}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)\\ \mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{z - a} \leq 2 \cdot 10^{+263}:\\ \;\;\;\;x - \frac{y \cdot \left(t - z\right)}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z - t}{\frac{z - a}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 99.5% accurate, 0.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -1.9999999999999999e305 or 2.00000000000000003e263 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 43.1%

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

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

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

      \[\leadsto \color{blue}{x + \frac{z - t}{\frac{z - a}{y}}} \]
    4. Add Preprocessing

    if -1.9999999999999999e305 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.00000000000000003e263

    1. Initial program 99.6%

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

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

Alternative 3: 92.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+79} \lor \neg \left(z \leq 1.85 \cdot 10^{+113}\right):\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.99999999999999961e79 or 1.8499999999999999e113 < z

    1. Initial program 62.0%

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

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

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

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

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

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

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

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

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

    if -6.99999999999999961e79 < z < 1.8499999999999999e113

    1. Initial program 96.8%

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

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

Alternative 4: 79.7% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.2e7 or 2.35000000000000004e111 < z

    1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.2e7 < z < 2.35000000000000004e111

    1. Initial program 97.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} + x \]
      3. associate-/r/81.0%

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} + x \]
    7. Simplified81.0%

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

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

Alternative 5: 81.1% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.445000000000000007 or 2.9000000000000001e28 < z

    1. Initial program 70.8%

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

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

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

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

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

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

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

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

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

    if -0.445000000000000007 < z < 2.9000000000000001e28

    1. Initial program 97.4%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} + x \]
      3. associate-/r/81.3%

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

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

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

Alternative 6: 87.1% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.9e39 or 1.02000000000000002e113 < z

    1. Initial program 65.2%

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

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

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

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

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

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

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

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

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

    if -9.9e39 < z < 1.02000000000000002e113

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

Alternative 7: 79.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -38000000:\\
\;\;\;\;x + \left(y - t \cdot \frac{y}{z}\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.8e7

    1. Initial program 68.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.8e7 < z < 2.35000000000000004e111

    1. Initial program 97.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} + x \]
      3. associate-/r/81.0%

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} + x \]
    7. Simplified81.0%

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

    if 2.35000000000000004e111 < z

    1. Initial program 63.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -38000000:\\ \;\;\;\;x + \left(y - t \cdot \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq 2.35 \cdot 10^{+111}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 83.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -140000000:\\
\;\;\;\;x + \left(y - t \cdot \frac{y}{z}\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.4e8

    1. Initial program 68.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.4e8 < z < 4.2e18

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

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

    if 4.2e18 < z

    1. Initial program 72.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -140000000:\\ \;\;\;\;x + \left(y - t \cdot \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{+18}:\\ \;\;\;\;x + \frac{y}{a} \cdot \left(t - z\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 76.0% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.2e7 or 2.35000000000000004e111 < z

    1. Initial program 66.4%

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

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

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

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

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

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

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

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

    if -3.2e7 < z < 2.35000000000000004e111

    1. Initial program 97.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} + x \]
      3. associate-/r/81.0%

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} + x \]
    7. Simplified81.0%

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    10. Simplified79.2%

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

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

Alternative 10: 75.8% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8e7 or 2.35000000000000004e111 < z

    1. Initial program 66.4%

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

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

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

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

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

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

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

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

    if -8e7 < z < 2.35000000000000004e111

    1. Initial program 97.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} + x \]
      3. associate-/r/81.0%

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} + x \]
    7. Simplified81.0%

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

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

Alternative 11: 77.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -35000000:\\
\;\;\;\;x + \frac{z - t}{\frac{z}{y}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.5e7

    1. Initial program 68.9%

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

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

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

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

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

    if -3.5e7 < z < 2.35000000000000004e111

    1. Initial program 97.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} + x \]
      3. associate-/r/81.0%

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} + x \]
    7. Simplified81.0%

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

    if 2.35000000000000004e111 < z

    1. Initial program 63.6%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -35000000:\\ \;\;\;\;x + \frac{z - t}{\frac{z}{y}}\\ \mathbf{elif}\;z \leq 2.35 \cdot 10^{+111}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 61.6% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 84.4%

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

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

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

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

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

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

    if -8.79999999999999998e91 < a

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

Alternative 13: 50.7% 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 85.2%

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification51.9%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 98.3% accurate, 1.0× speedup?

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

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

Reproduce

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

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

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