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

Percentage Accurate: 85.2% → 98.3%
Time: 8.2s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

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

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

Alternative 1: 98.3% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 2: 75.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - \frac{z}{\frac{t}{y}}\\ \mathbf{if}\;t \leq -2.1 \cdot 10^{+136}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -6.8 \cdot 10^{-44}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -2.1 \cdot 10^{-111}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \mathbf{elif}\;t \leq -2.2 \cdot 10^{-174}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -4.5 \cdot 10^{-272}:\\ \;\;\;\;x + \frac{y \cdot z}{a}\\ \mathbf{elif}\;t \leq 1.36 \cdot 10^{-34}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (/ z (/ t y)))))
   (if (<= t -2.1e+136)
     (+ x y)
     (if (<= t -6.8e-44)
       t_1
       (if (<= t -2.1e-111)
         (+ x (* y (/ z a)))
         (if (<= t -2.2e-174)
           t_1
           (if (<= t -4.5e-272)
             (+ x (/ (* y z) a))
             (if (<= t 1.36e-34) (+ x (/ y (/ a z))) (+ x y)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (z / (t / y));
	double tmp;
	if (t <= -2.1e+136) {
		tmp = x + y;
	} else if (t <= -6.8e-44) {
		tmp = t_1;
	} else if (t <= -2.1e-111) {
		tmp = x + (y * (z / a));
	} else if (t <= -2.2e-174) {
		tmp = t_1;
	} else if (t <= -4.5e-272) {
		tmp = x + ((y * z) / a);
	} else if (t <= 1.36e-34) {
		tmp = x + (y / (a / z));
	} 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 - (z / (t / y))
    if (t <= (-2.1d+136)) then
        tmp = x + y
    else if (t <= (-6.8d-44)) then
        tmp = t_1
    else if (t <= (-2.1d-111)) then
        tmp = x + (y * (z / a))
    else if (t <= (-2.2d-174)) then
        tmp = t_1
    else if (t <= (-4.5d-272)) then
        tmp = x + ((y * z) / a)
    else if (t <= 1.36d-34) then
        tmp = x + (y / (a / z))
    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 - (z / (t / y));
	double tmp;
	if (t <= -2.1e+136) {
		tmp = x + y;
	} else if (t <= -6.8e-44) {
		tmp = t_1;
	} else if (t <= -2.1e-111) {
		tmp = x + (y * (z / a));
	} else if (t <= -2.2e-174) {
		tmp = t_1;
	} else if (t <= -4.5e-272) {
		tmp = x + ((y * z) / a);
	} else if (t <= 1.36e-34) {
		tmp = x + (y / (a / z));
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - (z / (t / y))
	tmp = 0
	if t <= -2.1e+136:
		tmp = x + y
	elif t <= -6.8e-44:
		tmp = t_1
	elif t <= -2.1e-111:
		tmp = x + (y * (z / a))
	elif t <= -2.2e-174:
		tmp = t_1
	elif t <= -4.5e-272:
		tmp = x + ((y * z) / a)
	elif t <= 1.36e-34:
		tmp = x + (y / (a / z))
	else:
		tmp = x + y
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(z / Float64(t / y)))
	tmp = 0.0
	if (t <= -2.1e+136)
		tmp = Float64(x + y);
	elseif (t <= -6.8e-44)
		tmp = t_1;
	elseif (t <= -2.1e-111)
		tmp = Float64(x + Float64(y * Float64(z / a)));
	elseif (t <= -2.2e-174)
		tmp = t_1;
	elseif (t <= -4.5e-272)
		tmp = Float64(x + Float64(Float64(y * z) / a));
	elseif (t <= 1.36e-34)
		tmp = Float64(x + Float64(y / Float64(a / z)));
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x - (z / (t / y));
	tmp = 0.0;
	if (t <= -2.1e+136)
		tmp = x + y;
	elseif (t <= -6.8e-44)
		tmp = t_1;
	elseif (t <= -2.1e-111)
		tmp = x + (y * (z / a));
	elseif (t <= -2.2e-174)
		tmp = t_1;
	elseif (t <= -4.5e-272)
		tmp = x + ((y * z) / a);
	elseif (t <= 1.36e-34)
		tmp = x + (y / (a / z));
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.1e+136], N[(x + y), $MachinePrecision], If[LessEqual[t, -6.8e-44], t$95$1, If[LessEqual[t, -2.1e-111], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.2e-174], t$95$1, If[LessEqual[t, -4.5e-272], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.36e-34], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -6.8 \cdot 10^{-44}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq -2.2 \cdot 10^{-174}:\\
\;\;\;\;t_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -2.0999999999999999e136 or 1.3600000000000001e-34 < t

    1. Initial program 74.7%

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

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

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

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

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

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

    if -2.0999999999999999e136 < t < -6.80000000000000033e-44 or -2.0999999999999999e-111 < t < -2.20000000000000022e-174

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x + -1 \cdot \frac{y \cdot z}{t}} \]
      2. mul-1-neg77.0%

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

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

        \[\leadsto x - \color{blue}{\frac{y}{t} \cdot z} \]
      5. *-commutative78.7%

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

      \[\leadsto \color{blue}{x - z \cdot \frac{y}{t}} \]
    10. Step-by-step derivation
      1. clear-num78.7%

        \[\leadsto x - z \cdot \color{blue}{\frac{1}{\frac{t}{y}}} \]
      2. un-div-inv80.5%

        \[\leadsto x - \color{blue}{\frac{z}{\frac{t}{y}}} \]
    11. Applied egg-rr80.5%

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

    if -6.80000000000000033e-44 < t < -2.0999999999999999e-111

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

    if -2.20000000000000022e-174 < t < -4.4999999999999998e-272

    1. Initial program 98.8%

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

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

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

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

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

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

    if -4.4999999999999998e-272 < t < 1.3600000000000001e-34

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.1 \cdot 10^{+136}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -6.8 \cdot 10^{-44}:\\ \;\;\;\;x - \frac{z}{\frac{t}{y}}\\ \mathbf{elif}\;t \leq -2.1 \cdot 10^{-111}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \mathbf{elif}\;t \leq -2.2 \cdot 10^{-174}:\\ \;\;\;\;x - \frac{z}{\frac{t}{y}}\\ \mathbf{elif}\;t \leq -4.5 \cdot 10^{-272}:\\ \;\;\;\;x + \frac{y \cdot z}{a}\\ \mathbf{elif}\;t \leq 1.36 \cdot 10^{-34}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 3: 77.2% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;t \leq -1.3 \cdot 10^{-43}:\\
\;\;\;\;x - z \cdot \frac{y}{t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.39999999999999997e136 or 1.06000000000000006e-34 < t

    1. Initial program 74.7%

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

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

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

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

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

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

    if -3.39999999999999997e136 < t < -1.3e-43

    1. Initial program 93.1%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t} + x} \]
    8. Step-by-step derivation
      1. +-commutative74.0%

        \[\leadsto \color{blue}{x + -1 \cdot \frac{y \cdot z}{t}} \]
      2. mul-1-neg74.0%

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

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

        \[\leadsto x - \color{blue}{\frac{y}{t} \cdot z} \]
      5. *-commutative78.5%

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

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

    if -1.3e-43 < t < 1.06000000000000006e-34

    1. Initial program 95.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}}} + x \]
    6. Simplified76.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.4 \cdot 10^{+136}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -1.3 \cdot 10^{-43}:\\ \;\;\;\;x - z \cdot \frac{y}{t}\\ \mathbf{elif}\;t \leq 1.06 \cdot 10^{-34}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 4: 83.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.6 \cdot 10^{+137} \lor \neg \left(t \leq 1.15 \cdot 10^{-9}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.59999999999999999e137 or 1.15e-9 < t

    1. Initial program 72.8%

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

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

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

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

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

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

    if -4.59999999999999999e137 < t < 1.15e-9

    1. Initial program 95.1%

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

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

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

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

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

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

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

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

Alternative 5: 87.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.05 \cdot 10^{+40} \lor \neg \left(t \leq 9.5 \cdot 10^{-36}\right):\\
\;\;\;\;x + \left(y - z \cdot \frac{y}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.0500000000000001e40 or 9.5000000000000003e-36 < t

    1. Initial program 77.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0500000000000001e40 < t < 9.5000000000000003e-36

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

Alternative 6: 88.0% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.42e20 or 7.5999999999999999e-31 < z

    1. Initial program 85.4%

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

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

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

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

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

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

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

    if -1.42e20 < z < 7.5999999999999999e-31

    1. Initial program 85.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{y}{\color{blue}{\frac{a}{t} - \frac{t}{t}}} \]
      6. sub-neg91.2%

        \[\leadsto x - \frac{y}{\color{blue}{\frac{a}{t} + \left(-\frac{t}{t}\right)}} \]
      7. *-inverses91.2%

        \[\leadsto x - \frac{y}{\frac{a}{t} + \left(-\color{blue}{1}\right)} \]
      8. metadata-eval91.2%

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

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

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

Alternative 7: 77.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{+39} \lor \neg \left(t \leq 1.45 \cdot 10^{-36}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9.50000000000000011e39 or 1.45000000000000006e-36 < t

    1. Initial program 77.1%

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

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

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

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

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

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

    if -9.50000000000000011e39 < t < 1.45000000000000006e-36

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

Alternative 8: 78.0% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.35e42 or 1.55999999999999992e-34 < t

    1. Initial program 77.1%

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

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

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

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

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

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

    if -1.35e42 < t < 1.55999999999999992e-34

    1. Initial program 95.5%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}}} + x \]
    6. Simplified74.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.35 \cdot 10^{+42}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 1.56 \cdot 10^{-34}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 9: 96.0% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 10: 61.8% accurate, 3.7× speedup?

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

\\
x + y
\end{array}
Derivation
  1. Initial program 85.5%

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

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

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

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

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

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

    \[\leadsto x + y \]

Alternative 11: 51.9% accurate, 11.0× speedup?

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification48.5%

    \[\leadsto x \]

Developer target: 98.3% accurate, 1.0× speedup?

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

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

Reproduce

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

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

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