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

Percentage Accurate: 85.1% → 98.5%
Time: 7.6s
Alternatives: 11
Speedup: 1.0×

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

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

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

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

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

Alternative 2: 79.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{y}{\frac{a}{t}}\\ t_2 := x + z \cdot \frac{y}{z - a}\\ \mathbf{if}\;z \leq -4.8 \cdot 10^{-36}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-60}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 0.0002:\\ \;\;\;\;x - y \cdot \frac{t}{z}\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+50}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+61}:\\ \;\;\;\;x - \frac{y}{\frac{z}{t}}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (/ y (/ a t)))) (t_2 (+ x (* z (/ y (- z a))))))
   (if (<= z -4.8e-36)
     t_2
     (if (<= z 4e-60)
       t_1
       (if (<= z 0.0002)
         (- x (* y (/ t z)))
         (if (<= z 2e+50) t_1 (if (<= z 3.2e+61) (- x (/ y (/ z t))) t_2)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y / (a / t));
	double t_2 = x + (z * (y / (z - a)));
	double tmp;
	if (z <= -4.8e-36) {
		tmp = t_2;
	} else if (z <= 4e-60) {
		tmp = t_1;
	} else if (z <= 0.0002) {
		tmp = x - (y * (t / z));
	} else if (z <= 2e+50) {
		tmp = t_1;
	} else if (z <= 3.2e+61) {
		tmp = x - (y / (z / t));
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = x + (y / (a / t))
    t_2 = x + (z * (y / (z - a)))
    if (z <= (-4.8d-36)) then
        tmp = t_2
    else if (z <= 4d-60) then
        tmp = t_1
    else if (z <= 0.0002d0) then
        tmp = x - (y * (t / z))
    else if (z <= 2d+50) then
        tmp = t_1
    else if (z <= 3.2d+61) then
        tmp = x - (y / (z / t))
    else
        tmp = t_2
    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 / (a / t));
	double t_2 = x + (z * (y / (z - a)));
	double tmp;
	if (z <= -4.8e-36) {
		tmp = t_2;
	} else if (z <= 4e-60) {
		tmp = t_1;
	} else if (z <= 0.0002) {
		tmp = x - (y * (t / z));
	} else if (z <= 2e+50) {
		tmp = t_1;
	} else if (z <= 3.2e+61) {
		tmp = x - (y / (z / t));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (y / (a / t))
	t_2 = x + (z * (y / (z - a)))
	tmp = 0
	if z <= -4.8e-36:
		tmp = t_2
	elif z <= 4e-60:
		tmp = t_1
	elif z <= 0.0002:
		tmp = x - (y * (t / z))
	elif z <= 2e+50:
		tmp = t_1
	elif z <= 3.2e+61:
		tmp = x - (y / (z / t))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(y / Float64(a / t)))
	t_2 = Float64(x + Float64(z * Float64(y / Float64(z - a))))
	tmp = 0.0
	if (z <= -4.8e-36)
		tmp = t_2;
	elseif (z <= 4e-60)
		tmp = t_1;
	elseif (z <= 0.0002)
		tmp = Float64(x - Float64(y * Float64(t / z)));
	elseif (z <= 2e+50)
		tmp = t_1;
	elseif (z <= 3.2e+61)
		tmp = Float64(x - Float64(y / Float64(z / t)));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (y / (a / t));
	t_2 = x + (z * (y / (z - a)));
	tmp = 0.0;
	if (z <= -4.8e-36)
		tmp = t_2;
	elseif (z <= 4e-60)
		tmp = t_1;
	elseif (z <= 0.0002)
		tmp = x - (y * (t / z));
	elseif (z <= 2e+50)
		tmp = t_1;
	elseif (z <= 3.2e+61)
		tmp = x - (y / (z / t));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e-36], t$95$2, If[LessEqual[z, 4e-60], t$95$1, If[LessEqual[z, 0.0002], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+50], t$95$1, If[LessEqual[z, 3.2e+61], N[(x - N[(y / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + \frac{y}{\frac{a}{t}}\\
t_2 := x + z \cdot \frac{y}{z - a}\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{-36}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq 4 \cdot 10^{-60}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 0.0002:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\

\mathbf{elif}\;z \leq 2 \cdot 10^{+50}:\\
\;\;\;\;t_1\\

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

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.8e-36 or 3.1999999999999998e61 < z

    1. Initial program 68.4%

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

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

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

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

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

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

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

    if -4.8e-36 < z < 3.9999999999999999e-60 or 2.0000000000000001e-4 < z < 2.0000000000000002e50

    1. Initial program 96.4%

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t}}} \]
    6. Simplified85.1%

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

    if 3.9999999999999999e-60 < z < 2.0000000000000001e-4

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000002e50 < z < 3.1999999999999998e61

    1. Initial program 99.7%

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\left(-\frac{y}{\frac{z}{t}}\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification87.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{-36}:\\ \;\;\;\;x + z \cdot \frac{y}{z - a}\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-60}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq 0.0002:\\ \;\;\;\;x - y \cdot \frac{t}{z}\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+50}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+61}:\\ \;\;\;\;x - \frac{y}{\frac{z}{t}}\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \frac{y}{z - a}\\ \end{array} \]

Alternative 3: 76.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := x + \frac{y}{\frac{a}{t}}\\
\mathbf{if}\;z \leq -3.4 \cdot 10^{-41}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;z \leq 1.88 \cdot 10^{-59}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 0.0045:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\

\mathbf{elif}\;z \leq 9 \cdot 10^{+61}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.3999999999999998e-41 or 9e61 < z

    1. Initial program 68.9%

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

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

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

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

    if -3.3999999999999998e-41 < z < 1.88e-59 or 0.00449999999999999966 < z < 9e61

    1. Initial program 95.7%

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

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

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

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

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

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

    if 1.88e-59 < z < 0.00449999999999999966

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.4 \cdot 10^{-41}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 1.88 \cdot 10^{-59}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq 0.0045:\\ \;\;\;\;x - y \cdot \frac{t}{z}\\ \mathbf{elif}\;z \leq 9 \cdot 10^{+61}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 4: 78.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.2 \cdot 10^{+103} \lor \neg \left(a \leq 2050000000000\right):\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\

\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -9.20000000000000034e103 or 2.05e12 < a

    1. Initial program 85.9%

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

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

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

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

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

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

    if -9.20000000000000034e103 < a < 2.05e12

    1. Initial program 80.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -9.2 \cdot 10^{+103} \lor \neg \left(a \leq 2050000000000\right):\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\ \end{array} \]

Alternative 5: 87.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+65} \lor \neg \left(z \leq 2.6 \cdot 10^{+62}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.79999999999999989e65 or 2.59999999999999984e62 < z

    1. Initial program 64.8%

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

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

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

      \[\leadsto x + \frac{y}{\color{blue}{\frac{z - a}{z}}} \]
    5. Step-by-step derivation
      1. clear-num94.8%

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

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

        \[\leadsto x + \color{blue}{\frac{z}{z - a}} \cdot y \]
    6. Applied egg-rr94.9%

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

    if -1.79999999999999989e65 < z < 2.59999999999999984e62

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.8 \cdot 10^{+65} \lor \neg \left(z \leq 2.6 \cdot 10^{+62}\right):\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\ \end{array} \]

Alternative 6: 87.1% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 64.8%

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

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

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

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

    if -5.8000000000000001e65 < z < 1.2e62

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

    if 1.2e62 < z

    1. Initial program 64.9%

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

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

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

      \[\leadsto x + \frac{y}{\color{blue}{\frac{z - a}{z}}} \]
    5. Step-by-step derivation
      1. clear-num93.0%

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

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

        \[\leadsto x + \color{blue}{\frac{z}{z - a}} \cdot y \]
    6. Applied egg-rr93.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{+65}:\\ \;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+62}:\\ \;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \end{array} \]

Alternative 7: 76.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.28 \cdot 10^{-40} \lor \neg \left(z \leq 4.7 \cdot 10^{+62}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.28000000000000005e-40 or 4.7000000000000003e62 < z

    1. Initial program 68.9%

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

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

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

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

    if -1.28000000000000005e-40 < z < 4.7000000000000003e62

    1. Initial program 96.3%

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t}}} \]
    6. Simplified78.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.28 \cdot 10^{-40} \lor \neg \left(z \leq 4.7 \cdot 10^{+62}\right):\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \end{array} \]

Alternative 8: 96.1% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 9: 63.3% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;a \leq 6.1 \cdot 10^{+181}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.45000000000000001e153

    1. Initial program 89.2%

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

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

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

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

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

        \[\leadsto x + \frac{y}{\color{blue}{-\frac{a}{z}}} \]
      2. distribute-neg-frac66.6%

        \[\leadsto x + \frac{y}{\color{blue}{\frac{-a}{z}}} \]
    7. Simplified66.6%

      \[\leadsto x + \frac{y}{\color{blue}{\frac{-a}{z}}} \]
    8. Step-by-step derivation
      1. associate-/r/66.1%

        \[\leadsto x + \color{blue}{\frac{y}{-a} \cdot z} \]
      2. add-sqr-sqrt66.1%

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

        \[\leadsto x + \frac{y}{\color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}}} \cdot z \]
      4. sqr-neg63.7%

        \[\leadsto x + \frac{y}{\sqrt{\color{blue}{a \cdot a}}} \cdot z \]
      5. sqrt-unprod0.0%

        \[\leadsto x + \frac{y}{\color{blue}{\sqrt{a} \cdot \sqrt{a}}} \cdot z \]
      6. add-sqr-sqrt63.8%

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

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

    if -1.45000000000000001e153 < a < 6.10000000000000001e181

    1. Initial program 81.6%

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

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

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

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

    if 6.10000000000000001e181 < a

    1. Initial program 85.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.45 \cdot 10^{+153}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 6.1 \cdot 10^{+181}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 10: 63.5% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;a \leq 5.5 \cdot 10^{+182}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.50000000000000009e153 or 5.49999999999999977e182 < a

    1. Initial program 87.3%

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

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

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

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

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

    if -2.50000000000000009e153 < a < 5.49999999999999977e182

    1. Initial program 81.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.5 \cdot 10^{+153}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 5.5 \cdot 10^{+182}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

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

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

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

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

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

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

    \[\leadsto x \]

Developer target: 98.5% 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 2023257 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
  :precision binary64

  :herbie-target
  (+ x (/ y (/ (- z a) (- z t))))

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