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

Percentage Accurate: 98.3% → 98.5%
Time: 9.9s
Alternatives: 13
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 98.3% accurate, 1.0× speedup?

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

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

Alternative 1: 98.5% accurate, 1.0× speedup?

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

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

    \[x + y \cdot \frac{z - t}{a - t} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. clear-num99.1%

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

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

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

Alternative 2: 76.2% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;t \leq 2 \cdot 10^{+153}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -8.7000000000000001e114 or 2e153 < t

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative87.7%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified87.7%

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

    if -8.7000000000000001e114 < t < 4.7999999999999998e-45

    1. Initial program 98.3%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num98.2%

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

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

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

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

    if 4.7999999999999998e-45 < t < 2e153

    1. Initial program 99.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - \frac{y \cdot z}{t}} \]
      3. associate-/l*71.1%

        \[\leadsto x - \color{blue}{y \cdot \frac{z}{t}} \]
    8. Simplified71.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.7 \cdot 10^{+114}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{-45}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;t \leq 2 \cdot 10^{+153}:\\ \;\;\;\;x - y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 86.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{+35} \lor \neg \left(t \leq 8.5 \cdot 10^{+150}\right):\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.0999999999999999e35 or 8.4999999999999999e150 < t

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{a - t} + x \]
      4. distribute-lft-neg-out64.6%

        \[\leadsto \frac{\color{blue}{\left(-t\right) \cdot y}}{a - t} + x \]
      5. *-commutative64.6%

        \[\leadsto \frac{\color{blue}{y \cdot \left(-t\right)}}{a - t} + x \]
      6. *-lft-identity64.6%

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

        \[\leadsto \color{blue}{\frac{y}{1} \cdot \frac{-t}{a - t}} + x \]
      8. /-rgt-identity93.5%

        \[\leadsto \color{blue}{y} \cdot \frac{-t}{a - t} + x \]
      9. distribute-neg-frac93.5%

        \[\leadsto y \cdot \color{blue}{\left(-\frac{t}{a - t}\right)} + x \]
      10. distribute-neg-frac293.5%

        \[\leadsto y \cdot \color{blue}{\frac{t}{-\left(a - t\right)}} + x \]
      11. neg-sub093.5%

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

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

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

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

        \[\leadsto y \cdot \frac{t}{\color{blue}{\left(-\left(-t\right)\right)} - a} + x \]
      16. remove-double-neg93.5%

        \[\leadsto y \cdot \frac{t}{\color{blue}{t} - a} + x \]
    5. Simplified93.5%

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

    if -1.0999999999999999e35 < t < 8.4999999999999999e150

    1. Initial program 98.7%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num98.7%

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

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

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

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

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

Alternative 4: 84.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{+157} \lor \neg \left(t \leq 7.2 \cdot 10^{+155}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.6e157 or 7.20000000000000015e155 < t

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative90.0%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified90.0%

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

    if -1.6e157 < t < 7.20000000000000015e155

    1. Initial program 98.8%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num98.8%

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

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

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

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

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

Alternative 5: 84.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+157} \lor \neg \left(t \leq 2.3 \cdot 10^{+151}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.2e157 or 2.3000000000000001e151 < t

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative90.0%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified90.0%

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

    if -1.2e157 < t < 2.3000000000000001e151

    1. Initial program 98.8%

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

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

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

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

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

Alternative 6: 86.7% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{a - t} + x \]
      4. distribute-lft-neg-out64.2%

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

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

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

        \[\leadsto \color{blue}{\frac{y}{1} \cdot \frac{-t}{a - t}} + x \]
      8. /-rgt-identity90.3%

        \[\leadsto \color{blue}{y} \cdot \frac{-t}{a - t} + x \]
      9. distribute-neg-frac90.3%

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

        \[\leadsto y \cdot \color{blue}{\frac{t}{-\left(a - t\right)}} + x \]
      11. neg-sub090.3%

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

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

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

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

        \[\leadsto y \cdot \frac{t}{\color{blue}{\left(-\left(-t\right)\right)} - a} + x \]
      16. remove-double-neg90.3%

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

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

    if -1.7000000000000001e35 < t < 9.5000000000000001e150

    1. Initial program 98.7%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num98.7%

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

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

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

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

    if 9.5000000000000001e150 < t

    1. Initial program 100.0%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num100.0%

        \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{a - t}{z - t}}} \]
      2. un-div-inv100.0%

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

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

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

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

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

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

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

Alternative 7: 76.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.85 \cdot 10^{+117} \lor \neg \left(t \leq 8\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.85000000000000012e117 or 8 < t

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified78.0%

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

    if -2.85000000000000012e117 < t < 8

    1. Initial program 98.4%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num98.3%

        \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{a - t}{z - t}}} \]
      2. un-div-inv98.6%

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

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

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

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

Alternative 8: 76.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.55 \cdot 10^{+115} \lor \neg \left(t \leq 16\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.5499999999999998e115 or 16 < t

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified78.0%

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

    if -3.5499999999999998e115 < t < 16

    1. Initial program 98.4%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num98.3%

        \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{a - t}{z - t}}} \]
      2. un-div-inv98.6%

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

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

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

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

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

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

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

Alternative 9: 59.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.6 \cdot 10^{+215}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.5999999999999999e215

    1. Initial program 99.0%

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

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative64.7%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified64.7%

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

    if 1.5999999999999999e215 < y

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto x - \color{blue}{t \cdot \frac{y}{a}} \]
    6. Simplified62.9%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{a}} \]
    8. Step-by-step derivation
      1. mul-1-neg13.8%

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

        \[\leadsto -\color{blue}{t \cdot \frac{y}{a}} \]
      3. *-commutative44.7%

        \[\leadsto -\color{blue}{\frac{y}{a} \cdot t} \]
      4. distribute-rgt-neg-in44.7%

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

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

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

Alternative 10: 98.3% accurate, 1.0× speedup?

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

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

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

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

Alternative 11: 52.4% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{+96}:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.7499999999999999e96

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified37.1%

      \[\leadsto \color{blue}{y + x} \]
    6. Taylor expanded in y around inf 30.7%

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

    if -1.7499999999999999e96 < y

    1. Initial program 99.0%

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

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

Alternative 12: 60.9% accurate, 3.7× speedup?

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

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

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

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

      \[\leadsto \color{blue}{y + x} \]
  5. Simplified60.9%

    \[\leadsto \color{blue}{y + x} \]
  6. Final simplification60.9%

    \[\leadsto x + y \]
  7. Add Preprocessing

Alternative 13: 51.2% 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.1%

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

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

Developer Target 1: 99.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}

Reproduce

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

  :alt
  (! :herbie-platform default (if (< y -8508084860551241/100000000000000000000000000000000) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2894426862792089/10000000000000000000000000000000000000000000000000000000000000000) (+ x (* (* y (- z t)) (/ 1 (- a t)))) (+ x (* y (/ (- z t) (- a t)))))))

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