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

Percentage Accurate: 98.3% → 98.3%
Time: 8.0s
Alternatives: 12
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 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: 98.3% accurate, 1.0× speedup?

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

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

Alternative 1: 98.3% accurate, 1.0× speedup?

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

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

    \[x + y \cdot \frac{z - t}{a - t} \]
  2. Final simplification98.8%

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

Alternative 2: 62.7% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t \leq -5.2 \cdot 10^{-298}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 1.28 \cdot 10^{-182}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 6.5 \cdot 10^{-131}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 5.5 \cdot 10^{-120}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -6.79999999999999984e57 or 5.5000000000000001e-120 < t

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in t around inf 70.1%

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

    if -6.79999999999999984e57 < t < -5.1999999999999998e-298 or 1.2800000000000001e-182 < t < 6.5000000000000002e-131

    1. Initial program 97.9%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in x around inf 64.2%

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

    if -5.1999999999999998e-298 < t < 1.2800000000000001e-182 or 6.5000000000000002e-131 < t < 5.5000000000000001e-120

    1. Initial program 97.3%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative97.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
      11. fma-def97.4%

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub097.4%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-97.4%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg97.4%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-197.4%

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*97.4%

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

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity97.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-y\right) \cdot z}{t - a}} \]
    7. Step-by-step derivation
      1. frac-2neg63.0%

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

        \[\leadsto \color{blue}{\left(-\left(-y\right) \cdot z\right) \cdot \frac{1}{-\left(t - a\right)}} \]
      3. distribute-lft-neg-out62.9%

        \[\leadsto \left(-\color{blue}{\left(-y \cdot z\right)}\right) \cdot \frac{1}{-\left(t - a\right)} \]
      4. remove-double-neg62.9%

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{z \cdot 1}{-\left(t - a\right)}} \]
      3. *-rgt-identity71.2%

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

        \[\leadsto y \cdot \frac{z}{\color{blue}{0 - \left(t - a\right)}} \]
      5. associate--r-71.2%

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

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

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

        \[\leadsto y \cdot \frac{z}{\color{blue}{a - t}} \]
    10. Simplified71.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.8 \cdot 10^{+57}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -5.2 \cdot 10^{-298}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.28 \cdot 10^{-182}:\\ \;\;\;\;y \cdot \frac{z}{a - t}\\ \mathbf{elif}\;t \leq 6.5 \cdot 10^{-131}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-120}:\\ \;\;\;\;y \cdot \frac{z}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 3: 77.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.7 \cdot 10^{+94}:\\
\;\;\;\;x + y\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.7000000000000001e94 or 1.55000000000000002e105 < t

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in t around inf 77.2%

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

    if -3.7000000000000001e94 < t < -7.0000000000000002e-59

    1. Initial program 97.2%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative97.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub099.9%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-99.9%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg99.9%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-199.9%

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*99.9%

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

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity99.9%

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{t - z}}} \]
    6. Simplified75.0%

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

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

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

        \[\leadsto x + \frac{\color{blue}{-y \cdot z}}{t} \]
      3. distribute-rgt-neg-in77.8%

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

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

        \[\leadsto x + \color{blue}{\left(-z\right) \cdot \frac{y}{t}} \]
      6. distribute-lft-neg-out77.9%

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

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

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

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

        \[\leadsto x + z \cdot \color{blue}{\frac{1 \cdot y}{-1 \cdot t}} \]
      11. *-lft-identity77.9%

        \[\leadsto x + z \cdot \frac{\color{blue}{y}}{-1 \cdot t} \]
      12. neg-mul-177.9%

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

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

    if -7.0000000000000002e-59 < t < 1.55000000000000002e105

    1. Initial program 98.6%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in a around inf 85.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.7 \cdot 10^{+94}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -7 \cdot 10^{-59}:\\ \;\;\;\;x + z \cdot \frac{y}{-t}\\ \mathbf{elif}\;t \leq 1.55 \cdot 10^{+105}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 4: 76.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{+100}:\\
\;\;\;\;x + y\\

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

\mathbf{elif}\;t \leq 2.2 \cdot 10^{+105}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.7999999999999998e100 or 2.20000000000000007e105 < t

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in t around inf 77.2%

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

    if -2.7999999999999998e100 < t < -7.0000000000000002e-59

    1. Initial program 97.2%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative97.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub099.9%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-99.9%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg99.9%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-199.9%

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*99.9%

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

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity99.9%

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{t - z}}} \]
    6. Simplified75.0%

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

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

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

        \[\leadsto x + \frac{\color{blue}{-y \cdot z}}{t} \]
      3. distribute-rgt-neg-in77.8%

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

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

        \[\leadsto x + \color{blue}{\left(-z\right) \cdot \frac{y}{t}} \]
      6. distribute-lft-neg-out77.9%

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

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

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

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

        \[\leadsto x + z \cdot \color{blue}{\frac{1 \cdot y}{-1 \cdot t}} \]
      11. *-lft-identity77.9%

        \[\leadsto x + z \cdot \frac{\color{blue}{y}}{-1 \cdot t} \]
      12. neg-mul-177.9%

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

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

    if -7.0000000000000002e-59 < t < 2.20000000000000007e105

    1. Initial program 98.6%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in t around 0 83.2%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.8 \cdot 10^{+100}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -7 \cdot 10^{-59}:\\ \;\;\;\;x + z \cdot \frac{y}{-t}\\ \mathbf{elif}\;t \leq 2.2 \cdot 10^{+105}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 5: 82.2% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.60000000000000007e35 or 1.7e11 < a

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in a around inf 90.5%

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

    if -2.60000000000000007e35 < a < 1.7e11

    1. Initial program 97.5%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative97.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
      11. fma-def96.0%

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub096.0%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-96.0%

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-196.0%

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*96.0%

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

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity96.0%

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{t - z}}} \]
    6. Simplified81.4%

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

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

Alternative 6: 81.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{-65} \lor \neg \left(t \leq 7.8 \cdot 10^{+28}\right):\\
\;\;\;\;x - t \cdot \frac{y}{a - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.10000000000000016e-65 or 7.7999999999999997e28 < t

    1. Initial program 99.2%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. associate-*r/81.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x + -1 \cdot \frac{y \cdot t}{a - t}} \]
      2. mul-1-neg72.4%

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a - t}{t}}} \]
      5. remove-double-neg86.8%

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

        \[\leadsto x - \color{blue}{\left(-\frac{-y}{\frac{a - t}{t}}\right)} \]
      7. distribute-neg-frac86.8%

        \[\leadsto x - \left(-\color{blue}{\left(-\frac{y}{\frac{a - t}{t}}\right)}\right) \]
      8. associate-/l*72.4%

        \[\leadsto x - \left(-\left(-\color{blue}{\frac{y \cdot t}{a - t}}\right)\right) \]
      9. distribute-neg-frac72.4%

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

        \[\leadsto x - \left(-\frac{-\color{blue}{t \cdot y}}{a - t}\right) \]
      11. distribute-lft-neg-out72.4%

        \[\leadsto x - \left(-\frac{\color{blue}{\left(-t\right) \cdot y}}{a - t}\right) \]
      12. associate-*r/85.2%

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

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

        \[\leadsto x - \left(-\color{blue}{t \cdot \left(-\frac{y}{a - t}\right)}\right) \]
      15. distribute-frac-neg85.2%

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

        \[\leadsto x - \color{blue}{t \cdot \left(-\frac{-y}{a - t}\right)} \]
      17. distribute-frac-neg85.2%

        \[\leadsto x - t \cdot \color{blue}{\frac{-\left(-y\right)}{a - t}} \]
      18. remove-double-neg85.2%

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

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

    if -3.10000000000000016e-65 < t < 7.7999999999999997e28

    1. Initial program 98.4%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in a around inf 88.1%

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

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

Alternative 7: 82.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.7 \cdot 10^{-59} \lor \neg \left(t \leq 10^{+29}\right):\\
\;\;\;\;x - \frac{y}{\frac{a}{t} + -1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.6999999999999999e-59 or 9.99999999999999914e28 < t

    1. Initial program 99.2%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in z around 0 72.4%

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

        \[\leadsto \color{blue}{x + -1 \cdot \frac{y \cdot t}{a - t}} \]
      2. mul-1-neg72.4%

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a - t}{t}}} \]
      5. div-sub86.8%

        \[\leadsto x - \frac{y}{\color{blue}{\frac{a}{t} - \frac{t}{t}}} \]
      6. *-inverses86.8%

        \[\leadsto x - \frac{y}{\frac{a}{t} - \color{blue}{1}} \]
    4. Simplified86.8%

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

    if -3.6999999999999999e-59 < t < 9.99999999999999914e28

    1. Initial program 98.4%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in a around inf 88.1%

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

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

Alternative 8: 76.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+57}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;t \leq 8 \cdot 10^{+104}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.9999999999999995e57 or 8e104 < t

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in t around inf 75.5%

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

    if -6.9999999999999995e57 < t < 8e104

    1. Initial program 98.3%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in t around 0 81.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7 \cdot 10^{+57}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 8 \cdot 10^{+104}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 9: 76.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.3 \cdot 10^{+59}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;t \leq 1.1 \cdot 10^{+106}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.3e59 or 1.09999999999999996e106 < t

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in t around inf 75.5%

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

    if -6.3e59 < t < 1.09999999999999996e106

    1. Initial program 98.3%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in t around 0 79.9%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}}} + x \]
    4. Simplified81.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.3 \cdot 10^{+59}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{+106}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 10: 63.7% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+58}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;t \leq 1.2 \cdot 10^{-72}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.59999999999999988e58 or 1.2e-72 < t

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in t around inf 71.9%

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

    if -2.59999999999999988e58 < t < 1.2e-72

    1. Initial program 97.8%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in x around inf 53.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.6 \cdot 10^{+58}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{-72}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 11: 52.2% accurate, 3.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{+126}:\\
\;\;\;\;y\\

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


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

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative99.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{-1} \cdot \frac{y}{t - a}} + x \]
      11. fma-def99.8%

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-t\right) + z}}{-1}, \frac{y}{t - a}, x\right) \]
      14. neg-sub099.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(0 - t\right)} + z}{-1}, \frac{y}{t - a}, x\right) \]
      15. associate-+l-99.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0 - \left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      16. sub0-neg99.8%

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{-\left(t - z\right)}}{-1}, \frac{y}{t - a}, x\right) \]
      17. neg-mul-199.8%

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(t - z\right) \cdot -1}}{-1}, \frac{y}{t - a}, x\right) \]
      19. associate-/l*99.8%

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

        \[\leadsto \mathsf{fma}\left(\frac{t - z}{\color{blue}{1}}, \frac{y}{t - a}, x\right) \]
      21. /-rgt-identity99.8%

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(t - z\right)}{t} + x} \]
    5. Step-by-step derivation
      1. +-commutative46.3%

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{t - z}}} \]
    6. Simplified58.6%

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

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

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

    if -9.49999999999999951e126 < y

    1. Initial program 98.7%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in x around inf 58.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.5 \cdot 10^{+126}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 12: 51.0% 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 98.8%

    \[x + y \cdot \frac{z - t}{a - t} \]
  2. Taylor expanded in x around inf 52.4%

    \[\leadsto \color{blue}{x} \]
  3. Final simplification52.4%

    \[\leadsto x \]

Developer target: 99.4% accurate, 0.6× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}

Reproduce

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

  :herbie-target
  (if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))

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