Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3

Percentage Accurate: 97.2% → 99.7%
Time: 11.2s
Alternatives: 11
Speedup: 1.0×

Specification

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

\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{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 11 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: 97.2% accurate, 1.0× speedup?

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

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

Alternative 1: 99.7% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 2: 87.0% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.99999999999999998e63 or 2.6e6 < z

    1. Initial program 95.2%

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

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

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

        \[\leadsto x - \frac{y - z}{\frac{\color{blue}{-z}}{a}} \]
    5. Simplified84.7%

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

    if -5.99999999999999998e63 < z < 2.6e6

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

Alternative 3: 84.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{+48} \lor \neg \left(z \leq 3.3 \cdot 10^{+18}\right):\\
\;\;\;\;x - a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.29999999999999978e48 or 3.3e18 < z

    1. Initial program 95.3%

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

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

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

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

    if -4.29999999999999978e48 < z < 3.3e18

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

Alternative 4: 74.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -300000000000 \lor \neg \left(t \leq 6.5\right):\\
\;\;\;\;x + a \cdot \frac{z - y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3e11 or 6.5 < t

    1. Initial program 96.9%

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

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

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

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

    if -3e11 < t < 6.5

    1. Initial program 98.4%

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

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

      \[\leadsto \color{blue}{x - \frac{y - z}{\left(t - z\right) + 1} \cdot a} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative99.9%

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

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

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

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

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

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

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

Alternative 5: 71.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -500000000000 \lor \neg \left(t \leq 1\right):\\
\;\;\;\;x - \frac{y}{\frac{t}{a}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5e11 or 1 < t

    1. Initial program 96.9%

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

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

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

    if -5e11 < t < 1

    1. Initial program 98.4%

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

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

      \[\leadsto \color{blue}{x - \frac{y - z}{\left(t - z\right) + 1} \cdot a} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative99.9%

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

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

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

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

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

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

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

Alternative 6: 73.2% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+37} \lor \neg \left(z \leq 1.4 \cdot 10^{+18}\right):\\
\;\;\;\;x - a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.99999999999999954e36 or 1.4e18 < z

    1. Initial program 95.4%

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

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

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

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

    if -9.99999999999999954e36 < z < 1.4e18

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 66.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+45} \lor \neg \left(z \leq 7.2 \cdot 10^{+18}\right):\\
\;\;\;\;x - a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.9999999999999997e45 or 7.2e18 < z

    1. Initial program 95.3%

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

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

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

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

    if -8.9999999999999997e45 < z < 7.2e18

    1. Initial program 99.2%

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

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

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

        \[\leadsto \left(-\color{blue}{\frac{y - z}{\left(t - z\right) + 1} \cdot a}\right) + x \]
      4. distribute-rgt-neg-in98.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{+45} \lor \neg \left(z \leq 7.2 \cdot 10^{+18}\right):\\ \;\;\;\;x - a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 97.5% accurate, 1.0× speedup?

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

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

    \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. clear-num97.5%

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

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

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

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

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

Alternative 9: 55.9% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{-146}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 5.5 \cdot 10^{-189}:\\
\;\;\;\;-a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.4999999999999999e-146 or 5.4999999999999999e-189 < x

    1. Initial program 99.0%

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

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

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

        \[\leadsto \left(-\color{blue}{\frac{y - z}{\left(t - z\right) + 1} \cdot a}\right) + x \]
      4. distribute-rgt-neg-in99.5%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{-a}{\left(t - z\right) + 1}, x\right)} \]
      8. distribute-frac-neg99.0%

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{-\frac{a}{\left(t - z\right) + 1}}, x\right) \]
      9. distribute-neg-frac299.0%

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{a}{-\left(\left(t - z\right) + 1\right)}}, x\right) \]
      10. distribute-neg-in99.0%

        \[\leadsto \mathsf{fma}\left(y - z, \frac{a}{\color{blue}{\left(-\left(t - z\right)\right) + \left(-1\right)}}, x\right) \]
      11. sub-neg99.0%

        \[\leadsto \mathsf{fma}\left(y - z, \frac{a}{\left(-\color{blue}{\left(t + \left(-z\right)\right)}\right) + \left(-1\right)}, x\right) \]
      12. distribute-neg-in99.0%

        \[\leadsto \mathsf{fma}\left(y - z, \frac{a}{\color{blue}{\left(\left(-t\right) + \left(-\left(-z\right)\right)\right)} + \left(-1\right)}, x\right) \]
      13. remove-double-neg99.0%

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

        \[\leadsto \mathsf{fma}\left(y - z, \frac{a}{\color{blue}{\left(z + \left(-t\right)\right)} + \left(-1\right)}, x\right) \]
      15. sub-neg99.0%

        \[\leadsto \mathsf{fma}\left(y - z, \frac{a}{\color{blue}{\left(z - t\right)} + \left(-1\right)}, x\right) \]
      16. metadata-eval99.0%

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

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

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

    if -6.4999999999999999e-146 < x < 5.4999999999999999e-189

    1. Initial program 92.3%

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

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

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

        \[\leadsto \left(-\color{blue}{\frac{y - z}{\left(t - z\right) + 1} \cdot a}\right) + x \]
      4. distribute-rgt-neg-in96.1%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{-a}{\left(t - z\right) + 1}, x\right)} \]
      8. distribute-frac-neg92.6%

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{-\frac{a}{\left(t - z\right) + 1}}, x\right) \]
      9. distribute-neg-frac292.6%

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{a}{-\left(\left(t - z\right) + 1\right)}}, x\right) \]
      10. distribute-neg-in92.6%

        \[\leadsto \mathsf{fma}\left(y - z, \frac{a}{\color{blue}{\left(-\left(t - z\right)\right) + \left(-1\right)}}, x\right) \]
      11. sub-neg92.6%

        \[\leadsto \mathsf{fma}\left(y - z, \frac{a}{\left(-\color{blue}{\left(t + \left(-z\right)\right)}\right) + \left(-1\right)}, x\right) \]
      12. distribute-neg-in92.6%

        \[\leadsto \mathsf{fma}\left(y - z, \frac{a}{\color{blue}{\left(\left(-t\right) + \left(-\left(-z\right)\right)\right)} + \left(-1\right)}, x\right) \]
      13. remove-double-neg92.6%

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

        \[\leadsto \mathsf{fma}\left(y - z, \frac{a}{\color{blue}{\left(z + \left(-t\right)\right)} + \left(-1\right)}, x\right) \]
      15. sub-neg92.6%

        \[\leadsto \mathsf{fma}\left(y - z, \frac{a}{\color{blue}{\left(z - t\right)} + \left(-1\right)}, x\right) \]
      16. metadata-eval92.6%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot a} \]
    7. Step-by-step derivation
      1. neg-mul-127.5%

        \[\leadsto \color{blue}{-a} \]
    8. Simplified27.5%

      \[\leadsto \color{blue}{-a} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 10: 54.4% accurate, 13.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 97.6%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{-a}{\left(t - z\right) + 1}, x\right)} \]
    8. distribute-frac-neg97.7%

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{-\frac{a}{\left(t - z\right) + 1}}, x\right) \]
    9. distribute-neg-frac297.7%

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{a}{-\left(\left(t - z\right) + 1\right)}}, x\right) \]
    10. distribute-neg-in97.7%

      \[\leadsto \mathsf{fma}\left(y - z, \frac{a}{\color{blue}{\left(-\left(t - z\right)\right) + \left(-1\right)}}, x\right) \]
    11. sub-neg97.7%

      \[\leadsto \mathsf{fma}\left(y - z, \frac{a}{\left(-\color{blue}{\left(t + \left(-z\right)\right)}\right) + \left(-1\right)}, x\right) \]
    12. distribute-neg-in97.7%

      \[\leadsto \mathsf{fma}\left(y - z, \frac{a}{\color{blue}{\left(\left(-t\right) + \left(-\left(-z\right)\right)\right)} + \left(-1\right)}, x\right) \]
    13. remove-double-neg97.7%

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

      \[\leadsto \mathsf{fma}\left(y - z, \frac{a}{\color{blue}{\left(z + \left(-t\right)\right)} + \left(-1\right)}, x\right) \]
    15. sub-neg97.7%

      \[\leadsto \mathsf{fma}\left(y - z, \frac{a}{\color{blue}{\left(z - t\right)} + \left(-1\right)}, x\right) \]
    16. metadata-eval97.7%

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

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

    \[\leadsto \color{blue}{x} \]
  6. Add Preprocessing

Alternative 11: 3.2% accurate, 13.0× speedup?

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

\\
a
\end{array}
Derivation
  1. Initial program 97.6%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{-a}{\left(t - z\right) + 1}, x\right)} \]
    8. distribute-frac-neg97.7%

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{-\frac{a}{\left(t - z\right) + 1}}, x\right) \]
    9. distribute-neg-frac297.7%

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{a}{-\left(\left(t - z\right) + 1\right)}}, x\right) \]
    10. distribute-neg-in97.7%

      \[\leadsto \mathsf{fma}\left(y - z, \frac{a}{\color{blue}{\left(-\left(t - z\right)\right) + \left(-1\right)}}, x\right) \]
    11. sub-neg97.7%

      \[\leadsto \mathsf{fma}\left(y - z, \frac{a}{\left(-\color{blue}{\left(t + \left(-z\right)\right)}\right) + \left(-1\right)}, x\right) \]
    12. distribute-neg-in97.7%

      \[\leadsto \mathsf{fma}\left(y - z, \frac{a}{\color{blue}{\left(\left(-t\right) + \left(-\left(-z\right)\right)\right)} + \left(-1\right)}, x\right) \]
    13. remove-double-neg97.7%

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

      \[\leadsto \mathsf{fma}\left(y - z, \frac{a}{\color{blue}{\left(z + \left(-t\right)\right)} + \left(-1\right)}, x\right) \]
    15. sub-neg97.7%

      \[\leadsto \mathsf{fma}\left(y - z, \frac{a}{\color{blue}{\left(z - t\right)} + \left(-1\right)}, x\right) \]
    16. metadata-eval97.7%

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

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

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

    \[\leadsto \color{blue}{-1 \cdot a} \]
  7. Step-by-step derivation
    1. neg-mul-114.0%

      \[\leadsto \color{blue}{-a} \]
  8. Simplified14.0%

    \[\leadsto \color{blue}{-a} \]
  9. Step-by-step derivation
    1. neg-sub014.0%

      \[\leadsto \color{blue}{0 - a} \]
    2. sub-neg14.0%

      \[\leadsto \color{blue}{0 + \left(-a\right)} \]
    3. add-sqr-sqrt7.1%

      \[\leadsto 0 + \color{blue}{\sqrt{-a} \cdot \sqrt{-a}} \]
    4. sqrt-unprod7.5%

      \[\leadsto 0 + \color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}} \]
    5. sqr-neg7.5%

      \[\leadsto 0 + \sqrt{\color{blue}{a \cdot a}} \]
    6. sqrt-unprod1.8%

      \[\leadsto 0 + \color{blue}{\sqrt{a} \cdot \sqrt{a}} \]
    7. add-sqr-sqrt3.4%

      \[\leadsto 0 + \color{blue}{a} \]
  10. Applied egg-rr3.4%

    \[\leadsto \color{blue}{0 + a} \]
  11. Step-by-step derivation
    1. +-lft-identity3.4%

      \[\leadsto \color{blue}{a} \]
  12. Simplified3.4%

    \[\leadsto \color{blue}{a} \]
  13. Add Preprocessing

Developer Target 1: 99.7% accurate, 1.0× speedup?

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

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

Reproduce

?
herbie shell --seed 2024170 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
  :precision binary64

  :alt
  (! :herbie-platform default (- x (* (/ (- y z) (+ (- t z) 1)) a)))

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