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

Percentage Accurate: 85.5% → 99.5%
Time: 9.5s
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: 85.5% 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: 99.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(y - z\right) \cdot t}{a - z}\\ \mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 10^{+277}\right):\\ \;\;\;\;t \cdot \left(\frac{x}{t} + \frac{y - z}{a - z}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 + x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* (- y z) t) (- a z))))
   (if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+277)))
     (* t (+ (/ x t) (/ (- y z) (- a z))))
     (+ t_1 x))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = ((y - z) * t) / (a - z);
	double tmp;
	if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+277)) {
		tmp = t * ((x / t) + ((y - z) / (a - z)));
	} else {
		tmp = t_1 + x;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = ((y - z) * t) / (a - z);
	double tmp;
	if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+277)) {
		tmp = t * ((x / t) + ((y - z) / (a - z)));
	} else {
		tmp = t_1 + x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = ((y - z) * t) / (a - z)
	tmp = 0
	if (t_1 <= -math.inf) or not (t_1 <= 1e+277):
		tmp = t * ((x / t) + ((y - z) / (a - z)))
	else:
		tmp = t_1 + x
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(Float64(y - z) * t) / Float64(a - z))
	tmp = 0.0
	if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e+277))
		tmp = Float64(t * Float64(Float64(x / t) + Float64(Float64(y - z) / Float64(a - z))));
	else
		tmp = Float64(t_1 + x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = ((y - z) * t) / (a - z);
	tmp = 0.0;
	if ((t_1 <= -Inf) || ~((t_1 <= 1e+277)))
		tmp = t * ((x / t) + ((y - z) / (a - z)));
	else
		tmp = t_1 + x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+277]], $MachinePrecision]], N[(t * N[(N[(x / t), $MachinePrecision] + N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 10^{+277}\right):\\
\;\;\;\;t \cdot \left(\frac{x}{t} + \frac{y - z}{a - z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -inf.0 or 1e277 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z))

    1. Initial program 41.8%

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

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

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

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

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

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

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

    if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 1e277

    1. Initial program 99.4%

      \[x + \frac{\left(y - z\right) \cdot t}{a - z} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification99.5%

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

Alternative 2: 99.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(y - z\right) \cdot t}{a - z}\\ \mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 10^{+277}\right):\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t\_1 + x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* (- y z) t) (- a z))))
   (if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+277)))
     (+ x (* (- y z) (/ t (- a z))))
     (+ t_1 x))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = ((y - z) * t) / (a - z);
	double tmp;
	if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+277)) {
		tmp = x + ((y - z) * (t / (a - z)));
	} else {
		tmp = t_1 + x;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = ((y - z) * t) / (a - z);
	double tmp;
	if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+277)) {
		tmp = x + ((y - z) * (t / (a - z)));
	} else {
		tmp = t_1 + x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = ((y - z) * t) / (a - z)
	tmp = 0
	if (t_1 <= -math.inf) or not (t_1 <= 1e+277):
		tmp = x + ((y - z) * (t / (a - z)))
	else:
		tmp = t_1 + x
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(Float64(y - z) * t) / Float64(a - z))
	tmp = 0.0
	if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e+277))
		tmp = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z))));
	else
		tmp = Float64(t_1 + x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = ((y - z) * t) / (a - z);
	tmp = 0.0;
	if ((t_1 <= -Inf) || ~((t_1 <= 1e+277)))
		tmp = x + ((y - z) * (t / (a - z)));
	else
		tmp = t_1 + x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+277]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 10^{+277}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -inf.0 or 1e277 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z))

    1. Initial program 41.8%

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

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

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

    if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 1e277

    1. Initial program 99.4%

      \[x + \frac{\left(y - z\right) \cdot t}{a - z} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification99.5%

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

Alternative 3: 84.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+172} \lor \neg \left(z \leq 1.5 \cdot 10^{+112}\right):\\
\;\;\;\;t + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.6e172 or 1.4999999999999999e112 < z

    1. Initial program 67.7%

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

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

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

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

    if -2.6e172 < z < 1.4999999999999999e112

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

Alternative 4: 83.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{-63} \lor \neg \left(y \leq 3.9 \cdot 10^{-13}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.2e-63 or 3.90000000000000004e-13 < y

    1. Initial program 84.9%

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

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

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

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

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

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

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

    if -4.2e-63 < y < 3.90000000000000004e-13

    1. Initial program 89.6%

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

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

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

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

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

        \[\leadsto x + \frac{\color{blue}{-t \cdot z}}{a - z} \]
      3. distribute-rgt-neg-out81.6%

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

      \[\leadsto x + \color{blue}{\frac{t \cdot \left(-z\right)}{a - z}} \]
    8. Step-by-step derivation
      1. frac-2neg81.6%

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

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(-z\right)\right) \cdot \frac{1}{-\left(a - z\right)}} \]
      3. distribute-rgt-neg-out81.5%

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

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

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

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

        \[\leadsto x + \left(t \cdot \sqrt{\color{blue}{\left(-z\right) \cdot \left(-z\right)}}\right) \cdot \frac{1}{-\left(a - z\right)} \]
      8. sqrt-unprod31.7%

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

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

        \[\leadsto x + \color{blue}{\left(\left(-z\right) \cdot t\right)} \cdot \frac{1}{-\left(a - z\right)} \]
      11. add-sqr-sqrt31.7%

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

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

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

        \[\leadsto x + \left(\color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot t\right) \cdot \frac{1}{-\left(a - z\right)} \]
      15. add-sqr-sqrt81.5%

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

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

        \[\leadsto x + \left(z \cdot t\right) \cdot \frac{1}{\color{blue}{\left(-a\right) + \left(-\left(-z\right)\right)}} \]
      18. add-sqr-sqrt45.3%

        \[\leadsto x + \left(z \cdot t\right) \cdot \frac{1}{\left(-a\right) + \left(-\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}\right)} \]
      19. sqrt-unprod64.3%

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

        \[\leadsto x + \left(z \cdot t\right) \cdot \frac{1}{\left(-a\right) + \left(-\sqrt{\color{blue}{z \cdot z}}\right)} \]
      21. sqrt-unprod25.0%

        \[\leadsto x + \left(z \cdot t\right) \cdot \frac{1}{\left(-a\right) + \left(-\color{blue}{\sqrt{z} \cdot \sqrt{z}}\right)} \]
      22. add-sqr-sqrt61.5%

        \[\leadsto x + \left(z \cdot t\right) \cdot \frac{1}{\left(-a\right) + \left(-\color{blue}{z}\right)} \]
      23. add-sqr-sqrt36.5%

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

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

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

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

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

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

        \[\leadsto x + \frac{t \cdot z}{\color{blue}{z + \left(-a\right)}} \]
      5. unsub-neg81.6%

        \[\leadsto x + \frac{t \cdot z}{\color{blue}{z - a}} \]
    11. Simplified81.6%

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

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

Alternative 5: 87.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{-61} \lor \neg \left(y \leq 2.9 \cdot 10^{+31}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.54999999999999997e-61 or 2.9e31 < y

    1. Initial program 84.6%

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

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

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

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

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

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

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

    if -1.54999999999999997e-61 < y < 2.9e31

    1. Initial program 89.6%

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

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

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

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

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

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

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

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

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

Alternative 6: 69.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -68000000000000:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\

\mathbf{elif}\;x \leq 2.8 \cdot 10^{-36}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -6.8e13

    1. Initial program 89.6%

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

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

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

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

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

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

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

    if -6.8e13 < x < 2.8000000000000001e-36

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(-\mathsf{fma}\left(-1, \frac{\left(y - z\right) \cdot t}{\color{blue}{\left(a - z\right) \cdot x}}, -1\right)\right) \]
      6. times-frac79.2%

        \[\leadsto x \cdot \left(-\mathsf{fma}\left(-1, \color{blue}{\frac{y - z}{a - z} \cdot \frac{t}{x}}, -1\right)\right) \]
      7. metadata-eval79.2%

        \[\leadsto x \cdot \left(-\mathsf{fma}\left(-1, \frac{y - z}{a - z} \cdot \frac{t}{x}, \color{blue}{-1}\right)\right) \]
    7. Simplified79.2%

      \[\leadsto \color{blue}{x \cdot \left(-\mathsf{fma}\left(-1, \frac{y - z}{a - z} \cdot \frac{t}{x}, -1\right)\right)} \]
    8. Taylor expanded in x around 0 62.4%

      \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a - z}} \]
    9. Step-by-step derivation
      1. *-commutative62.4%

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

        \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{t}{a - z}} \]
    10. Applied egg-rr72.1%

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

    if 2.8000000000000001e-36 < x

    1. Initial program 88.9%

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

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

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

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

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

Alternative 7: 75.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.082 \lor \neg \left(z \leq 1.55 \cdot 10^{+112}\right):\\
\;\;\;\;t + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.0820000000000000034 or 1.54999999999999991e112 < z

    1. Initial program 76.2%

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

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

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

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

    if -0.0820000000000000034 < z < 1.54999999999999991e112

    1. Initial program 94.4%

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

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

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

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

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

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

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

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

Alternative 8: 76.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.018 \lor \neg \left(z \leq 1.65 \cdot 10^{+98}\right):\\
\;\;\;\;t + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.0179999999999999986 or 1.65000000000000014e98 < z

    1. Initial program 76.2%

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

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

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

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

    if -0.0179999999999999986 < z < 1.65000000000000014e98

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

Alternative 9: 62.3% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;a \leq 3.3 \cdot 10^{+173}:\\
\;\;\;\;t + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.60000000000000006e148 or 3.29999999999999996e173 < a

    1. Initial program 84.0%

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

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

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

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

    if -3.60000000000000006e148 < a < 3.29999999999999996e173

    1. Initial program 88.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.6 \cdot 10^{+148}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 3.3 \cdot 10^{+173}:\\ \;\;\;\;t + x\\ \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 87.0%

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

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

    \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t}{a - z}} \]
  4. Add Preprocessing
  5. Final simplification95.9%

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

Alternative 11: 50.5% accurate, 11.0× speedup?

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification50.9%

    \[\leadsto x \]
  7. 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 2024059 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
  :precision binary64

  :alt
  (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))))