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

Percentage Accurate: 84.9% → 99.7%
Time: 13.6s
Alternatives: 12
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 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: 84.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(z - t\right) \cdot y}{a - t}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;x + \frac{z - t}{\frac{a - t}{y}}\\ \mathbf{elif}\;t_1 \leq 4 \cdot 10^{+307}:\\ \;\;\;\;x + t_1\\ \mathbf{else}:\\ \;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a - t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* (- z t) y) (- a t))))
   (if (<= t_1 (- INFINITY))
     (+ x (/ (- z t) (/ (- a t) y)))
     (if (<= t_1 4e+307) (+ x t_1) (+ x (* (- z t) (/ y (- a t))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = ((z - t) * y) / (a - t);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = x + ((z - t) / ((a - t) / y));
	} else if (t_1 <= 4e+307) {
		tmp = x + t_1;
	} else {
		tmp = x + ((z - t) * (y / (a - t)));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = ((z - t) * y) / (a - t);
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = x + ((z - t) / ((a - t) / y));
	} else if (t_1 <= 4e+307) {
		tmp = x + t_1;
	} else {
		tmp = x + ((z - t) * (y / (a - t)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = ((z - t) * y) / (a - t)
	tmp = 0
	if t_1 <= -math.inf:
		tmp = x + ((z - t) / ((a - t) / y))
	elif t_1 <= 4e+307:
		tmp = x + t_1
	else:
		tmp = x + ((z - t) * (y / (a - t)))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(Float64(z - t) * y) / Float64(a - t))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(x + Float64(Float64(z - t) / Float64(Float64(a - t) / y)));
	elseif (t_1 <= 4e+307)
		tmp = Float64(x + t_1);
	else
		tmp = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(a - t))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = ((z - t) * y) / (a - t);
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = x + ((z - t) / ((a - t) / y));
	elseif (t_1 <= 4e+307)
		tmp = x + t_1;
	else
		tmp = x + ((z - t) * (y / (a - t)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(N[(z - t), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+307], N[(x + t$95$1), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t_1 \leq 4 \cdot 10^{+307}:\\
\;\;\;\;x + t_1\\

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


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

    1. Initial program 46.0%

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

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

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

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 3.99999999999999994e307

    1. Initial program 99.2%

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

    if 3.99999999999999994e307 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t))

    1. Initial program 41.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(z - t\right) \cdot y}{a - t} \leq -\infty:\\ \;\;\;\;x + \frac{z - t}{\frac{a - t}{y}}\\ \mathbf{elif}\;\frac{\left(z - t\right) \cdot y}{a - t} \leq 4 \cdot 10^{+307}:\\ \;\;\;\;x + \frac{\left(z - t\right) \cdot y}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a - t}\\ \end{array} \]

Alternative 2: 98.2% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(\frac{z - t}{a - t}, y, x\right) \end{array} \]
(FPCore (x y z t a) :precision binary64 (fma (/ (- z t) (- a t)) y x))
double code(double x, double y, double z, double t, double a) {
	return fma(((z - t) / (a - t)), y, x);
}
function code(x, y, z, t, a)
	return fma(Float64(Float64(z - t) / Float64(a - t)), y, x)
end
code[x_, y_, z_, t_, a_] := N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(\frac{z - t}{a - t}, y, x\right)
\end{array}
Derivation
  1. Initial program 84.8%

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

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

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

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

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

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

    \[\leadsto \mathsf{fma}\left(\frac{z - t}{a - t}, y, x\right) \]

Alternative 3: 99.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(z - t\right) \cdot y}{a - t}\\ \mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 4 \cdot 10^{+307}\right):\\ \;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* (- z t) y) (- a t))))
   (if (or (<= t_1 (- INFINITY)) (not (<= t_1 4e+307)))
     (+ x (* (- z t) (/ y (- a t))))
     (+ x t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = ((z - t) * y) / (a - t);
	double tmp;
	if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 4e+307)) {
		tmp = x + ((z - t) * (y / (a - t)));
	} else {
		tmp = x + t_1;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = ((z - t) * y) / (a - t);
	double tmp;
	if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 4e+307)) {
		tmp = x + ((z - t) * (y / (a - t)));
	} else {
		tmp = x + t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = ((z - t) * y) / (a - t)
	tmp = 0
	if (t_1 <= -math.inf) or not (t_1 <= 4e+307):
		tmp = x + ((z - t) * (y / (a - t)))
	else:
		tmp = x + t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(Float64(z - t) * y) / Float64(a - t))
	tmp = 0.0
	if ((t_1 <= Float64(-Inf)) || !(t_1 <= 4e+307))
		tmp = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(a - t))));
	else
		tmp = Float64(x + t_1);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = ((z - t) * y) / (a - t);
	tmp = 0.0;
	if ((t_1 <= -Inf) || ~((t_1 <= 4e+307)))
		tmp = x + ((z - t) * (y / (a - t)));
	else
		tmp = x + t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 4e+307]], $MachinePrecision]], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < -inf.0 or 3.99999999999999994e307 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t))

    1. Initial program 43.2%

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

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

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 3.99999999999999994e307

    1. Initial program 99.2%

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

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

Alternative 4: 82.2% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.24999999999999986e-57 or 8.7999999999999996e-10 < t

    1. Initial program 75.8%

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

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

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

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

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

        \[\leadsto x + \frac{z - t}{\color{blue}{-\frac{t}{y}}} \]
      2. distribute-neg-frac84.4%

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

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

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

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

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

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

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

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

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

    if -2.24999999999999986e-57 < t < 8.7999999999999996e-10

    1. Initial program 96.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 87.1% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.2999999999999999e-46 or 15500 < t

    1. Initial program 75.1%

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

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

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

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

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

        \[\leadsto x + \frac{z - t}{\color{blue}{-\frac{t}{y}}} \]
      2. distribute-neg-frac84.6%

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

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

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

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

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

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

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

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

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

    if -2.2999999999999999e-46 < t < 15500

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 85.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.45 \cdot 10^{-49}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{z}{t}\right)\\

\mathbf{elif}\;t \leq 5200000000:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.4500000000000001e-49

    1. Initial program 79.5%

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

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

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

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

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

        \[\leadsto x + \frac{z - t}{\color{blue}{-\frac{t}{y}}} \]
      2. distribute-neg-frac86.6%

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

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

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

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

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

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

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

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

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

    if -2.4500000000000001e-49 < t < 5.2e9

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

    if 5.2e9 < t

    1. Initial program 70.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.45 \cdot 10^{-49}:\\ \;\;\;\;x + y \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{elif}\;t \leq 5200000000:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{t}{\frac{a - t}{y}}\\ \end{array} \]

Alternative 7: 85.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{-49}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z - t}}\\

\mathbf{elif}\;t \leq 3000000000:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.59999999999999995e-49

    1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

    if -2.59999999999999995e-49 < t < 3e9

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

    if 3e9 < t

    1. Initial program 70.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.6 \cdot 10^{-49}:\\ \;\;\;\;x - \frac{y}{\frac{t}{z - t}}\\ \mathbf{elif}\;t \leq 3000000000:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{t}{\frac{a - t}{y}}\\ \end{array} \]

Alternative 8: 76.2% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.7e-47 or 2.99999999999999973e-8 < t

    1. Initial program 75.8%

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

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

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

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

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

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

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

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

    if -3.7e-47 < t < 2.99999999999999973e-8

    1. Initial program 96.2%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.7 \cdot 10^{-47}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;t \leq 3 \cdot 10^{-8}:\\ \;\;\;\;x + \frac{z}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]

Alternative 9: 76.2% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.80000000000000015e-47 or 3.3999999999999999e-11 < t

    1. Initial program 75.8%

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

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

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

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

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

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

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

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

    if -3.80000000000000015e-47 < t < 3.3999999999999999e-11

    1. Initial program 96.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.8 \cdot 10^{-47}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{-11}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]

Alternative 10: 95.7% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 11: 60.1% accurate, 3.7× speedup?

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

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

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

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

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

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

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

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

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

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

    \[\leadsto y + x \]

Alternative 12: 50.3% accurate, 11.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 84.8%

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

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

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

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

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

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

    \[\leadsto x \]

Developer target: 98.4% accurate, 1.0× speedup?

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

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

Reproduce

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

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

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