Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, A

Percentage Accurate: 99.2% → 98.9%
Time: 12.0s
Alternatives: 15
Speedup: 1.0×

Specification

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

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

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

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

Alternative 1: 98.9% accurate, 0.0× speedup?

\[\begin{array}{l} \\ 1 + \frac{{\left(\sqrt[3]{x}\right)}^{2}}{y - t} \cdot \frac{\sqrt[3]{x}}{z - y} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ 1.0 (* (/ (pow (cbrt x) 2.0) (- y t)) (/ (cbrt x) (- z y)))))
double code(double x, double y, double z, double t) {
	return 1.0 + ((pow(cbrt(x), 2.0) / (y - t)) * (cbrt(x) / (z - y)));
}
public static double code(double x, double y, double z, double t) {
	return 1.0 + ((Math.pow(Math.cbrt(x), 2.0) / (y - t)) * (Math.cbrt(x) / (z - y)));
}
function code(x, y, z, t)
	return Float64(1.0 + Float64(Float64((cbrt(x) ^ 2.0) / Float64(y - t)) * Float64(cbrt(x) / Float64(z - y))))
end
code[x_, y_, z_, t_] := N[(1.0 + N[(N[(N[Power[N[Power[x, 1/3], $MachinePrecision], 2.0], $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
1 + \frac{{\left(\sqrt[3]{x}\right)}^{2}}{y - t} \cdot \frac{\sqrt[3]{x}}{z - y}
\end{array}
Derivation
  1. Initial program 98.0%

    \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. add-cube-cbrt97.8%

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

      \[\leadsto 1 - \frac{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}{\color{blue}{\left(y - t\right) \cdot \left(y - z\right)}} \]
    3. times-frac99.3%

      \[\leadsto 1 - \color{blue}{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{y - t} \cdot \frac{\sqrt[3]{x}}{y - z}} \]
    4. pow299.3%

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

    \[\leadsto 1 - \color{blue}{\frac{{\left(\sqrt[3]{x}\right)}^{2}}{y - t} \cdot \frac{\sqrt[3]{x}}{y - z}} \]
  5. Final simplification99.3%

    \[\leadsto 1 + \frac{{\left(\sqrt[3]{x}\right)}^{2}}{y - t} \cdot \frac{\sqrt[3]{x}}{z - y} \]
  6. Add Preprocessing

Alternative 2: 85.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.58 \cdot 10^{-24} \lor \neg \left(y \leq 2.2 \cdot 10^{-55}\right):\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.5799999999999999e-24 or 2.2e-55 < y

    1. Initial program 100.0%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 96.4%

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

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

      \[\leadsto 1 - \color{blue}{\frac{\frac{x}{y}}{y - t}} \]
    6. Taylor expanded in y around inf 93.4%

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

    if -1.5799999999999999e-24 < y < 2.2e-55

    1. Initial program 95.2%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 82.0%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y - z}} + 1 \]
    5. Simplified82.4%

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

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

Alternative 3: 82.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq 6.5 \cdot 10^{-160}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\

\mathbf{elif}\;t \leq 4.9 \cdot 10^{-56}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\

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


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

    1. Initial program 97.0%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 79.5%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{y - t}} + 1 \]
    5. Simplified81.0%

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

    if 6.4999999999999996e-160 < t < 4.9e-56

    1. Initial program 99.9%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 81.2%

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

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

      \[\leadsto 1 - \color{blue}{\frac{\frac{x}{y}}{y - t}} \]
    6. Taylor expanded in y around inf 80.5%

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

    if 4.9e-56 < t

    1. Initial program 100.0%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 100.0%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y - z}} + 1 \]
    5. Simplified99.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 6.5 \cdot 10^{-160}:\\ \;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\ \mathbf{elif}\;t \leq 4.9 \cdot 10^{-56}:\\ \;\;\;\;1 - \frac{\frac{x}{y}}{y}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 81.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.58 \cdot 10^{-24} \lor \neg \left(y \leq 8.5 \cdot 10^{-59}\right):\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\

\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.5799999999999999e-24 or 8.49999999999999933e-59 < y

    1. Initial program 100.0%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 96.4%

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

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

      \[\leadsto 1 - \color{blue}{\frac{\frac{x}{y}}{y - t}} \]
    6. Taylor expanded in y around inf 93.4%

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

    if -1.5799999999999999e-24 < y < 8.49999999999999933e-59

    1. Initial program 95.2%

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

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

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

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

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

      \[\leadsto 1 - \color{blue}{{\left(\left(y - t\right) \cdot \frac{y - z}{x}\right)}^{-1}} \]
    5. Step-by-step derivation
      1. unpow-198.9%

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

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

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

      \[\leadsto 1 - \color{blue}{\frac{x}{t \cdot z}} \]
    9. Step-by-step derivation
      1. associate-/r*71.5%

        \[\leadsto 1 - \color{blue}{\frac{\frac{x}{t}}{z}} \]
    10. Simplified71.5%

      \[\leadsto 1 - \color{blue}{\frac{\frac{x}{t}}{z}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification84.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.58 \cdot 10^{-24} \lor \neg \left(y \leq 8.5 \cdot 10^{-59}\right):\\ \;\;\;\;1 - \frac{\frac{x}{y}}{y}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{\frac{x}{t}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 83.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{-131}:\\
\;\;\;\;1\\

\mathbf{elif}\;y \leq 3.9 \cdot 10^{-72}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.0000000000000004e-131 or 3.9e-72 < y

    1. Initial program 100.0%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 87.3%

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

    if -7.0000000000000004e-131 < y < 3.9e-72

    1. Initial program 94.1%

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

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

        \[\leadsto 1 - \color{blue}{{\left(\frac{\left(y - z\right) \cdot \left(y - t\right)}{x}\right)}^{-1}} \]
      3. *-commutative94.1%

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

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

      \[\leadsto 1 - \color{blue}{{\left(\left(y - t\right) \cdot \frac{y - z}{x}\right)}^{-1}} \]
    5. Step-by-step derivation
      1. unpow-198.7%

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

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

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

      \[\leadsto 1 - \color{blue}{\frac{x}{t \cdot z}} \]
    9. Step-by-step derivation
      1. associate-/r*74.1%

        \[\leadsto 1 - \color{blue}{\frac{\frac{x}{t}}{z}} \]
    10. Simplified74.1%

      \[\leadsto 1 - \color{blue}{\frac{\frac{x}{t}}{z}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 84.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{-129}:\\
\;\;\;\;1\\

\mathbf{elif}\;y \leq 4.5 \cdot 10^{-72}:\\
\;\;\;\;1 - \frac{x}{t \cdot z}\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.6000000000000001e-129 or 4.5e-72 < y

    1. Initial program 100.0%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 87.3%

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

    if -1.6000000000000001e-129 < y < 4.5e-72

    1. Initial program 94.1%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 74.4%

      \[\leadsto 1 - \color{blue}{\frac{x}{t \cdot z}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 7: 62.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+134}:\\
\;\;\;\;1\\

\mathbf{elif}\;z \leq -4.8 \cdot 10^{-166}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y}\\

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


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

    1. Initial program 100.0%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 91.6%

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

    if -3.3e134 < z < -4.7999999999999997e-166

    1. Initial program 96.8%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 83.8%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{y - t}} + 1 \]
    5. Simplified86.8%

      \[\leadsto \color{blue}{\frac{\frac{x}{z}}{y - t} + 1} \]
    6. Taylor expanded in y around inf 64.2%

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

    if -4.7999999999999997e-166 < z

    1. Initial program 98.1%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 79.7%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y - z}} + 1 \]
    5. Simplified79.9%

      \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y - z} + 1} \]
    6. Taylor expanded in y around inf 67.3%

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

        \[\leadsto \frac{x}{\color{blue}{y \cdot t}} + 1 \]
    8. Simplified67.3%

      \[\leadsto \color{blue}{\frac{x}{y \cdot t}} + 1 \]
    9. Taylor expanded in x around 0 67.3%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{t}} + 1 \]
    11. Simplified67.5%

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{t}} + 1 \]
  3. Recombined 3 regimes into one program.
  4. Final simplification70.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.3 \cdot 10^{+134}:\\ \;\;\;\;1\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{-166}:\\ \;\;\;\;1 + \frac{\frac{x}{z}}{y}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{\frac{x}{y}}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 62.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+138}:\\
\;\;\;\;1\\

\mathbf{elif}\;z \leq -4.5 \cdot 10^{-164}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\

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


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

    1. Initial program 100.0%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 91.6%

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

    if -1.1e138 < z < -4.4999999999999997e-164

    1. Initial program 96.8%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 83.8%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{y - t}} + 1 \]
    5. Simplified86.8%

      \[\leadsto \color{blue}{\frac{\frac{x}{z}}{y - t} + 1} \]
    6. Taylor expanded in y around inf 62.7%

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

    if -4.4999999999999997e-164 < z

    1. Initial program 98.1%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 79.7%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y - z}} + 1 \]
    5. Simplified79.9%

      \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y - z} + 1} \]
    6. Taylor expanded in y around inf 67.3%

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

        \[\leadsto \frac{x}{\color{blue}{y \cdot t}} + 1 \]
    8. Simplified67.3%

      \[\leadsto \color{blue}{\frac{x}{y \cdot t}} + 1 \]
    9. Taylor expanded in x around 0 67.3%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{t}} + 1 \]
    11. Simplified67.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.1 \cdot 10^{+138}:\\ \;\;\;\;1\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-164}:\\ \;\;\;\;1 + \frac{x}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{\frac{x}{y}}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 81.1% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-164}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.1999999999999998e-164

    1. Initial program 97.9%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 89.6%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{y - t}} + 1 \]
    5. Simplified91.5%

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

    if -4.1999999999999998e-164 < z

    1. Initial program 98.1%

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

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

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

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

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

      \[\leadsto 1 - \color{blue}{{\left(\left(y - t\right) \cdot \frac{y - z}{x}\right)}^{-1}} \]
    5. Step-by-step derivation
      1. unpow-199.9%

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

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

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

        \[\leadsto 1 - \frac{1}{\color{blue}{y \cdot \frac{y - t}{x}}} \]
    9. Simplified83.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{-164}:\\ \;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{1}{y \cdot \frac{t - y}{x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 80.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-164}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.4999999999999997e-164

    1. Initial program 97.9%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 89.6%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{y - t}} + 1 \]
    5. Simplified91.5%

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

    if -4.4999999999999997e-164 < z

    1. Initial program 98.1%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 82.6%

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

        \[\leadsto 1 - \color{blue}{\frac{\frac{x}{y}}{y - t}} \]
    5. Simplified83.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{-164}:\\ \;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{\frac{x}{y}}{t - y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 98.5% accurate, 0.8× speedup?

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

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

    \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. clear-num98.0%

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

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

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

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

    \[\leadsto 1 - \color{blue}{{\left(\left(y - t\right) \cdot \frac{y - z}{x}\right)}^{-1}} \]
  5. Step-by-step derivation
    1. unpow-199.5%

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

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

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

Alternative 12: 66.5% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq 6 \cdot 10^{-246}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 6e-246

    1. Initial program 97.3%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 81.6%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{y - t}} + 1 \]
    5. Simplified83.2%

      \[\leadsto \color{blue}{\frac{\frac{x}{z}}{y - t} + 1} \]
    6. Taylor expanded in y around inf 62.3%

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

    if 6e-246 < t

    1. Initial program 99.0%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 76.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 6 \cdot 10^{-246}:\\ \;\;\;\;1 + \frac{x}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 66.7% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{-92}:\\
\;\;\;\;1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.44999999999999992e-92

    1. Initial program 99.9%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 78.6%

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

    if -1.44999999999999992e-92 < z

    1. Initial program 97.1%

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 78.7%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y - z}} + 1 \]
    5. Simplified79.5%

      \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y - z} + 1} \]
    6. Taylor expanded in y around inf 65.2%

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} + 1 \]
    7. Step-by-step derivation
      1. *-commutative65.2%

        \[\leadsto \frac{x}{\color{blue}{y \cdot t}} + 1 \]
    8. Simplified65.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{-92}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{x}{y \cdot t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 99.2% accurate, 1.0× speedup?

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

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

    \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
  2. Add Preprocessing
  3. Final simplification98.0%

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

Alternative 15: 75.1% accurate, 11.0× speedup?

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

\\
1
\end{array}
Derivation
  1. Initial program 98.0%

    \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in x around 0 75.1%

    \[\leadsto \color{blue}{1} \]
  4. Add Preprocessing

Reproduce

?
herbie shell --seed 2024116 
(FPCore (x y z t)
  :name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, A"
  :precision binary64
  (- 1.0 (/ x (* (- y z) (- y t)))))