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

Percentage Accurate: 85.6% → 96.2%
Time: 8.9s
Alternatives: 10
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 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.6% accurate, 1.0× speedup?

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

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

Alternative 1: 96.2% accurate, 1.0× speedup?

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

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

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

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

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

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

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

Alternative 2: 78.6% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t \leq -6 \cdot 10^{+40}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -9.5 \cdot 10^{-9}:\\
\;\;\;\;x + y\\

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

\mathbf{elif}\;t \leq 2.6 \cdot 10^{+94}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.5200000000000001e240 or -6.0000000000000004e40 < t < -9.5000000000000007e-9 or 2.5999999999999999e94 < t

    1. Initial program 70.7%

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

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

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

      \[\leadsto \color{blue}{x + y} \]
    6. Step-by-step derivation
      1. +-commutative85.9%

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified85.9%

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

    if -1.5200000000000001e240 < t < -6.0000000000000004e40 or 3.79999999999999996e-123 < t < 2.5999999999999999e94

    1. Initial program 94.6%

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

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

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

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

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

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

    if -9.5000000000000007e-9 < t < 3.79999999999999996e-123

    1. Initial program 94.9%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{z \cdot \frac{y}{a}} \]
    7. Simplified94.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.52 \cdot 10^{+240}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -6 \cdot 10^{+40}:\\ \;\;\;\;x - y \cdot \frac{z}{t - a}\\ \mathbf{elif}\;t \leq -9.5 \cdot 10^{-9}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{-123}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{+94}:\\ \;\;\;\;x - y \cdot \frac{z}{t - a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 76.9% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;t \leq -1.5 \cdot 10^{-7} \lor \neg \left(t \leq 1.95 \cdot 10^{+67}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.6000000000000001e122 or -2.20000000000000006e38 < t < -1.4999999999999999e-7 or 1.95000000000000003e67 < t

    1. Initial program 76.0%

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

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

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

      \[\leadsto \color{blue}{x + y} \]
    6. Step-by-step derivation
      1. +-commutative84.8%

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified84.8%

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

    if -4.6000000000000001e122 < t < -2.20000000000000006e38

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{y \cdot \frac{z}{t}} \]
    10. Simplified80.4%

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

    if -1.4999999999999999e-7 < t < 1.95000000000000003e67

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.6 \cdot 10^{+122}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -2.2 \cdot 10^{+38}:\\ \;\;\;\;x - y \cdot \frac{z}{t}\\ \mathbf{elif}\;t \leq -1.5 \cdot 10^{-7} \lor \neg \left(t \leq 1.95 \cdot 10^{+67}\right):\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 63.2% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t \leq 2 \cdot 10^{-257}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;t \leq 4.4 \cdot 10^{-82}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -6.8999999999999999e-19 or 4.39999999999999971e-82 < t

    1. Initial program 82.2%

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

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

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

      \[\leadsto \color{blue}{x + y} \]
    6. Step-by-step derivation
      1. +-commutative76.7%

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified76.7%

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

    if -6.8999999999999999e-19 < t < 2e-257 or 2.99999999999999986e-213 < t < 4.39999999999999971e-82

    1. Initial program 96.2%

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

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

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

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

    if 2e-257 < t < 2.99999999999999986e-213

    1. Initial program 83.7%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{a}} + x \]
    7. Simplified83.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.9 \cdot 10^{-19}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 2 \cdot 10^{-257}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 3 \cdot 10^{-213}:\\ \;\;\;\;z \cdot \frac{y}{a}\\ \mathbf{elif}\;t \leq 4.4 \cdot 10^{-82}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 87.4% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.5e22 or 1.09999999999999997e-35 < z

    1. Initial program 87.3%

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

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

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

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

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

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

    if -1.5e22 < z < 1.09999999999999997e-35

    1. Initial program 87.7%

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

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

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

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

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

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

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

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

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

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

Alternative 6: 87.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{-7} \lor \neg \left(t \leq 8.6 \cdot 10^{+79}\right):\\
\;\;\;\;x - y \cdot \left(\frac{z}{t} + -1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.9999999999999997e-7 or 8.6000000000000006e79 < t

    1. Initial program 77.7%

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{y \cdot \frac{z - t}{t}} \]
      4. div-sub87.7%

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

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

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

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

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

    if -5.9999999999999997e-7 < t < 8.6000000000000006e79

    1. Initial program 95.4%

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

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

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

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

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

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

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

Alternative 7: 76.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{-12} \lor \neg \left(t \leq 1.9 \cdot 10^{+67}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.79999999999999974e-12 or 1.9000000000000001e67 < t

    1. Initial program 78.3%

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

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

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

      \[\leadsto \color{blue}{x + y} \]
    6. Step-by-step derivation
      1. +-commutative80.2%

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified80.2%

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

    if -4.79999999999999974e-12 < t < 1.9000000000000001e67

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

Alternative 8: 63.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.3 \cdot 10^{-19} \lor \neg \left(t \leq 4 \cdot 10^{-82}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.29999999999999972e-19 or 4e-82 < t

    1. Initial program 82.2%

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

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

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

      \[\leadsto \color{blue}{x + y} \]
    6. Step-by-step derivation
      1. +-commutative76.7%

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified76.7%

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

    if -5.29999999999999972e-19 < t < 4e-82

    1. Initial program 95.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.3 \cdot 10^{-19} \lor \neg \left(t \leq 4 \cdot 10^{-82}\right):\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 98.2% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 10: 50.7% 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 87.5%

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Add Preprocessing

Developer target: 98.2% accurate, 1.0× speedup?

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

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

Reproduce

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

  :alt
  (+ x (/ y (/ (- a t) (- z t))))

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