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

Percentage Accurate: 85.7% → 98.4%
Time: 10.9s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 85.7% accurate, 1.0× speedup?

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

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

Alternative 1: 98.4% accurate, 1.0× speedup?

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

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

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

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

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

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

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

    \[\leadsto x + \color{blue}{\frac{y}{\frac{a - t}{z - t}}} \]
  7. Final simplification98.2%

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

Alternative 2: 87.1% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9.0000000000000003e-20 or 3.0500000000000001e103 < t

    1. Initial program 71.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.0000000000000003e-20 < t < 3.0500000000000001e103

    1. Initial program 91.9%

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

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

      \[\leadsto \color{blue}{x + y \cdot \frac{z - t}{a - t}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num96.9%

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

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

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

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

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

Alternative 3: 84.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -9.2 \cdot 10^{+111} \lor \neg \left(t \leq 3.5 \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 -9.2e+111) (not (<= t 3.5e+113)))
   (+ x y)
   (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -9.2e+111) || !(t <= 3.5e+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 <= (-9.2d+111)) .or. (.not. (t <= 3.5d+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 <= -9.2e+111) || !(t <= 3.5e+113)) {
		tmp = x + y;
	} else {
		tmp = x + (y / ((a - t) / z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (t <= -9.2e+111) or not (t <= 3.5e+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 <= -9.2e+111) || !(t <= 3.5e+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 <= -9.2e+111) || ~((t <= 3.5e+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, -9.2e+111], N[Not[LessEqual[t, 3.5e+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 -9.2 \cdot 10^{+111} \lor \neg \left(t \leq 3.5 \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 < -9.20000000000000008e111 or 3.5000000000000001e113 < t

    1. Initial program 62.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified82.0%

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

    if -9.20000000000000008e111 < t < 3.5000000000000001e113

    1. Initial program 92.6%

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

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

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

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

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

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

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

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

Alternative 4: 84.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{+108} \lor \neg \left(t \leq 3.3 \cdot 10^{+111}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.90000000000000007e108 or 3.3000000000000001e111 < t

    1. Initial program 62.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified82.0%

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

    if -2.90000000000000007e108 < t < 3.3000000000000001e111

    1. Initial program 92.6%

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

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

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

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

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

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

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

Alternative 5: 87.4% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 78.4%

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z - t, \frac{y}{a - t}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine94.4%

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

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

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

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

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

    if -8e20 < z < 1.70000000000000009e-68

    1. Initial program 87.7%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - \frac{t \cdot y}{a - t}} \]
      3. *-commutative81.1%

        \[\leadsto x - \frac{\color{blue}{y \cdot t}}{a - t} \]
      4. *-lft-identity81.1%

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

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

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

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

    if 1.70000000000000009e-68 < z

    1. Initial program 81.2%

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

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

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

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

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

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

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

Alternative 6: 77.3% accurate, 0.6× speedup?

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

    1. Initial program 73.6%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified75.8%

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

    if -7.4e-22 < t < 8.5999999999999995e64

    1. Initial program 91.9%

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

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

      \[\leadsto \color{blue}{x + y \cdot \frac{z - t}{a - t}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num96.7%

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

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

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

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

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

Alternative 7: 62.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+152} \lor \neg \left(y \leq 4.5 \cdot 10^{+239}\right):\\
\;\;\;\;y \cdot \left(1 - \frac{z}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.0999999999999999e152 or 4.4999999999999998e239 < y

    1. Initial program 68.9%

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

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

      \[\leadsto \color{blue}{x + y \cdot \frac{z - t}{a - t}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num98.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}}} \]
    6. Applied egg-rr98.1%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(y \cdot \left(\frac{z}{t} - 1\right)\right)} \]
    11. Step-by-step derivation
      1. sub-neg57.7%

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

        \[\leadsto -1 \cdot \left(y \cdot \left(\frac{z}{t} + \color{blue}{-1}\right)\right) \]
      3. neg-mul-157.7%

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

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

        \[\leadsto y \cdot \left(-\color{blue}{\left(-1 + \frac{z}{t}\right)}\right) \]
      6. distribute-neg-in57.7%

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

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

        \[\leadsto y \cdot \color{blue}{\left(1 - \frac{z}{t}\right)} \]
    12. Simplified57.7%

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

    if -1.0999999999999999e152 < y < 4.4999999999999998e239

    1. Initial program 88.0%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified66.4%

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

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

Alternative 8: 59.2% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 76.2%

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{t \cdot \frac{y}{a}} \]
    8. Simplified53.0%

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

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

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

        \[\leadsto -\color{blue}{t \cdot \frac{y}{a}} \]
      3. distribute-lft-neg-out41.6%

        \[\leadsto \color{blue}{\left(-t\right) \cdot \frac{y}{a}} \]
      4. *-commutative41.6%

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

      \[\leadsto \color{blue}{\frac{y}{a} \cdot \left(-t\right)} \]
    12. Step-by-step derivation
      1. *-commutative41.6%

        \[\leadsto \color{blue}{\left(-t\right) \cdot \frac{y}{a}} \]
      2. distribute-lft-neg-in41.6%

        \[\leadsto \color{blue}{-t \cdot \frac{y}{a}} \]
      3. clear-num41.6%

        \[\leadsto -t \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      4. un-div-inv42.6%

        \[\leadsto -\color{blue}{\frac{t}{\frac{a}{y}}} \]
    13. Applied egg-rr42.6%

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

    if -5.1000000000000002e241 < y

    1. Initial program 84.4%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified62.3%

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

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

Alternative 9: 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 83.7%

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

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

    \[\leadsto \color{blue}{x + y \cdot \frac{z - t}{a - t}} \]
  4. Add Preprocessing
  5. Final simplification98.1%

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

Alternative 10: 59.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 83.7%

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{y + x} \]
  8. Final simplification58.7%

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

Alternative 11: 50.3% accurate, 11.0× speedup?

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

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

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

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

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

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

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

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

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

Developer Target 1: 98.4% accurate, 1.0× speedup?

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

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

Reproduce

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

  :alt
  (! :herbie-platform default (+ x (/ y (/ (- a t) (- z t)))))

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