Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F

Percentage Accurate: 93.2% → 97.3%
Time: 9.1s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 93.2% accurate, 1.0× speedup?

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

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

Alternative 1: 97.3% accurate, 1.0× speedup?

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

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

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

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

    \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
  4. Add Preprocessing
  5. Taylor expanded in y around 0 93.2%

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

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

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

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

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

Alternative 2: 48.5% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq 4.2 \cdot 10^{-215}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.16 \cdot 10^{-140}:\\
\;\;\;\;y \cdot \frac{t}{a}\\

\mathbf{elif}\;z \leq 1.25:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.69999999999999978e149 or 1.25 < z

    1. Initial program 89.1%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 60.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{a}} \]
    6. Step-by-step derivation
      1. mul-1-neg60.3%

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

        \[\leadsto -\color{blue}{y \cdot \frac{z}{a}} \]
      3. distribute-rgt-neg-in61.2%

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

        \[\leadsto y \cdot \color{blue}{\frac{z}{-a}} \]
    7. Simplified61.2%

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

    if -3.69999999999999978e149 < z < 4.2e-215 or 1.16e-140 < z < 1.25

    1. Initial program 95.3%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 55.7%

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

    if 4.2e-215 < z < 1.16e-140

    1. Initial program 100.0%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 67.6%

      \[\leadsto \color{blue}{\frac{t \cdot y}{a}} \]
    6. Step-by-step derivation
      1. *-commutative67.6%

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

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

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

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

Alternative 3: 49.6% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq 9 \cdot 10^{-213}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 1.6:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.5999999999999998e149

    1. Initial program 95.0%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 73.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{a}} \]
    6. Step-by-step derivation
      1. mul-1-neg73.5%

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

        \[\leadsto -\color{blue}{y \cdot \frac{z}{a}} \]
      3. distribute-rgt-neg-in73.6%

        \[\leadsto \color{blue}{y \cdot \left(-\frac{z}{a}\right)} \]
      4. distribute-neg-frac273.6%

        \[\leadsto y \cdot \color{blue}{\frac{z}{-a}} \]
    7. Simplified73.6%

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

    if -5.5999999999999998e149 < z < 9.0000000000000002e-213 or 1.3e-142 < z < 1.6000000000000001

    1. Initial program 95.3%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 55.7%

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

    if 9.0000000000000002e-213 < z < 1.3e-142

    1. Initial program 100.0%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 67.6%

      \[\leadsto \color{blue}{\frac{t \cdot y}{a}} \]
    6. Step-by-step derivation
      1. *-commutative67.6%

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

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

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

    if 1.6000000000000001 < z

    1. Initial program 85.3%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 85.3%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{a}} \]
    9. Step-by-step derivation
      1. mul-1-neg51.9%

        \[\leadsto \color{blue}{-\frac{y \cdot z}{a}} \]
      2. distribute-neg-frac251.9%

        \[\leadsto \color{blue}{\frac{y \cdot z}{-a}} \]
      3. *-commutative51.9%

        \[\leadsto \frac{\color{blue}{z \cdot y}}{-a} \]
      4. associate-*r/58.2%

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

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

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

Alternative 4: 48.5% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;x \leq -7 \cdot 10^{+67} \lor \neg \left(x \leq -1.7 \cdot 10^{-70}\right) \land x \leq 2.1 \cdot 10^{-109}:\\
\;\;\;\;t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.4499999999999999e94 or -7e67 < x < -1.69999999999999998e-70 or 2.09999999999999996e-109 < x

    1. Initial program 94.3%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 56.7%

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

    if -2.4499999999999999e94 < x < -7e67 or -1.69999999999999998e-70 < x < 2.09999999999999996e-109

    1. Initial program 90.9%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 42.8%

      \[\leadsto \color{blue}{\frac{t \cdot y}{a}} \]
    6. Step-by-step derivation
      1. *-commutative42.8%

        \[\leadsto \frac{\color{blue}{y \cdot t}}{a} \]
    7. Simplified42.8%

      \[\leadsto \color{blue}{\frac{y \cdot t}{a}} \]
    8. Step-by-step derivation
      1. *-commutative42.8%

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
      3. *-commutative49.2%

        \[\leadsto \color{blue}{\frac{y}{a} \cdot t} \]
    9. Applied egg-rr49.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.45 \cdot 10^{+94}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -7 \cdot 10^{+67} \lor \neg \left(x \leq -1.7 \cdot 10^{-70}\right) \land x \leq 2.1 \cdot 10^{-109}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 83.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.1 \cdot 10^{-95} \lor \neg \left(t \leq 1.65 \cdot 10^{-25}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.0999999999999997e-95 or 1.6499999999999999e-25 < t

    1. Initial program 90.0%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 90.0%

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

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

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

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

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

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

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

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

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

    if -4.0999999999999997e-95 < t < 1.6499999999999999e-25

    1. Initial program 97.2%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 92.0%

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

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

Alternative 6: 72.5% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 95.0%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 73.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{a}} \]
    6. Step-by-step derivation
      1. mul-1-neg73.5%

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

        \[\leadsto -\color{blue}{y \cdot \frac{z}{a}} \]
      3. distribute-rgt-neg-in73.6%

        \[\leadsto \color{blue}{y \cdot \left(-\frac{z}{a}\right)} \]
      4. distribute-neg-frac273.6%

        \[\leadsto y \cdot \color{blue}{\frac{z}{-a}} \]
    7. Simplified73.6%

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

    if -2.09999999999999998e150 < z < 3e20

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}}{a}, x\right) \]
      10. remove-double-neg97.0%

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

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

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

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

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

    if 3e20 < z

    1. Initial program 83.7%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 83.7%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{a}} \]
    9. Step-by-step derivation
      1. mul-1-neg53.8%

        \[\leadsto \color{blue}{-\frac{y \cdot z}{a}} \]
      2. distribute-neg-frac253.8%

        \[\leadsto \color{blue}{\frac{y \cdot z}{-a}} \]
      3. *-commutative53.8%

        \[\leadsto \frac{\color{blue}{z \cdot y}}{-a} \]
      4. associate-*r/60.8%

        \[\leadsto \color{blue}{z \cdot \frac{y}{-a}} \]
    10. Simplified60.8%

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

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

Alternative 7: 74.0% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 95.0%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 73.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{a}} \]
    6. Step-by-step derivation
      1. mul-1-neg73.5%

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

        \[\leadsto -\color{blue}{y \cdot \frac{z}{a}} \]
      3. distribute-rgt-neg-in73.6%

        \[\leadsto \color{blue}{y \cdot \left(-\frac{z}{a}\right)} \]
      4. distribute-neg-frac273.6%

        \[\leadsto y \cdot \color{blue}{\frac{z}{-a}} \]
    7. Simplified73.6%

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

    if -1.15000000000000001e150 < z < 1.25000000000000009e173

    1. Initial program 93.1%

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

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

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

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

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

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

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

      \[\leadsto x - \color{blue}{-1 \cdot \frac{t \cdot y}{a}} \]
    9. Step-by-step derivation
      1. mul-1-neg76.3%

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

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

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

      \[\leadsto x - \color{blue}{t \cdot \frac{y}{-a}} \]
    11. Step-by-step derivation
      1. sub-neg79.2%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{t}{a}} + x \]
    12. Applied egg-rr77.7%

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

    if 1.25000000000000009e173 < z

    1. Initial program 90.2%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 90.2%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{a}} \]
    9. Step-by-step derivation
      1. mul-1-neg66.0%

        \[\leadsto \color{blue}{-\frac{y \cdot z}{a}} \]
      2. distribute-neg-frac266.0%

        \[\leadsto \color{blue}{\frac{y \cdot z}{-a}} \]
      3. *-commutative66.0%

        \[\leadsto \frac{\color{blue}{z \cdot y}}{-a} \]
      4. associate-*r/75.4%

        \[\leadsto \color{blue}{z \cdot \frac{y}{-a}} \]
    10. Simplified75.4%

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

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

Alternative 8: 81.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.1 \cdot 10^{-95}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\

\mathbf{elif}\;t \leq 4.3 \cdot 10^{-22}:\\
\;\;\;\;x - \frac{z \cdot y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.0999999999999997e-95

    1. Initial program 87.7%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 87.7%

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

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

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

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

      \[\leadsto x - \color{blue}{-1 \cdot \frac{t \cdot y}{a}} \]
    9. Step-by-step derivation
      1. mul-1-neg71.0%

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

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

        \[\leadsto x - \color{blue}{t \cdot \frac{y}{-a}} \]
    10. Simplified77.3%

      \[\leadsto x - \color{blue}{t \cdot \frac{y}{-a}} \]
    11. Step-by-step derivation
      1. sub-neg77.3%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{t}{a}} + x \]
    12. Applied egg-rr77.0%

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

    if -4.0999999999999997e-95 < t < 4.30000000000000037e-22

    1. Initial program 97.2%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 92.0%

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

    if 4.30000000000000037e-22 < t

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}}{a}, x\right) \]
      10. remove-double-neg92.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.1 \cdot 10^{-95}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;t \leq 4.3 \cdot 10^{-22}:\\ \;\;\;\;x - \frac{z \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t \cdot y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 48.2% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \leq 4.8 \cdot 10^{-110}:\\
\;\;\;\;y \cdot \frac{t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.6999999999999998e-70 or 4.80000000000000013e-110 < x

    1. Initial program 94.4%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 55.1%

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

    if -4.6999999999999998e-70 < x < 4.80000000000000013e-110

    1. Initial program 90.4%

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

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

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 40.4%

      \[\leadsto \color{blue}{\frac{t \cdot y}{a}} \]
    6. Step-by-step derivation
      1. *-commutative40.4%

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

        \[\leadsto \color{blue}{y \cdot \frac{t}{a}} \]
    7. Simplified46.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.7 \cdot 10^{-70}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{-110}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 92.8% accurate, 1.0× speedup?

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

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

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

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

    \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
  4. Add Preprocessing
  5. Final simplification95.1%

    \[\leadsto x + y \cdot \frac{t - z}{a} \]
  6. Add Preprocessing

Alternative 11: 39.7% accurate, 9.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 93.2%

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

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

    \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
  4. Add Preprocessing
  5. Taylor expanded in x around inf 41.2%

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

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 99.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{a}{z - t}\\
\mathbf{if}\;y < -1.0761266216389975 \cdot 10^{-10}:\\
\;\;\;\;x - \frac{1}{\frac{t\_1}{y}}\\

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

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024115 
(FPCore (x y z t a)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
  :precision binary64

  :alt
  (if (< y -1.0761266216389975e-10) (- x (/ 1.0 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (- x (/ (* y (- z t)) a)) (- x (/ y (/ a (- z t))))))

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