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

Percentage Accurate: 98.2% → 98.2%
Time: 10.3s
Alternatives: 12
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 98.2% accurate, 1.0× speedup?

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

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

Alternative 1: 98.2% accurate, 1.0× speedup?

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

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

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

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

Alternative 2: 60.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{z}{a}\\ \mathbf{if}\;z \leq -3.1 \cdot 10^{+189}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{-131}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-63}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{+247}:\\ \;\;\;\;x + y\\ \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.1e+189)
     t_1
     (if (<= z 3.4e-131)
       (+ x y)
       (if (<= z 9.5e-63) x (if (<= z 2.75e+247) (+ x y) 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.1e+189) {
		tmp = t_1;
	} else if (z <= 3.4e-131) {
		tmp = x + y;
	} else if (z <= 9.5e-63) {
		tmp = x;
	} else if (z <= 2.75e+247) {
		tmp = x + y;
	} 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.1d+189)) then
        tmp = t_1
    else if (z <= 3.4d-131) then
        tmp = x + y
    else if (z <= 9.5d-63) then
        tmp = x
    else if (z <= 2.75d+247) then
        tmp = x + y
    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.1e+189) {
		tmp = t_1;
	} else if (z <= 3.4e-131) {
		tmp = x + y;
	} else if (z <= 9.5e-63) {
		tmp = x;
	} else if (z <= 2.75e+247) {
		tmp = x + y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * (z / a)
	tmp = 0
	if z <= -3.1e+189:
		tmp = t_1
	elif z <= 3.4e-131:
		tmp = x + y
	elif z <= 9.5e-63:
		tmp = x
	elif z <= 2.75e+247:
		tmp = x + y
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(z / a))
	tmp = 0.0
	if (z <= -3.1e+189)
		tmp = t_1;
	elseif (z <= 3.4e-131)
		tmp = Float64(x + y);
	elseif (z <= 9.5e-63)
		tmp = x;
	elseif (z <= 2.75e+247)
		tmp = Float64(x + y);
	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.1e+189)
		tmp = t_1;
	elseif (z <= 3.4e-131)
		tmp = x + y;
	elseif (z <= 9.5e-63)
		tmp = x;
	elseif (z <= 2.75e+247)
		tmp = x + y;
	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.1e+189], t$95$1, If[LessEqual[z, 3.4e-131], N[(x + y), $MachinePrecision], If[LessEqual[z, 9.5e-63], x, If[LessEqual[z, 2.75e+247], N[(x + y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{a}\\
\mathbf{if}\;z \leq -3.1 \cdot 10^{+189}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 3.4 \cdot 10^{-131}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;z \leq 9.5 \cdot 10^{-63}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 2.75 \cdot 10^{+247}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.0999999999999999e189 or 2.7499999999999999e247 < z

    1. Initial program 93.5%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{a} \cdot z + x} \]
    5. Taylor expanded in y around 0 54.9%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{a}} \]
    8. Simplified56.9%

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

    if -3.0999999999999999e189 < z < 3.39999999999999995e-131 or 9.50000000000000016e-63 < z < 2.7499999999999999e247

    1. Initial program 99.4%

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

      \[\leadsto \color{blue}{x + y} \]
    3. Step-by-step derivation
      1. +-commutative70.3%

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified70.3%

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

    if 3.39999999999999995e-131 < z < 9.50000000000000016e-63

    1. Initial program 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+189}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{-131}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-63}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{+247}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \end{array} \]

Alternative 3: 60.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+188}:\\
\;\;\;\;z \cdot \frac{y}{a}\\

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

\mathbf{elif}\;z \leq 9.2 \cdot 10^{-63}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 7.8 \cdot 10^{+250}:\\
\;\;\;\;x + y\\

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


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

    1. Initial program 90.2%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{a} \cdot z + x} \]
    5. Taylor expanded in y around 0 61.6%

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{a}} \]
    7. Step-by-step derivation
      1. *-commutative46.1%

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

        \[\leadsto \color{blue}{z \cdot \frac{y}{a}} \]
    8. Simplified61.9%

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

    if -2.8999999999999999e188 < z < 8.20000000000000013e-132 or 9.2e-63 < z < 7.8e250

    1. Initial program 99.4%

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

      \[\leadsto \color{blue}{x + y} \]
    3. Step-by-step derivation
      1. +-commutative70.3%

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified70.3%

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

    if 8.20000000000000013e-132 < z < 9.2e-63

    1. Initial program 99.8%

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

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

    if 7.8e250 < z

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} + x \]
    4. Simplified54.0%

      \[\leadsto \color{blue}{\frac{y}{a} \cdot z + x} \]
    5. Taylor expanded in y around 0 41.7%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{a}} \]
    8. Simplified54.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.9 \cdot 10^{+188}:\\ \;\;\;\;z \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{-132}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{-63}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{+250}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \end{array} \]

Alternative 4: 78.8% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.8000000000000002e48 or 2500 < t

    1. Initial program 99.9%

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

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

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

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

    if -4.8000000000000002e48 < t < 2500

    1. Initial program 97.0%

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

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

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

Alternative 5: 83.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{+155} \lor \neg \left(t \leq 3000\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.00000000000000006e155 or 3e3 < t

    1. Initial program 99.9%

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

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

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

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

    if -8.00000000000000006e155 < t < 3e3

    1. Initial program 97.5%

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

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

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

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

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

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

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

Alternative 6: 87.3% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.4999999999999999e106 or 65200 < t

    1. Initial program 99.9%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{z - t}}} \]
      4. associate-/r/86.3%

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

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

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

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

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

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

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

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

    if -2.4999999999999999e106 < t < 65200

    1. Initial program 97.4%

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

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

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

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

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

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

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

Alternative 7: 86.8% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.4000000000000001e-26 or 3.3000000000000002e-108 < z

    1. Initial program 97.4%

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

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

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

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

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

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

    if -1.4000000000000001e-26 < z < 3.3000000000000002e-108

    1. Initial program 99.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y}{\frac{a - t}{t}}} \]
    5. Step-by-step derivation
      1. clear-num95.0%

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

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

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

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

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

Alternative 8: 86.8% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.5000000000000002e-27 or 2.1999999999999999e-109 < z

    1. Initial program 97.4%

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

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

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

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

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

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

    if -4.5000000000000002e-27 < z < 2.1999999999999999e-109

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

Alternative 9: 77.3% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.1499999999999999e47 or 2800 < t

    1. Initial program 99.9%

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

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

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

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

    if -1.1499999999999999e47 < t < 2800

    1. Initial program 97.0%

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

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

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

Alternative 10: 77.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.2 \cdot 10^{+49} \lor \neg \left(t \leq 1150\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 -2.2e+49) (not (<= t 1150.0))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -2.2e+49) || !(t <= 1150.0)) {
		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 <= (-2.2d+49)) .or. (.not. (t <= 1150.0d0))) 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 <= -2.2e+49) || !(t <= 1150.0)) {
		tmp = x + y;
	} else {
		tmp = x + (z * (y / a));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (t <= -2.2e+49) or not (t <= 1150.0):
		tmp = x + y
	else:
		tmp = x + (z * (y / a))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((t <= -2.2e+49) || !(t <= 1150.0))
		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 <= -2.2e+49) || ~((t <= 1150.0)))
		tmp = x + y;
	else
		tmp = x + (z * (y / a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.2e+49], N[Not[LessEqual[t, 1150.0]], $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 -2.2 \cdot 10^{+49} \lor \neg \left(t \leq 1150\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 < -2.2000000000000001e49 or 1150 < t

    1. Initial program 99.9%

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

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

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

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

    if -2.2000000000000001e49 < t < 1150

    1. Initial program 97.0%

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

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

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

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

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

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

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

Alternative 11: 60.9% accurate, 2.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.10000000000000005e115

    1. Initial program 99.9%

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

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

    if -3.10000000000000005e115 < a

    1. Initial program 98.0%

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

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

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified60.6%

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

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

Alternative 12: 49.6% accurate, 11.0× speedup?

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

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

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

    \[\leadsto \color{blue}{x} \]
  3. Final simplification49.7%

    \[\leadsto x \]

Developer target: 99.4% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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

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

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