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

Percentage Accurate: 85.5% → 98.3%
Time: 10.8s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

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

Alternative 1: 98.3% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

Alternative 2: 82.5% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.59999999999999965e-68 or 6e-96 < z

    1. Initial program 77.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.59999999999999965e-68 < z < 6e-96

    1. Initial program 91.6%

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t}}} \]
    6. Simplified91.2%

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

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

Alternative 3: 79.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{-8}:\\
\;\;\;\;y + x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.19999999999999962e-8

    1. Initial program 79.0%

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

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

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

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

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

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

    if -7.19999999999999962e-8 < z < 49000

    1. Initial program 91.8%

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

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

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

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

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

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

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

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

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

    if 49000 < z

    1. Initial program 67.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 82.9% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.4000000000000001e-5

    1. Initial program 79.0%

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

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

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

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

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

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

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

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

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

    if -2.4000000000000001e-5 < z < 2.0999999999999999e-91

    1. Initial program 91.8%

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

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

      \[\leadsto \color{blue}{x + \frac{y}{\frac{z - a}{z - t}}} \]
    4. Step-by-step derivation
      1. frac-2neg99.9%

        \[\leadsto x + \color{blue}{\frac{-y}{-\frac{z - a}{z - t}}} \]
      2. div-inv99.9%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} + x \]
    8. Simplified89.5%

      \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}} + x} \]
    9. Step-by-step derivation
      1. div-inv89.4%

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

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

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

    if 2.0999999999999999e-91 < z

    1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 83.0% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 79.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{1} \cdot \frac{z - t}{z}} + x \]
      5. /-rgt-identity91.7%

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

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

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

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

    if -1.60000000000000013e-4 < z < 8.99999999999999915e-87

    1. Initial program 91.8%

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

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

      \[\leadsto \color{blue}{x + \frac{y}{\frac{z - a}{z - t}}} \]
    4. Step-by-step derivation
      1. frac-2neg99.9%

        \[\leadsto x + \color{blue}{\frac{-y}{-\frac{z - a}{z - t}}} \]
      2. div-inv99.9%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} + x \]
    8. Simplified89.5%

      \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}} + x} \]
    9. Step-by-step derivation
      1. div-inv89.4%

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

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

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

    if 8.99999999999999915e-87 < z

    1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 78.3% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.80000000000000012e-4 or 2.9e16 < z

    1. Initial program 73.2%

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

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

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

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

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

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

    if -4.80000000000000012e-4 < z < 2.9e16

    1. Initial program 91.8%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 95.7% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 8: 98.5% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 9: 64.1% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;a \leq 1.15 \cdot 10^{+206}:\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.42e165 or 1.15000000000000008e206 < a

    1. Initial program 80.2%

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

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

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

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

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

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

    if -1.42e165 < a < 1.15000000000000008e206

    1. Initial program 82.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.42 \cdot 10^{+165}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.15 \cdot 10^{+206}:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 10: 54.1% accurate, 2.1× speedup?

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

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

\mathbf{elif}\;x \leq 5.5 \cdot 10^{-102}:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1e-191 or 5.4999999999999997e-102 < x

    1. Initial program 84.2%

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

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

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

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

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

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

    if -1e-191 < x < 5.4999999999999997e-102

    1. Initial program 76.7%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{z \cdot y}}{z - a} \]
    7. Simplified39.0%

      \[\leadsto \frac{\color{blue}{z \cdot y}}{z - a} \]
    8. Taylor expanded in z around inf 50.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1 \cdot 10^{-191}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{-102}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 11: 51.5% 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 82.3%

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

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

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

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

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

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

    \[\leadsto x \]

Developer target: 98.5% accurate, 1.0× speedup?

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

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

Reproduce

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

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

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