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

Percentage Accurate: 85.0% → 99.5%
Time: 10.7s
Alternatives: 13
Speedup: 0.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 85.0% accurate, 1.0× speedup?

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

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

Alternative 1: 99.5% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 10^{+274}:\\
\;\;\;\;x + t\_1\\

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


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

    1. Initial program 34.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 9.99999999999999921e273

    1. Initial program 99.4%

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

    if 9.99999999999999921e273 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 60.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.2% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right) \end{array} \]
(FPCore (x y z t a) :precision binary64 (fma y (/ (- z t) (- z a)) x))
double code(double x, double y, double z, double t, double a) {
	return fma(y, ((z - t) / (z - a)), x);
}
function code(x, y, z, t, a)
	return fma(y, Float64(Float64(z - t) / Float64(z - a)), x)
end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)
\end{array}
Derivation
  1. Initial program 87.7%

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
  4. Add Preprocessing
  5. Final simplification97.7%

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

Alternative 3: 96.5% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 45.9%

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

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

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

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 9.99999999999999921e273

    1. Initial program 99.4%

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

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

Alternative 4: 99.5% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 45.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 9.99999999999999921e273

    1. Initial program 99.4%

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

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

Alternative 5: 83.5% accurate, 0.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -4.9999999999999999e119 or 5e21 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 72.1%

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

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

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

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

    if -4.9999999999999999e119 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 5e21

    1. Initial program 99.2%

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

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

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

Alternative 6: 75.7% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-41}:\\
\;\;\;\;y + x\\

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

\mathbf{elif}\;z \leq 2.6 \cdot 10^{+22}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.1999999999999999e-41 or 2.6e22 < z

    1. Initial program 80.7%

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

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

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

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

    if -5.1999999999999999e-41 < z < 1.4499999999999999e-53

    1. Initial program 94.0%

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

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

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

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

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

    if 1.4499999999999999e-53 < z < 2.6e22

    1. Initial program 94.8%

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

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

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

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

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

Alternative 7: 75.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{-38} \lor \neg \left(z \leq 2.05 \cdot 10^{+18}\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.6000000000000001e-38 or 2.05e18 < z

    1. Initial program 80.7%

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

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

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

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

    if -3.6000000000000001e-38 < z < 2.05e18

    1. Initial program 94.1%

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

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

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

Alternative 8: 76.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.55 \cdot 10^{-35} \lor \neg \left(z \leq 4.8 \cdot 10^{+20}\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.55000000000000022e-35 or 4.8e20 < z

    1. Initial program 80.7%

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

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

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

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

    if -4.55000000000000022e-35 < z < 4.8e20

    1. Initial program 94.1%

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

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

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

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

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

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

Alternative 9: 58.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4 \cdot 10^{-257} \lor \neg \left(z \leq 5 \cdot 10^{-83}\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.3999999999999997e-257 or 5e-83 < z

    1. Initial program 86.6%

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

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

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified65.4%

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

    if -5.3999999999999997e-257 < z < 5e-83

    1. Initial program 91.5%

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

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

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

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

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

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

Alternative 10: 98.1% accurate, 0.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 53.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.9 \cdot 10^{-97}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{-132}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= x -2.9e-97) x (if (<= x 1.05e-132) y x)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (x <= -2.9e-97) {
		tmp = x;
	} else if (x <= 1.05e-132) {
		tmp = y;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (x <= (-2.9d-97)) then
        tmp = x
    else if (x <= 1.05d-132) then
        tmp = y
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (x <= -2.9e-97) {
		tmp = x;
	} else if (x <= 1.05e-132) {
		tmp = y;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if x <= -2.9e-97:
		tmp = x
	elif x <= 1.05e-132:
		tmp = y
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (x <= -2.9e-97)
		tmp = x;
	elseif (x <= 1.05e-132)
		tmp = y;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (x <= -2.9e-97)
		tmp = x;
	elseif (x <= 1.05e-132)
		tmp = y;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.9e-97], x, If[LessEqual[x, 1.05e-132], y, x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{-97}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 1.05 \cdot 10^{-132}:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.8999999999999999e-97 or 1.05e-132 < x

    1. Initial program 88.2%

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

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

    if -2.8999999999999999e-97 < x < 1.05e-132

    1. Initial program 86.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.9 \cdot 10^{-97}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{-132}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 61.0% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 90.7%

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

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

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

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

    if 2.1e14 < a

    1. Initial program 77.8%

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification47.6%

    \[\leadsto x \]
  5. Add Preprocessing

Developer target: 98.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{y}{\frac{z - a}{z - 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(y / Float64(Float64(z - a) / Float64(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[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Reproduce

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

  :alt
  (+ x (/ y (/ (- z a) (- z t))))

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