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

Percentage Accurate: 98.4% → 98.6%
Time: 9.4s
Alternatives: 11
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 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.4% 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.6% 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 98.5%

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

      \[\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. Add Preprocessing

Alternative 2: 77.4% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.7e53 or 1.42e113 < t

    1. Initial program 100.0%

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

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

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

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

    if -3.7e53 < t < 3.80000000000000023e-22

    1. Initial program 96.7%

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

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

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

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

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

    if 3.80000000000000023e-22 < t < 1.42e113

    1. Initial program 99.9%

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y \cdot z}{t}} \]
      2. add-sqr-sqrt38.5%

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

        \[\leadsto x - \frac{\color{blue}{\sqrt{y \cdot y}} \cdot z}{t} \]
      4. sqr-neg53.4%

        \[\leadsto x - \frac{\sqrt{\color{blue}{\left(-y\right) \cdot \left(-y\right)}} \cdot z}{t} \]
      5. sqrt-unprod24.6%

        \[\leadsto x - \frac{\color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)} \cdot z}{t} \]
      6. add-sqr-sqrt49.0%

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

        \[\leadsto x - \frac{\color{blue}{z \cdot \left(-y\right)}}{t} \]
      8. add-sqr-sqrt24.6%

        \[\leadsto x - \frac{z \cdot \color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)}}{t} \]
      9. sqrt-unprod53.4%

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

        \[\leadsto x - \frac{z \cdot \sqrt{\color{blue}{y \cdot y}}}{t} \]
      11. sqrt-unprod38.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.7 \cdot 10^{+53}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{-22}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \mathbf{elif}\;t \leq 1.42 \cdot 10^{+113}:\\ \;\;\;\;x - \frac{y \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 77.6% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.3000000000000002e53 or 1.54999999999999996e113 < t

    1. Initial program 100.0%

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

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

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

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

    if -3.3000000000000002e53 < t < 2.55000000000000005e-23

    1. Initial program 96.7%

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

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

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

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

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

    if 2.55000000000000005e-23 < t < 1.54999999999999996e113

    1. Initial program 99.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.3 \cdot 10^{+53}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 2.55 \cdot 10^{-23}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \mathbf{elif}\;t \leq 1.55 \cdot 10^{+113}:\\ \;\;\;\;x - y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 87.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -7.8 \cdot 10^{+83} \lor \neg \left(t \leq 8.5 \cdot 10^{+71}\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 -7.8e+83) (not (<= t 8.5e+71)))
   (+ 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 <= -7.8e+83) || !(t <= 8.5e+71)) {
		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 <= (-7.8d+83)) .or. (.not. (t <= 8.5d+71))) 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 <= -7.8e+83) || !(t <= 8.5e+71)) {
		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 <= -7.8e+83) or not (t <= 8.5e+71):
		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 <= -7.8e+83) || !(t <= 8.5e+71))
		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 <= -7.8e+83) || ~((t <= 8.5e+71)))
		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, -7.8e+83], N[Not[LessEqual[t, 8.5e+71]], $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 -7.8 \cdot 10^{+83} \lor \neg \left(t \leq 8.5 \cdot 10^{+71}\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 < -7.8000000000000003e83 or 8.4999999999999996e71 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.8000000000000003e83 < t < 8.4999999999999996e71

    1. Initial program 97.2%

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

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

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

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

      \[\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 -7.8 \cdot 10^{+83} \lor \neg \left(t \leq 8.5 \cdot 10^{+71}\right):\\ \;\;\;\;x + y \cdot \frac{t}{t - a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 84.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -6.7 \cdot 10^{+84} \lor \neg \left(t \leq 2.95 \cdot 10^{+113}\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 -6.7e+84) (not (<= t 2.95e+113)))
   (+ x y)
   (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -6.7e+84) || !(t <= 2.95e+113)) {
		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 <= (-6.7d+84)) .or. (.not. (t <= 2.95d+113))) 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 <= -6.7e+84) || !(t <= 2.95e+113)) {
		tmp = x + y;
	} else {
		tmp = x + (y / ((a - t) / z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (t <= -6.7e+84) or not (t <= 2.95e+113):
		tmp = x + y
	else:
		tmp = x + (y / ((a - t) / z))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((t <= -6.7e+84) || !(t <= 2.95e+113))
		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 <= -6.7e+84) || ~((t <= 2.95e+113)))
		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, -6.7e+84], N[Not[LessEqual[t, 2.95e+113]], $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 -6.7 \cdot 10^{+84} \lor \neg \left(t \leq 2.95 \cdot 10^{+113}\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 < -6.70000000000000041e84 or 2.95000000000000011e113 < t

    1. Initial program 100.0%

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

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

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

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

    if -6.70000000000000041e84 < t < 2.95000000000000011e113

    1. Initial program 97.4%

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

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

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

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

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

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

Alternative 6: 87.9% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto x - \color{blue}{y \cdot \frac{z - t}{t}} \]
      4. div-sub95.2%

        \[\leadsto x - y \cdot \color{blue}{\left(\frac{z}{t} - \frac{t}{t}\right)} \]
      5. sub-neg95.2%

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

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

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

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

    if -2.7999999999999999e45 < t < 1.12000000000000003e74

    1. Initial program 97.0%

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

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

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

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

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

    if 1.12000000000000003e74 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.8 \cdot 10^{+45}:\\ \;\;\;\;x - y \cdot \left(\frac{z}{t} + -1\right)\\ \mathbf{elif}\;t \leq 1.12 \cdot 10^{+74}:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t}{t - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 75.3% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.06000000000000004e55 or 2.6e-151 < t

    1. Initial program 98.2%

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

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

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

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

    if -1.06000000000000004e55 < t < 2.6e-151

    1. Initial program 99.1%

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

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

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

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

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

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

Alternative 8: 75.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.45 \cdot 10^{+54} \lor \neg \left(t \leq 2.65 \cdot 10^{-151}\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 -1.45e+54) (not (<= t 2.65e-151))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -1.45e+54) || !(t <= 2.65e-151)) {
		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 <= (-1.45d+54)) .or. (.not. (t <= 2.65d-151))) 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 <= -1.45e+54) || !(t <= 2.65e-151)) {
		tmp = x + y;
	} else {
		tmp = x + (y / (a / z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (t <= -1.45e+54) or not (t <= 2.65e-151):
		tmp = x + y
	else:
		tmp = x + (y / (a / z))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((t <= -1.45e+54) || !(t <= 2.65e-151))
		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 <= -1.45e+54) || ~((t <= 2.65e-151)))
		tmp = x + y;
	else
		tmp = x + (y / (a / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.45e+54], N[Not[LessEqual[t, 2.65e-151]], $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 -1.45 \cdot 10^{+54} \lor \neg \left(t \leq 2.65 \cdot 10^{-151}\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 < -1.4499999999999999e54 or 2.64999999999999989e-151 < t

    1. Initial program 98.2%

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

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

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

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

    if -1.4499999999999999e54 < t < 2.64999999999999989e-151

    1. Initial program 99.1%

      \[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.7%

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

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

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

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

Alternative 9: 98.4% 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}
Derivation
  1. Initial program 98.5%

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

Alternative 10: 62.7% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 6.4 \cdot 10^{+115}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 6.4e115

    1. Initial program 98.3%

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

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

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

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

    if 6.4e115 < a

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 6.4 \cdot 10^{+115}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 51.5% accurate, 11.0× speedup?

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

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

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

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

Developer Target 1: 99.4% 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 2024136 
(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)))))