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

Percentage Accurate: 98.0% → 98.0%
Time: 10.2s
Alternatives: 11
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ x + y \cdot \frac{z - t}{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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + y \cdot \frac{z - t}{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: 98.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + y \cdot \frac{z - t}{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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 98.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + y \cdot \frac{z - t}{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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[x + y \cdot \frac{z - t}{z - a} \]
  2. Final simplification99.2%

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

Alternative 2: 81.8% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.1999999999999997e82

    1. Initial program 100.0%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in a around 0 91.4%

      \[\leadsto x + y \cdot \color{blue}{\frac{z - t}{z}} \]
    3. Step-by-step derivation
      1. div-sub91.4%

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

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

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

    if -5.1999999999999997e82 < z < -2.15999999999999996e-72

    1. Initial program 99.8%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in t around 0 78.0%

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{z - a}{z}}} \]
    4. Simplified83.2%

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

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

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

    if -2.15999999999999996e-72 < z < 4e-107

    1. Initial program 97.8%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in z around 0 84.3%

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

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

        \[\leadsto x + \color{blue}{\frac{t}{a} \cdot y} \]
    4. Applied egg-rr84.3%

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

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

        \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{a}{t}}} \]
      3. un-div-inv84.4%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t}}} \]
    6. Applied egg-rr84.4%

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

    if 4e-107 < z

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in t around 0 89.1%

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

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

Alternative 3: 82.2% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.7500000000000001e-86 or 32500 < z

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in a around 0 86.8%

      \[\leadsto x + y \cdot \color{blue}{\frac{z - t}{z}} \]
    3. Step-by-step derivation
      1. div-sub86.8%

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

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

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

    if -1.7500000000000001e-86 < z < 32500

    1. Initial program 98.2%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in z around 0 84.5%

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

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

        \[\leadsto x + \color{blue}{\frac{t}{a} \cdot y} \]
    4. Applied egg-rr83.7%

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

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

        \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{a}{t}}} \]
      3. un-div-inv84.5%

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

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

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

Alternative 4: 85.4% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.1e52 or 6.00000000000000043e37 < t

    1. Initial program 98.2%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in t around inf 86.9%

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{-t}{z - a} \cdot y} \]
      2. add-sqr-sqrt43.7%

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

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

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

        \[\leadsto x + \frac{\color{blue}{\sqrt{t} \cdot \sqrt{t}}}{z - a} \cdot y \]
      6. add-sqr-sqrt37.2%

        \[\leadsto x + \frac{\color{blue}{t}}{z - a} \cdot y \]
      7. cancel-sign-sub37.2%

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

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

        \[\leadsto x - \color{blue}{y \cdot \frac{-t}{z - a}} \]
      10. add-sqr-sqrt17.4%

        \[\leadsto x - y \cdot \frac{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}}{z - a} \]
      11. sqrt-unprod37.9%

        \[\leadsto x - y \cdot \frac{\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}{z - a} \]
      12. sqr-neg37.9%

        \[\leadsto x - y \cdot \frac{\sqrt{\color{blue}{t \cdot t}}}{z - a} \]
      13. sqrt-unprod43.1%

        \[\leadsto x - y \cdot \frac{\color{blue}{\sqrt{t} \cdot \sqrt{t}}}{z - a} \]
      14. add-sqr-sqrt86.9%

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

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

    if -4.1e52 < t < 6.00000000000000043e37

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in t around 0 77.3%

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

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

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

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

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

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

Alternative 5: 81.8% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in a around 0 82.6%

      \[\leadsto x + y \cdot \color{blue}{\frac{z - t}{z}} \]
    3. Step-by-step derivation
      1. div-sub82.6%

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

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

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

    if -1.40000000000000008e-85 < z < 2.0999999999999999e-107

    1. Initial program 97.7%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in z around 0 86.1%

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

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

        \[\leadsto x + \color{blue}{\frac{t}{a} \cdot y} \]
    4. Applied egg-rr86.1%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t}}} \]
    6. Applied egg-rr86.1%

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

    if 2.0999999999999999e-107 < z

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in t around 0 89.1%

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

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

Alternative 6: 87.4% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 100.0%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in a around 0 87.7%

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

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

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

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

    if -3.29999999999999998e-27 < z < 66000

    1. Initial program 98.4%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in t around inf 91.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 66000 < z

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in a around 0 71.8%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 85.4% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4e51

    1. Initial program 96.5%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in t around inf 84.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4e51 < t < 3.1000000000000002e37

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in t around 0 77.3%

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

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

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

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

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

    if 3.1000000000000002e37 < t

    1. Initial program 100.0%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in t around inf 89.7%

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{-t}{z - a} \cdot y} \]
      2. add-sqr-sqrt0.0%

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

        \[\leadsto x + \frac{\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}{z - a} \cdot y \]
      4. sqr-neg23.8%

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

        \[\leadsto x + \frac{\color{blue}{\sqrt{t} \cdot \sqrt{t}}}{z - a} \cdot y \]
      6. add-sqr-sqrt41.1%

        \[\leadsto x + \frac{\color{blue}{t}}{z - a} \cdot y \]
      7. cancel-sign-sub41.1%

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

        \[\leadsto x - \color{blue}{\frac{-t}{z - a}} \cdot y \]
      9. *-commutative41.1%

        \[\leadsto x - \color{blue}{y \cdot \frac{-t}{z - a}} \]
      10. add-sqr-sqrt0.0%

        \[\leadsto x - y \cdot \frac{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}}{z - a} \]
      11. sqrt-unprod56.2%

        \[\leadsto x - y \cdot \frac{\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}{z - a} \]
      12. sqr-neg56.2%

        \[\leadsto x - y \cdot \frac{\sqrt{\color{blue}{t \cdot t}}}{z - a} \]
      13. sqrt-unprod89.5%

        \[\leadsto x - y \cdot \frac{\color{blue}{\sqrt{t} \cdot \sqrt{t}}}{z - a} \]
      14. add-sqr-sqrt89.7%

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

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

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

Alternative 8: 76.9% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.34999999999999995e-26 or 6.8e6 < z

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in z around inf 80.9%

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

    if -2.34999999999999995e-26 < z < 6.8e6

    1. Initial program 98.4%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in z around 0 80.4%

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

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

Alternative 9: 76.9% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.69999999999999989e-27 or 75000 < z

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in z around inf 80.9%

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

    if -2.69999999999999989e-27 < z < 75000

    1. Initial program 98.4%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in z around 0 80.3%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t}}} \]
    6. Applied egg-rr81.1%

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

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

Alternative 10: 62.6% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;a \leq 3.4 \cdot 10^{+58}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.99999999999999994e170 or 3.4000000000000001e58 < a

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in z around 0 83.5%

      \[\leadsto x + \color{blue}{\frac{t \cdot y}{a}} \]
    3. Taylor expanded in x around inf 75.8%

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

    if -5.99999999999999994e170 < a < 3.4000000000000001e58

    1. Initial program 98.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in z around inf 66.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6 \cdot 10^{+170}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 3.4 \cdot 10^{+58}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 11: 49.6% 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 99.2%

    \[x + y \cdot \frac{z - t}{z - a} \]
  2. Taylor expanded in z around 0 62.0%

    \[\leadsto x + \color{blue}{\frac{t \cdot y}{a}} \]
  3. Taylor expanded in x around inf 52.1%

    \[\leadsto \color{blue}{x} \]
  4. Final simplification52.1%

    \[\leadsto x \]

Developer target: 98.2% 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 2023308 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
  :precision binary64

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

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