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

Percentage Accurate: 85.4% → 97.9%
Time: 12.9s
Alternatives: 13
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 85.4% accurate, 1.0× speedup?

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

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

Alternative 1: 97.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x + \frac{y \cdot \left(z - t\right)}{z - a} \leq -4 \cdot 10^{+198}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))) < -4.00000000000000007e198

    1. Initial program 70.2%

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

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

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

    if -4.00000000000000007e198 < (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)))

    1. Initial program 90.4%

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

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

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

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

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

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

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

Alternative 2: 80.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{-99}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\

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

\mathbf{elif}\;z \leq 1.1 \cdot 10^{-67} \lor \neg \left(z \leq 2.7 \cdot 10^{+112}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.5499999999999999e-99

    1. Initial program 77.4%

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

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

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

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

    if -1.5499999999999999e-99 < z < 6.00000000000000017e-127

    1. Initial program 93.9%

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

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

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

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

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

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

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

    if 6.00000000000000017e-127 < z < 1.1000000000000001e-67 or 2.7000000000000001e112 < z

    1. Initial program 81.7%

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

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

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

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

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

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

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

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

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

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

    if 1.1000000000000001e-67 < z < 2.7000000000000001e112

    1. Initial program 92.3%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{-99}:\\ \;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-127}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-67} \lor \neg \left(z \leq 2.7 \cdot 10^{+112}\right):\\ \;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \frac{y}{z - a}\\ \end{array} \]

Alternative 3: 76.2% accurate, 0.8× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.5e44 or 8.00000000000000047e136 < z

    1. Initial program 67.8%

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

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

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

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

    if -8.5e44 < z < 3.8000000000000002e-128

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

    if 3.8000000000000002e-128 < z < 8.00000000000000047e136

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{t \cdot \frac{y}{z}} \]
    11. Simplified74.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{+44}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-128}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 8 \cdot 10^{+136}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 4: 76.2% accurate, 0.8× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.2000000000000001e48 or 1.85000000000000005e132 < z

    1. Initial program 67.8%

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

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

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

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

    if -1.2000000000000001e48 < z < 3.9500000000000001e-128

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

    if 3.9500000000000001e-128 < z < 1.85000000000000005e132

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+48}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 3.95 \cdot 10^{-128}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{+132}:\\ \;\;\;\;x - \frac{y \cdot t}{z}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 5: 81.2% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.89999999999999983e-66 or 3.70000000000000015e-123 < z

    1. Initial program 81.2%

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

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

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

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

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

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

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

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

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

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

    if -3.89999999999999983e-66 < z < 3.70000000000000015e-123

    1. Initial program 94.4%

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

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

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

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

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

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

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

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

Alternative 6: 87.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+20} \lor \neg \left(z \leq 2.1 \cdot 10^{+109}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.9e20 or 2.1000000000000001e109 < z

    1. Initial program 71.1%

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

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

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

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

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

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

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

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

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

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

    if -2.9e20 < z < 2.1000000000000001e109

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 80.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.14 \cdot 10^{-97}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.14e-97

    1. Initial program 77.4%

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

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

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

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

    if -1.14e-97 < z < 2.2499999999999998e-124

    1. Initial program 93.9%

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

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

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

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

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

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

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

    if 2.2499999999999998e-124 < z

    1. Initial program 86.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.14 \cdot 10^{-97}:\\ \;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 2.25 \cdot 10^{-124}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\ \end{array} \]

Alternative 8: 75.7% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.75000000000000011e45 or 6.0000000000000002e-113 < z

    1. Initial program 78.2%

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

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

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

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

    if -1.75000000000000011e45 < z < 6.0000000000000002e-113

    1. Initial program 95.6%

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{t}{a}} \]
    9. Simplified82.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.75 \cdot 10^{+45}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-113}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 9: 74.9% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 66.0%

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

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

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

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

    if -3.6999999999999999e48 < z < 2.5000000000000001e-115

    1. Initial program 95.6%

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{t}{a}} \]
    9. Simplified82.2%

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

    if 2.5000000000000001e-115 < z

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+48}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-115}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \frac{y}{z}\\ \end{array} \]

Alternative 10: 75.4% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 66.0%

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

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

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

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

    if -6.8000000000000006e48 < z < 5.5000000000000003e-90

    1. Initial program 95.7%

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

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

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

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

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

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

    if 5.5000000000000003e-90 < z

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.8 \cdot 10^{+48}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-90}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \frac{y}{z}\\ \end{array} \]

Alternative 11: 98.2% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

Alternative 12: 63.1% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;a \leq 1.22 \cdot 10^{+113}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.25000000000000005e92 or 1.2199999999999999e113 < a

    1. Initial program 84.7%

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

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

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

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

    if -1.25000000000000005e92 < a < 1.2199999999999999e113

    1. Initial program 86.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.25 \cdot 10^{+92}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.22 \cdot 10^{+113}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

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

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

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

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

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

    \[\leadsto x \]

Developer target: 98.2% accurate, 1.0× speedup?

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

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

Reproduce

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

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

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