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

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

Specification

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

\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\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: 84.8% accurate, 1.0× speedup?

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

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

Alternative 1: 98.0% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 2: 73.4% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+67} \lor \neg \left(z \leq -1.15 \cdot 10^{-18} \lor \neg \left(z \leq -1.08 \cdot 10^{-162}\right) \land z \leq 1.2 \cdot 10^{-32}\right):\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.54999999999999998e67 or -1.15e-18 < z < -1.08000000000000006e-162 or 1.2000000000000001e-32 < z

    1. Initial program 79.2%

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

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

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

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

    if -1.54999999999999998e67 < z < -1.15e-18 or -1.08000000000000006e-162 < z < 1.2000000000000001e-32

    1. Initial program 93.2%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{+67} \lor \neg \left(z \leq -1.15 \cdot 10^{-18} \lor \neg \left(z \leq -1.08 \cdot 10^{-162}\right) \land z \leq 1.2 \cdot 10^{-32}\right):\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 73.1% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{+69}:\\
\;\;\;\;x + t\\

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

\mathbf{elif}\;z \leq -1.25 \cdot 10^{-162} \lor \neg \left(z \leq 1.05 \cdot 10^{-32}\right):\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.8999999999999999e69 or -2e-19 < z < -1.25000000000000004e-162 or 1.05e-32 < z

    1. Initial program 79.2%

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

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

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

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

    if -3.8999999999999999e69 < z < -2e-19

    1. Initial program 86.9%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{t}{a} \cdot y} \]
    7. Simplified53.6%

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

    if -1.25000000000000004e-162 < z < 1.05e-32

    1. Initial program 94.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.9 \cdot 10^{+69}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-19}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq -1.25 \cdot 10^{-162} \lor \neg \left(z \leq 1.05 \cdot 10^{-32}\right):\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 73.3% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.8 \cdot 10^{+67}:\\
\;\;\;\;x + t\\

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

\mathbf{elif}\;z \leq -1.25 \cdot 10^{-162} \lor \neg \left(z \leq 1.22 \cdot 10^{-32}\right):\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.7999999999999998e67 or -1.34999999999999994e-18 < z < -1.25000000000000004e-162 or 1.22e-32 < z

    1. Initial program 79.2%

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

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

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

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

    if -9.7999999999999998e67 < z < -1.34999999999999994e-18

    1. Initial program 86.9%

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{t}{\frac{a}{y}}} \]
    7. Simplified53.7%

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

    if -1.25000000000000004e-162 < z < 1.22e-32

    1. Initial program 94.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.8 \cdot 10^{+67}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq -1.35 \cdot 10^{-18}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq -1.25 \cdot 10^{-162} \lor \neg \left(z \leq 1.22 \cdot 10^{-32}\right):\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 73.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+89}:\\
\;\;\;\;x + t\\

\mathbf{elif}\;z \leq -3.7 \cdot 10^{-121}:\\
\;\;\;\;x - t \cdot \frac{z}{a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.99999999999999995e88 or 8.1999999999999996e-38 < z

    1. Initial program 75.8%

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

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

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

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

    if -9.99999999999999995e88 < z < -3.7000000000000002e-121

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - z \cdot \frac{t}{a}} \]
      5. associate-*r/66.1%

        \[\leadsto x - \color{blue}{\frac{z \cdot t}{a}} \]
      6. associate-*l/68.3%

        \[\leadsto x - \color{blue}{\frac{z}{a} \cdot t} \]
      7. *-commutative68.3%

        \[\leadsto x - \color{blue}{t \cdot \frac{z}{a}} \]
    11. Simplified68.3%

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

    if -3.7000000000000002e-121 < z < 8.1999999999999996e-38

    1. Initial program 94.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+89}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq -3.7 \cdot 10^{-121}:\\ \;\;\;\;x - t \cdot \frac{z}{a}\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{-38}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 83.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+101} \lor \neg \left(z \leq 2.65 \cdot 10^{+128}\right):\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.60000000000000029e101 or 2.6500000000000001e128 < z

    1. Initial program 69.9%

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

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

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

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

    if -3.60000000000000029e101 < z < 2.6500000000000001e128

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 77.8% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;y \leq 5.5 \cdot 10^{-238}:\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.54999999999999993e-170

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

    if -1.54999999999999993e-170 < y < 5.49999999999999995e-238

    1. Initial program 87.8%

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

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

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

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

    if 5.49999999999999995e-238 < y

    1. Initial program 82.6%

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

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

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

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

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

Alternative 8: 85.2% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.9999999999999999e-154

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999999e-154 < y < 1.64999999999999994e-16

    1. Initial program 84.8%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{-t}{\frac{a - z}{z}}} \]
      4. div-sub95.9%

        \[\leadsto x + \frac{-t}{\color{blue}{\frac{a}{z} - \frac{z}{z}}} \]
      5. *-inverses95.9%

        \[\leadsto x + \frac{-t}{\frac{a}{z} - \color{blue}{1}} \]
    7. Simplified95.9%

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

        \[\leadsto x + \color{blue}{\frac{-\left(-t\right)}{-\left(\frac{a}{z} - 1\right)}} \]
      2. div-inv95.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \frac{t}{\color{blue}{\left(0 - -1\right) - \frac{a}{z}}} \]
      6. metadata-eval95.9%

        \[\leadsto x + \frac{t}{\color{blue}{1} - \frac{a}{z}} \]
    11. Simplified95.9%

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

    if 1.64999999999999994e-16 < y

    1. Initial program 84.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{-154}:\\ \;\;\;\;x + y \cdot \frac{t}{a - z}\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-16}:\\ \;\;\;\;x + \frac{t}{1 - \frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 63.0% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;a \leq 3.8 \cdot 10^{+144}:\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.5999999999999999e216 or 3.80000000000000026e144 < a

    1. Initial program 79.9%

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

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

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

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

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

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

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

    if -2.5999999999999999e216 < a < 3.80000000000000026e144

    1. Initial program 86.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.6 \cdot 10^{+216}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 3.8 \cdot 10^{+144}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 95.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

Alternative 11: 50.1% 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 85.3%

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

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

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

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

      \[\leadsto x + \color{blue}{\frac{t}{\frac{a}{y}}} \]
  7. Simplified63.4%

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

    \[\leadsto \color{blue}{x} \]
  9. Final simplification54.4%

    \[\leadsto x \]
  10. Add Preprocessing

Developer target: 99.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{y - z}{a - z} \cdot t\\ \mathbf{if}\;t < -1.0682974490174067 \cdot 10^{-39}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t < 3.9110949887586375 \cdot 10^{-141}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* (/ (- y z) (- a z)) t))))
   (if (< t -1.0682974490174067e-39)
     t_1
     (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (((y - z) / (a - z)) * t);
	double tmp;
	if (t < -1.0682974490174067e-39) {
		tmp = t_1;
	} else if (t < 3.9110949887586375e-141) {
		tmp = x + (((y - z) * t) / (a - z));
	} 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) / (a - z)) * t)
    if (t < (-1.0682974490174067d-39)) then
        tmp = t_1
    else if (t < 3.9110949887586375d-141) then
        tmp = x + (((y - z) * t) / (a - z))
    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) / (a - z)) * t);
	double tmp;
	if (t < -1.0682974490174067e-39) {
		tmp = t_1;
	} else if (t < 3.9110949887586375e-141) {
		tmp = x + (((y - z) * t) / (a - z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (((y - z) / (a - z)) * t)
	tmp = 0
	if t < -1.0682974490174067e-39:
		tmp = t_1
	elif t < 3.9110949887586375e-141:
		tmp = x + (((y - z) * t) / (a - z))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(Float64(y - z) / Float64(a - z)) * t))
	tmp = 0.0
	if (t < -1.0682974490174067e-39)
		tmp = t_1;
	elseif (t < 3.9110949887586375e-141)
		tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (((y - z) / (a - z)) * t);
	tmp = 0.0;
	if (t < -1.0682974490174067e-39)
		tmp = t_1;
	elseif (t < 3.9110949887586375e-141)
		tmp = x + (((y - z) * t) / (a - z));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.0682974490174067e-39], t$95$1, If[Less[t, 3.9110949887586375e-141], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}

Reproduce

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

  :herbie-target
  (if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))

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