Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, B

Percentage Accurate: 69.1% → 99.6%
Time: 8.8s
Alternatives: 10
Speedup: 3.0×

Specification

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

\\
x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 69.1% accurate, 1.0× speedup?

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

\\
x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}
\end{array}

Alternative 1: 99.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+22} \lor \neg \left(z \leq 2250000\right):\\
\;\;\;\;x + \frac{y}{14.431876219268936}\\

\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) + 0.279195317918525\right)}{z \cdot \left(z + 6.012459259764103\right) + 3.350343815022304} + x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.9999999999999996e22 or 2.25e6 < z

    1. Initial program 37.7%

      \[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \]
    2. Step-by-step derivation
      1. associate-/l*47.9%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}}} \]
      2. fma-def47.9%

        \[\leadsto x + \frac{y}{\frac{\color{blue}{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}} \]
      3. fma-def47.9%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\color{blue}{\mathsf{fma}\left(z \cdot 0.0692910599291889 + 0.4917317610505968, z, 0.279195317918525\right)}}} \]
      4. fma-def47.9%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right)}, z, 0.279195317918525\right)}} \]
    3. Simplified47.9%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), z, 0.279195317918525\right)}}} \]
    4. Taylor expanded in z around inf 99.9%

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

    if -4.9999999999999996e22 < z < 2.25e6

    1. Initial program 99.7%

      \[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+22} \lor \neg \left(z \leq 2250000\right):\\ \;\;\;\;x + \frac{y}{14.431876219268936}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot \left(z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) + 0.279195317918525\right)}{z \cdot \left(z + 6.012459259764103\right) + 3.350343815022304} + x\\ \end{array} \]

Alternative 2: 98.7% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) + 0.279195317918525\right)}{z \cdot \left(z + 6.012459259764103\right) + 3.350343815022304} \leq 10^{+301}:\\ \;\;\;\;x + \frac{y}{\mathsf{fma}\left(z, z + 6.012459259764103, 3.350343815022304\right)} \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{14.431876219268936}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<=
      (/
       (*
        y
        (+
         (* z (+ (* z 0.0692910599291889) 0.4917317610505968))
         0.279195317918525))
       (+ (* z (+ z 6.012459259764103)) 3.350343815022304))
      1e+301)
   (+
    x
    (*
     (/ y (fma z (+ z 6.012459259764103) 3.350343815022304))
     (fma z (fma z 0.0692910599291889 0.4917317610505968) 0.279195317918525)))
   (+ x (/ y 14.431876219268936))))
double code(double x, double y, double z) {
	double tmp;
	if (((y * ((z * ((z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) <= 1e+301) {
		tmp = x + ((y / fma(z, (z + 6.012459259764103), 3.350343815022304)) * fma(z, fma(z, 0.0692910599291889, 0.4917317610505968), 0.279195317918525));
	} else {
		tmp = x + (y / 14.431876219268936);
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (Float64(Float64(y * Float64(Float64(z * Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968)) + 0.279195317918525)) / Float64(Float64(z * Float64(z + 6.012459259764103)) + 3.350343815022304)) <= 1e+301)
		tmp = Float64(x + Float64(Float64(y / fma(z, Float64(z + 6.012459259764103), 3.350343815022304)) * fma(z, fma(z, 0.0692910599291889, 0.4917317610505968), 0.279195317918525)));
	else
		tmp = Float64(x + Float64(y / 14.431876219268936));
	end
	return tmp
end
code[x_, y_, z_] := If[LessEqual[N[(N[(y * N[(N[(z * N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision]), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(z + 6.012459259764103), $MachinePrecision]), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision], 1e+301], N[(x + N[(N[(y / N[(z * N[(z + 6.012459259764103), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision] * N[(z * N[(z * 0.0692910599291889 + 0.4917317610505968), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / 14.431876219268936), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) + 0.279195317918525\right)}{z \cdot \left(z + 6.012459259764103\right) + 3.350343815022304} \leq 10^{+301}:\\
\;\;\;\;x + \frac{y}{\mathsf{fma}\left(z, z + 6.012459259764103, 3.350343815022304\right)} \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z 692910599291889/10000000000000000) 307332350656623/625000000000000) z) 11167812716741/40000000000000)) (+.f64 (*.f64 (+.f64 z 6012459259764103/1000000000000000) z) 104698244219447/31250000000000)) < 1.00000000000000005e301

    1. Initial program 95.5%

      \[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \]
    2. Step-by-step derivation
      1. associate-*l/99.7%

        \[\leadsto x + \color{blue}{\frac{y}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)} \]
      2. *-commutative99.7%

        \[\leadsto x + \frac{y}{\color{blue}{z \cdot \left(z + 6.012459259764103\right)} + 3.350343815022304} \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right) \]
      3. fma-def99.7%

        \[\leadsto x + \frac{y}{\color{blue}{\mathsf{fma}\left(z, z + 6.012459259764103, 3.350343815022304\right)}} \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right) \]
      4. *-commutative99.7%

        \[\leadsto x + \frac{y}{\mathsf{fma}\left(z, z + 6.012459259764103, 3.350343815022304\right)} \cdot \left(\color{blue}{z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right)} + 0.279195317918525\right) \]
      5. fma-def99.7%

        \[\leadsto x + \frac{y}{\mathsf{fma}\left(z, z + 6.012459259764103, 3.350343815022304\right)} \cdot \color{blue}{\mathsf{fma}\left(z, z \cdot 0.0692910599291889 + 0.4917317610505968, 0.279195317918525\right)} \]
      6. fma-def99.7%

        \[\leadsto x + \frac{y}{\mathsf{fma}\left(z, z + 6.012459259764103, 3.350343815022304\right)} \cdot \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right)}, 0.279195317918525\right) \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{x + \frac{y}{\mathsf{fma}\left(z, z + 6.012459259764103, 3.350343815022304\right)} \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)} \]

    if 1.00000000000000005e301 < (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 z 692910599291889/10000000000000000) 307332350656623/625000000000000) z) 11167812716741/40000000000000)) (+.f64 (*.f64 (+.f64 z 6012459259764103/1000000000000000) z) 104698244219447/31250000000000))

    1. Initial program 0.8%

      \[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \]
    2. Step-by-step derivation
      1. associate-/l*9.0%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}}} \]
      2. fma-def9.0%

        \[\leadsto x + \frac{y}{\frac{\color{blue}{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}} \]
      3. fma-def9.0%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\color{blue}{\mathsf{fma}\left(z \cdot 0.0692910599291889 + 0.4917317610505968, z, 0.279195317918525\right)}}} \]
      4. fma-def9.0%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right)}, z, 0.279195317918525\right)}} \]
    3. Simplified9.0%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), z, 0.279195317918525\right)}}} \]
    4. Taylor expanded in z around inf 100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) + 0.279195317918525\right)}{z \cdot \left(z + 6.012459259764103\right) + 3.350343815022304} \leq 10^{+301}:\\ \;\;\;\;x + \frac{y}{\mathsf{fma}\left(z, z + 6.012459259764103, 3.350343815022304\right)} \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{14.431876219268936}\\ \end{array} \]

Alternative 3: 98.6% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+16}:\\
\;\;\;\;x + \frac{y}{14.431876219268936}\\

\mathbf{elif}\;z \leq 6.5 \cdot 10^{-12}:\\
\;\;\;\;x + \frac{y}{z \cdot 0.39999999996247915 + 12.000000000000014}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{y}{14.431876219268936 + \frac{\frac{101.23733352003822}{z} - 15.646356830292042}{z}}\\


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

    1. Initial program 31.6%

      \[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \]
    2. Step-by-step derivation
      1. associate-/l*44.9%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}}} \]
      2. fma-def44.9%

        \[\leadsto x + \frac{y}{\frac{\color{blue}{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}} \]
      3. fma-def44.9%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\color{blue}{\mathsf{fma}\left(z \cdot 0.0692910599291889 + 0.4917317610505968, z, 0.279195317918525\right)}}} \]
      4. fma-def44.9%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right)}, z, 0.279195317918525\right)}} \]
    3. Simplified44.9%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), z, 0.279195317918525\right)}}} \]
    4. Taylor expanded in z around inf 99.9%

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

    if -4.8e16 < z < 6.5000000000000002e-12

    1. Initial program 99.6%

      \[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \]
    2. Step-by-step derivation
      1. associate-/l*99.4%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}}} \]
      2. fma-def99.4%

        \[\leadsto x + \frac{y}{\frac{\color{blue}{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}} \]
      3. fma-def99.4%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\color{blue}{\mathsf{fma}\left(z \cdot 0.0692910599291889 + 0.4917317610505968, z, 0.279195317918525\right)}}} \]
      4. fma-def99.4%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right)}, z, 0.279195317918525\right)}} \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), z, 0.279195317918525\right)}}} \]
    4. Taylor expanded in z around 0 99.9%

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

    if 6.5000000000000002e-12 < z

    1. Initial program 46.5%

      \[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \]
    2. Step-by-step derivation
      1. associate-/l*53.6%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}}} \]
      2. fma-def53.6%

        \[\leadsto x + \frac{y}{\frac{\color{blue}{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}} \]
      3. fma-def53.6%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\color{blue}{\mathsf{fma}\left(z \cdot 0.0692910599291889 + 0.4917317610505968, z, 0.279195317918525\right)}}} \]
      4. fma-def53.6%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right)}, z, 0.279195317918525\right)}} \]
    3. Simplified53.6%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), z, 0.279195317918525\right)}}} \]
    4. Taylor expanded in z around inf 99.0%

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

        \[\leadsto x + \frac{y}{\left(14.431876219268936 + \color{blue}{\frac{101.23733352003822 \cdot 1}{{z}^{2}}}\right) - 15.646356830292042 \cdot \frac{1}{z}} \]
      2. metadata-eval99.0%

        \[\leadsto x + \frac{y}{\left(14.431876219268936 + \frac{\color{blue}{101.23733352003822}}{{z}^{2}}\right) - 15.646356830292042 \cdot \frac{1}{z}} \]
      3. unpow299.0%

        \[\leadsto x + \frac{y}{\left(14.431876219268936 + \frac{101.23733352003822}{\color{blue}{z \cdot z}}\right) - 15.646356830292042 \cdot \frac{1}{z}} \]
      4. associate-*r/99.0%

        \[\leadsto x + \frac{y}{\left(14.431876219268936 + \frac{101.23733352003822}{z \cdot z}\right) - \color{blue}{\frac{15.646356830292042 \cdot 1}{z}}} \]
      5. metadata-eval99.0%

        \[\leadsto x + \frac{y}{\left(14.431876219268936 + \frac{101.23733352003822}{z \cdot z}\right) - \frac{\color{blue}{15.646356830292042}}{z}} \]
    6. Simplified99.0%

      \[\leadsto x + \frac{y}{\color{blue}{\left(14.431876219268936 + \frac{101.23733352003822}{z \cdot z}\right) - \frac{15.646356830292042}{z}}} \]
    7. Step-by-step derivation
      1. associate--l+99.0%

        \[\leadsto x + \frac{y}{\color{blue}{14.431876219268936 + \left(\frac{101.23733352003822}{z \cdot z} - \frac{15.646356830292042}{z}\right)}} \]
      2. associate-/r*99.0%

        \[\leadsto x + \frac{y}{14.431876219268936 + \left(\color{blue}{\frac{\frac{101.23733352003822}{z}}{z}} - \frac{15.646356830292042}{z}\right)} \]
      3. sub-div99.0%

        \[\leadsto x + \frac{y}{14.431876219268936 + \color{blue}{\frac{\frac{101.23733352003822}{z} - 15.646356830292042}{z}}} \]
    8. Applied egg-rr99.0%

      \[\leadsto x + \frac{y}{\color{blue}{14.431876219268936 + \frac{\frac{101.23733352003822}{z} - 15.646356830292042}{z}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{+16}:\\ \;\;\;\;x + \frac{y}{14.431876219268936}\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-12}:\\ \;\;\;\;x + \frac{y}{z \cdot 0.39999999996247915 + 12.000000000000014}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{14.431876219268936 + \frac{\frac{101.23733352003822}{z} - 15.646356830292042}{z}}\\ \end{array} \]

Alternative 4: 60.2% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.3 \cdot 10^{-12}:\\ \;\;\;\;y \cdot 0.0692910599291889\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-51}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-37}:\\ \;\;\;\;y \cdot 0.0692910599291889\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{+14}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+34}:\\ \;\;\;\;y \cdot 0.0692910599291889\\ \mathbf{elif}\;y \leq 6.6 \cdot 10^{+52}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot 0.08333333333333323\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -3.3e-12)
   (* y 0.0692910599291889)
   (if (<= y 2.1e-51)
     x
     (if (<= y 3.5e-37)
       (* y 0.0692910599291889)
       (if (<= y 8.2e+14)
         x
         (if (<= y 4.5e+34)
           (* y 0.0692910599291889)
           (if (<= y 6.6e+52) x (* y 0.08333333333333323))))))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -3.3e-12) {
		tmp = y * 0.0692910599291889;
	} else if (y <= 2.1e-51) {
		tmp = x;
	} else if (y <= 3.5e-37) {
		tmp = y * 0.0692910599291889;
	} else if (y <= 8.2e+14) {
		tmp = x;
	} else if (y <= 4.5e+34) {
		tmp = y * 0.0692910599291889;
	} else if (y <= 6.6e+52) {
		tmp = x;
	} else {
		tmp = y * 0.08333333333333323;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= (-3.3d-12)) then
        tmp = y * 0.0692910599291889d0
    else if (y <= 2.1d-51) then
        tmp = x
    else if (y <= 3.5d-37) then
        tmp = y * 0.0692910599291889d0
    else if (y <= 8.2d+14) then
        tmp = x
    else if (y <= 4.5d+34) then
        tmp = y * 0.0692910599291889d0
    else if (y <= 6.6d+52) then
        tmp = x
    else
        tmp = y * 0.08333333333333323d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -3.3e-12) {
		tmp = y * 0.0692910599291889;
	} else if (y <= 2.1e-51) {
		tmp = x;
	} else if (y <= 3.5e-37) {
		tmp = y * 0.0692910599291889;
	} else if (y <= 8.2e+14) {
		tmp = x;
	} else if (y <= 4.5e+34) {
		tmp = y * 0.0692910599291889;
	} else if (y <= 6.6e+52) {
		tmp = x;
	} else {
		tmp = y * 0.08333333333333323;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -3.3e-12:
		tmp = y * 0.0692910599291889
	elif y <= 2.1e-51:
		tmp = x
	elif y <= 3.5e-37:
		tmp = y * 0.0692910599291889
	elif y <= 8.2e+14:
		tmp = x
	elif y <= 4.5e+34:
		tmp = y * 0.0692910599291889
	elif y <= 6.6e+52:
		tmp = x
	else:
		tmp = y * 0.08333333333333323
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -3.3e-12)
		tmp = Float64(y * 0.0692910599291889);
	elseif (y <= 2.1e-51)
		tmp = x;
	elseif (y <= 3.5e-37)
		tmp = Float64(y * 0.0692910599291889);
	elseif (y <= 8.2e+14)
		tmp = x;
	elseif (y <= 4.5e+34)
		tmp = Float64(y * 0.0692910599291889);
	elseif (y <= 6.6e+52)
		tmp = x;
	else
		tmp = Float64(y * 0.08333333333333323);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -3.3e-12)
		tmp = y * 0.0692910599291889;
	elseif (y <= 2.1e-51)
		tmp = x;
	elseif (y <= 3.5e-37)
		tmp = y * 0.0692910599291889;
	elseif (y <= 8.2e+14)
		tmp = x;
	elseif (y <= 4.5e+34)
		tmp = y * 0.0692910599291889;
	elseif (y <= 6.6e+52)
		tmp = x;
	else
		tmp = y * 0.08333333333333323;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -3.3e-12], N[(y * 0.0692910599291889), $MachinePrecision], If[LessEqual[y, 2.1e-51], x, If[LessEqual[y, 3.5e-37], N[(y * 0.0692910599291889), $MachinePrecision], If[LessEqual[y, 8.2e+14], x, If[LessEqual[y, 4.5e+34], N[(y * 0.0692910599291889), $MachinePrecision], If[LessEqual[y, 6.6e+52], x, N[(y * 0.08333333333333323), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-12}:\\
\;\;\;\;y \cdot 0.0692910599291889\\

\mathbf{elif}\;y \leq 2.1 \cdot 10^{-51}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 3.5 \cdot 10^{-37}:\\
\;\;\;\;y \cdot 0.0692910599291889\\

\mathbf{elif}\;y \leq 8.2 \cdot 10^{+14}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 4.5 \cdot 10^{+34}:\\
\;\;\;\;y \cdot 0.0692910599291889\\

\mathbf{elif}\;y \leq 6.6 \cdot 10^{+52}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;y \cdot 0.08333333333333323\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.3000000000000001e-12 or 2.10000000000000002e-51 < y < 3.5000000000000001e-37 or 8.2e14 < y < 4.5e34

    1. Initial program 55.7%

      \[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \]
    2. Step-by-step derivation
      1. +-commutative55.7%

        \[\leadsto \color{blue}{\frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} + x} \]
      2. associate-*r/65.7%

        \[\leadsto \color{blue}{y \cdot \frac{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}} + x \]
      3. fma-def65.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}, x\right)} \]
      4. *-commutative65.7%

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right)} + 0.279195317918525}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}, x\right) \]
      5. fma-def65.7%

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{\mathsf{fma}\left(z, z \cdot 0.0692910599291889 + 0.4917317610505968, 0.279195317918525\right)}}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}, x\right) \]
      6. fma-def65.7%

        \[\leadsto \mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right)}, 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}, x\right) \]
      7. *-commutative65.7%

        \[\leadsto \mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)}{\color{blue}{z \cdot \left(z + 6.012459259764103\right)} + 3.350343815022304}, x\right) \]
      8. fma-def65.7%

        \[\leadsto \mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)}{\color{blue}{\mathsf{fma}\left(z, z + 6.012459259764103, 3.350343815022304\right)}}, x\right) \]
    3. Simplified65.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)}{\mathsf{fma}\left(z, z + 6.012459259764103, 3.350343815022304\right)}, x\right)} \]
    4. Taylor expanded in z around inf 70.9%

      \[\leadsto \color{blue}{0.0692910599291889 \cdot y + \left(0.07512208616047561 \cdot \frac{y}{z} + x\right)} \]
    5. Taylor expanded in y around inf 61.6%

      \[\leadsto 0.0692910599291889 \cdot y + \color{blue}{0.07512208616047561 \cdot \frac{y}{z}} \]
    6. Step-by-step derivation
      1. associate-*r/61.6%

        \[\leadsto 0.0692910599291889 \cdot y + \color{blue}{\frac{0.07512208616047561 \cdot y}{z}} \]
      2. *-commutative61.6%

        \[\leadsto 0.0692910599291889 \cdot y + \frac{\color{blue}{y \cdot 0.07512208616047561}}{z} \]
      3. associate-*r/61.6%

        \[\leadsto 0.0692910599291889 \cdot y + \color{blue}{y \cdot \frac{0.07512208616047561}{z}} \]
    7. Simplified61.6%

      \[\leadsto 0.0692910599291889 \cdot y + \color{blue}{y \cdot \frac{0.07512208616047561}{z}} \]
    8. Taylor expanded in z around inf 66.1%

      \[\leadsto \color{blue}{0.0692910599291889 \cdot y} \]
    9. Step-by-step derivation
      1. *-commutative66.1%

        \[\leadsto \color{blue}{y \cdot 0.0692910599291889} \]
    10. Simplified66.1%

      \[\leadsto \color{blue}{y \cdot 0.0692910599291889} \]

    if -3.3000000000000001e-12 < y < 2.10000000000000002e-51 or 3.5000000000000001e-37 < y < 8.2e14 or 4.5e34 < y < 6.6e52

    1. Initial program 71.5%

      \[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \]
    2. Step-by-step derivation
      1. +-commutative71.5%

        \[\leadsto \color{blue}{\frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} + x} \]
      2. associate-*r/71.5%

        \[\leadsto \color{blue}{y \cdot \frac{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}} + x \]
      3. fma-def71.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}, x\right)} \]
      4. *-commutative71.5%

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right)} + 0.279195317918525}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}, x\right) \]
      5. fma-def71.5%

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{\mathsf{fma}\left(z, z \cdot 0.0692910599291889 + 0.4917317610505968, 0.279195317918525\right)}}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}, x\right) \]
      6. fma-def71.5%

        \[\leadsto \mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right)}, 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}, x\right) \]
      7. *-commutative71.5%

        \[\leadsto \mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)}{\color{blue}{z \cdot \left(z + 6.012459259764103\right)} + 3.350343815022304}, x\right) \]
      8. fma-def71.5%

        \[\leadsto \mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)}{\color{blue}{\mathsf{fma}\left(z, z + 6.012459259764103, 3.350343815022304\right)}}, x\right) \]
    3. Simplified71.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)}{\mathsf{fma}\left(z, z + 6.012459259764103, 3.350343815022304\right)}, x\right)} \]
    4. Taylor expanded in y around 0 80.3%

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

    if 6.6e52 < y

    1. Initial program 71.7%

      \[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \]
    2. Step-by-step derivation
      1. associate-/l*84.7%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}}} \]
      2. fma-def84.7%

        \[\leadsto x + \frac{y}{\frac{\color{blue}{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}} \]
      3. fma-def84.7%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\color{blue}{\mathsf{fma}\left(z \cdot 0.0692910599291889 + 0.4917317610505968, z, 0.279195317918525\right)}}} \]
      4. fma-def84.7%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right)}, z, 0.279195317918525\right)}} \]
    3. Simplified84.7%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), z, 0.279195317918525\right)}}} \]
    4. Taylor expanded in z around 0 69.8%

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

      \[\leadsto \color{blue}{\frac{y}{0.39999999996247915 \cdot z + 12.000000000000014}} \]
    6. Taylor expanded in z around 0 61.5%

      \[\leadsto \color{blue}{0.08333333333333323 \cdot y} \]
    7. Step-by-step derivation
      1. *-commutative61.5%

        \[\leadsto \color{blue}{y \cdot 0.08333333333333323} \]
    8. Simplified61.5%

      \[\leadsto \color{blue}{y \cdot 0.08333333333333323} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification72.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.3 \cdot 10^{-12}:\\ \;\;\;\;y \cdot 0.0692910599291889\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-51}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-37}:\\ \;\;\;\;y \cdot 0.0692910599291889\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{+14}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+34}:\\ \;\;\;\;y \cdot 0.0692910599291889\\ \mathbf{elif}\;y \leq 6.6 \cdot 10^{+52}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot 0.08333333333333323\\ \end{array} \]

Alternative 5: 98.5% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+16} \lor \neg \left(z \leq 6.5 \cdot 10^{-12}\right):\\
\;\;\;\;x + \frac{y}{14.431876219268936}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.8e16 or 6.5000000000000002e-12 < z

    1. Initial program 39.9%

      \[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \]
    2. Step-by-step derivation
      1. associate-/l*49.7%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}}} \]
      2. fma-def49.7%

        \[\leadsto x + \frac{y}{\frac{\color{blue}{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}} \]
      3. fma-def49.7%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\color{blue}{\mathsf{fma}\left(z \cdot 0.0692910599291889 + 0.4917317610505968, z, 0.279195317918525\right)}}} \]
      4. fma-def49.7%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right)}, z, 0.279195317918525\right)}} \]
    3. Simplified49.7%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), z, 0.279195317918525\right)}}} \]
    4. Taylor expanded in z around inf 99.4%

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

    if -4.8e16 < z < 6.5000000000000002e-12

    1. Initial program 99.6%

      \[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \]
    2. Step-by-step derivation
      1. associate-/l*99.4%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}}} \]
      2. fma-def99.4%

        \[\leadsto x + \frac{y}{\frac{\color{blue}{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}} \]
      3. fma-def99.4%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\color{blue}{\mathsf{fma}\left(z \cdot 0.0692910599291889 + 0.4917317610505968, z, 0.279195317918525\right)}}} \]
      4. fma-def99.4%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right)}, z, 0.279195317918525\right)}} \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), z, 0.279195317918525\right)}}} \]
    4. Taylor expanded in z around 0 99.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{+16} \lor \neg \left(z \leq 6.5 \cdot 10^{-12}\right):\\ \;\;\;\;x + \frac{y}{14.431876219268936}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{z \cdot 0.39999999996247915 + 12.000000000000014}\\ \end{array} \]

Alternative 6: 98.5% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+16}:\\
\;\;\;\;x + \frac{y}{14.431876219268936}\\

\mathbf{elif}\;z \leq 6.5 \cdot 10^{-12}:\\
\;\;\;\;x + \frac{y}{z \cdot 0.39999999996247915 + 12.000000000000014}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{y}{14.431876219268936 - \frac{15.646356830292042}{z}}\\


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

    1. Initial program 31.6%

      \[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \]
    2. Step-by-step derivation
      1. associate-/l*44.9%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}}} \]
      2. fma-def44.9%

        \[\leadsto x + \frac{y}{\frac{\color{blue}{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}} \]
      3. fma-def44.9%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\color{blue}{\mathsf{fma}\left(z \cdot 0.0692910599291889 + 0.4917317610505968, z, 0.279195317918525\right)}}} \]
      4. fma-def44.9%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right)}, z, 0.279195317918525\right)}} \]
    3. Simplified44.9%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), z, 0.279195317918525\right)}}} \]
    4. Taylor expanded in z around inf 99.9%

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

    if -4.8e16 < z < 6.5000000000000002e-12

    1. Initial program 99.6%

      \[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \]
    2. Step-by-step derivation
      1. associate-/l*99.4%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}}} \]
      2. fma-def99.4%

        \[\leadsto x + \frac{y}{\frac{\color{blue}{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}} \]
      3. fma-def99.4%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\color{blue}{\mathsf{fma}\left(z \cdot 0.0692910599291889 + 0.4917317610505968, z, 0.279195317918525\right)}}} \]
      4. fma-def99.4%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right)}, z, 0.279195317918525\right)}} \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), z, 0.279195317918525\right)}}} \]
    4. Taylor expanded in z around 0 99.9%

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

    if 6.5000000000000002e-12 < z

    1. Initial program 46.5%

      \[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \]
    2. Step-by-step derivation
      1. associate-/l*53.6%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}}} \]
      2. fma-def53.6%

        \[\leadsto x + \frac{y}{\frac{\color{blue}{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}} \]
      3. fma-def53.6%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\color{blue}{\mathsf{fma}\left(z \cdot 0.0692910599291889 + 0.4917317610505968, z, 0.279195317918525\right)}}} \]
      4. fma-def53.6%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right)}, z, 0.279195317918525\right)}} \]
    3. Simplified53.6%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), z, 0.279195317918525\right)}}} \]
    4. Taylor expanded in z around inf 99.0%

      \[\leadsto x + \frac{y}{\color{blue}{14.431876219268936 - 15.646356830292042 \cdot \frac{1}{z}}} \]
    5. Step-by-step derivation
      1. associate-*r/99.0%

        \[\leadsto x + \frac{y}{14.431876219268936 - \color{blue}{\frac{15.646356830292042 \cdot 1}{z}}} \]
      2. metadata-eval99.0%

        \[\leadsto x + \frac{y}{14.431876219268936 - \frac{\color{blue}{15.646356830292042}}{z}} \]
    6. Simplified99.0%

      \[\leadsto x + \frac{y}{\color{blue}{14.431876219268936 - \frac{15.646356830292042}{z}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{+16}:\\ \;\;\;\;x + \frac{y}{14.431876219268936}\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-12}:\\ \;\;\;\;x + \frac{y}{z \cdot 0.39999999996247915 + 12.000000000000014}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{14.431876219268936 - \frac{15.646356830292042}{z}}\\ \end{array} \]

Alternative 7: 98.5% accurate, 2.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+16} \lor \neg \left(z \leq 6.5 \cdot 10^{-12}\right):\\
\;\;\;\;x + \frac{y}{14.431876219268936}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.8e16 or 6.5000000000000002e-12 < z

    1. Initial program 39.9%

      \[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \]
    2. Step-by-step derivation
      1. associate-/l*49.7%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}}} \]
      2. fma-def49.7%

        \[\leadsto x + \frac{y}{\frac{\color{blue}{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}} \]
      3. fma-def49.7%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\color{blue}{\mathsf{fma}\left(z \cdot 0.0692910599291889 + 0.4917317610505968, z, 0.279195317918525\right)}}} \]
      4. fma-def49.7%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right)}, z, 0.279195317918525\right)}} \]
    3. Simplified49.7%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), z, 0.279195317918525\right)}}} \]
    4. Taylor expanded in z around inf 99.4%

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

    if -4.8e16 < z < 6.5000000000000002e-12

    1. Initial program 99.6%

      \[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \]
    2. Step-by-step derivation
      1. associate-/l*99.4%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}}} \]
      2. fma-def99.4%

        \[\leadsto x + \frac{y}{\frac{\color{blue}{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}} \]
      3. fma-def99.4%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\color{blue}{\mathsf{fma}\left(z \cdot 0.0692910599291889 + 0.4917317610505968, z, 0.279195317918525\right)}}} \]
      4. fma-def99.4%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right)}, z, 0.279195317918525\right)}} \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), z, 0.279195317918525\right)}}} \]
    4. Taylor expanded in z around 0 99.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{+16} \lor \neg \left(z \leq 6.5 \cdot 10^{-12}\right):\\ \;\;\;\;x + \frac{y}{14.431876219268936}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{12.000000000000014}\\ \end{array} \]

Alternative 8: 59.0% accurate, 2.9× speedup?

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

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

\mathbf{elif}\;x \leq 3.2 \cdot 10^{+57}:\\
\;\;\;\;y \cdot 0.0692910599291889\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.4e23 or 3.20000000000000029e57 < x

    1. Initial program 70.2%

      \[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \]
    2. Step-by-step derivation
      1. +-commutative70.2%

        \[\leadsto \color{blue}{\frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} + x} \]
      2. associate-*r/72.8%

        \[\leadsto \color{blue}{y \cdot \frac{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}} + x \]
      3. fma-def72.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}, x\right)} \]
      4. *-commutative72.8%

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right)} + 0.279195317918525}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}, x\right) \]
      5. fma-def72.8%

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{\mathsf{fma}\left(z, z \cdot 0.0692910599291889 + 0.4917317610505968, 0.279195317918525\right)}}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}, x\right) \]
      6. fma-def72.8%

        \[\leadsto \mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right)}, 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}, x\right) \]
      7. *-commutative72.8%

        \[\leadsto \mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)}{\color{blue}{z \cdot \left(z + 6.012459259764103\right)} + 3.350343815022304}, x\right) \]
      8. fma-def72.8%

        \[\leadsto \mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)}{\color{blue}{\mathsf{fma}\left(z, z + 6.012459259764103, 3.350343815022304\right)}}, x\right) \]
    3. Simplified72.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)}{\mathsf{fma}\left(z, z + 6.012459259764103, 3.350343815022304\right)}, x\right)} \]
    4. Taylor expanded in y around 0 82.5%

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

    if -1.4e23 < x < 3.20000000000000029e57

    1. Initial program 64.6%

      \[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \]
    2. Step-by-step derivation
      1. +-commutative64.6%

        \[\leadsto \color{blue}{\frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} + x} \]
      2. associate-*r/72.1%

        \[\leadsto \color{blue}{y \cdot \frac{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}} + x \]
      3. fma-def72.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}, x\right)} \]
      4. *-commutative72.1%

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right)} + 0.279195317918525}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}, x\right) \]
      5. fma-def72.1%

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{\mathsf{fma}\left(z, z \cdot 0.0692910599291889 + 0.4917317610505968, 0.279195317918525\right)}}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}, x\right) \]
      6. fma-def72.1%

        \[\leadsto \mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right)}, 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}, x\right) \]
      7. *-commutative72.1%

        \[\leadsto \mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)}{\color{blue}{z \cdot \left(z + 6.012459259764103\right)} + 3.350343815022304}, x\right) \]
      8. fma-def72.1%

        \[\leadsto \mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)}{\color{blue}{\mathsf{fma}\left(z, z + 6.012459259764103, 3.350343815022304\right)}}, x\right) \]
    3. Simplified72.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)}{\mathsf{fma}\left(z, z + 6.012459259764103, 3.350343815022304\right)}, x\right)} \]
    4. Taylor expanded in z around inf 60.6%

      \[\leadsto \color{blue}{0.0692910599291889 \cdot y + \left(0.07512208616047561 \cdot \frac{y}{z} + x\right)} \]
    5. Taylor expanded in y around inf 44.8%

      \[\leadsto 0.0692910599291889 \cdot y + \color{blue}{0.07512208616047561 \cdot \frac{y}{z}} \]
    6. Step-by-step derivation
      1. associate-*r/44.8%

        \[\leadsto 0.0692910599291889 \cdot y + \color{blue}{\frac{0.07512208616047561 \cdot y}{z}} \]
      2. *-commutative44.8%

        \[\leadsto 0.0692910599291889 \cdot y + \frac{\color{blue}{y \cdot 0.07512208616047561}}{z} \]
      3. associate-*r/44.8%

        \[\leadsto 0.0692910599291889 \cdot y + \color{blue}{y \cdot \frac{0.07512208616047561}{z}} \]
    7. Simplified44.8%

      \[\leadsto 0.0692910599291889 \cdot y + \color{blue}{y \cdot \frac{0.07512208616047561}{z}} \]
    8. Taylor expanded in z around inf 50.5%

      \[\leadsto \color{blue}{0.0692910599291889 \cdot y} \]
    9. Step-by-step derivation
      1. *-commutative50.5%

        \[\leadsto \color{blue}{y \cdot 0.0692910599291889} \]
    10. Simplified50.5%

      \[\leadsto \color{blue}{y \cdot 0.0692910599291889} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification63.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.4 \cdot 10^{+23}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{+57}:\\ \;\;\;\;y \cdot 0.0692910599291889\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 9: 76.4% accurate, 3.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+89}:\\
\;\;\;\;y \cdot 0.0692910599291889\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.99999999999999999e89

    1. Initial program 40.4%

      \[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \]
    2. Step-by-step derivation
      1. +-commutative40.4%

        \[\leadsto \color{blue}{\frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} + x} \]
      2. associate-*r/57.6%

        \[\leadsto \color{blue}{y \cdot \frac{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}} + x \]
      3. fma-def57.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}, x\right)} \]
      4. *-commutative57.6%

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right)} + 0.279195317918525}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}, x\right) \]
      5. fma-def57.6%

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{\mathsf{fma}\left(z, z \cdot 0.0692910599291889 + 0.4917317610505968, 0.279195317918525\right)}}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}, x\right) \]
      6. fma-def57.6%

        \[\leadsto \mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right)}, 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}, x\right) \]
      7. *-commutative57.6%

        \[\leadsto \mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)}{\color{blue}{z \cdot \left(z + 6.012459259764103\right)} + 3.350343815022304}, x\right) \]
      8. fma-def57.6%

        \[\leadsto \mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)}{\color{blue}{\mathsf{fma}\left(z, z + 6.012459259764103, 3.350343815022304\right)}}, x\right) \]
    3. Simplified57.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)}{\mathsf{fma}\left(z, z + 6.012459259764103, 3.350343815022304\right)}, x\right)} \]
    4. Taylor expanded in z around inf 70.6%

      \[\leadsto \color{blue}{0.0692910599291889 \cdot y + \left(0.07512208616047561 \cdot \frac{y}{z} + x\right)} \]
    5. Taylor expanded in y around inf 63.7%

      \[\leadsto 0.0692910599291889 \cdot y + \color{blue}{0.07512208616047561 \cdot \frac{y}{z}} \]
    6. Step-by-step derivation
      1. associate-*r/63.7%

        \[\leadsto 0.0692910599291889 \cdot y + \color{blue}{\frac{0.07512208616047561 \cdot y}{z}} \]
      2. *-commutative63.7%

        \[\leadsto 0.0692910599291889 \cdot y + \frac{\color{blue}{y \cdot 0.07512208616047561}}{z} \]
      3. associate-*r/63.7%

        \[\leadsto 0.0692910599291889 \cdot y + \color{blue}{y \cdot \frac{0.07512208616047561}{z}} \]
    7. Simplified63.7%

      \[\leadsto 0.0692910599291889 \cdot y + \color{blue}{y \cdot \frac{0.07512208616047561}{z}} \]
    8. Taylor expanded in z around inf 69.0%

      \[\leadsto \color{blue}{0.0692910599291889 \cdot y} \]
    9. Step-by-step derivation
      1. *-commutative69.0%

        \[\leadsto \color{blue}{y \cdot 0.0692910599291889} \]
    10. Simplified69.0%

      \[\leadsto \color{blue}{y \cdot 0.0692910599291889} \]

    if -1.99999999999999999e89 < y

    1. Initial program 72.3%

      \[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \]
    2. Step-by-step derivation
      1. associate-/l*75.2%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}}} \]
      2. fma-def75.2%

        \[\leadsto x + \frac{y}{\frac{\color{blue}{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}}{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}} \]
      3. fma-def75.2%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\color{blue}{\mathsf{fma}\left(z \cdot 0.0692910599291889 + 0.4917317610505968, z, 0.279195317918525\right)}}} \]
      4. fma-def75.2%

        \[\leadsto x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right)}, z, 0.279195317918525\right)}} \]
    3. Simplified75.2%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{\mathsf{fma}\left(z + 6.012459259764103, z, 3.350343815022304\right)}{\mathsf{fma}\left(\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), z, 0.279195317918525\right)}}} \]
    4. Taylor expanded in z around 0 81.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{+89}:\\ \;\;\;\;y \cdot 0.0692910599291889\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{12.000000000000014}\\ \end{array} \]

Alternative 10: 51.0% accurate, 21.0× speedup?

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

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

    \[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \]
  2. Step-by-step derivation
    1. +-commutative67.0%

      \[\leadsto \color{blue}{\frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} + x} \]
    2. associate-*r/72.4%

      \[\leadsto \color{blue}{y \cdot \frac{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}} + x \]
    3. fma-def72.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}, x\right)} \]
    4. *-commutative72.4%

      \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{z \cdot \left(z \cdot 0.0692910599291889 + 0.4917317610505968\right)} + 0.279195317918525}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}, x\right) \]
    5. fma-def72.4%

      \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{\mathsf{fma}\left(z, z \cdot 0.0692910599291889 + 0.4917317610505968, 0.279195317918525\right)}}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}, x\right) \]
    6. fma-def72.4%

      \[\leadsto \mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right)}, 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}, x\right) \]
    7. *-commutative72.4%

      \[\leadsto \mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)}{\color{blue}{z \cdot \left(z + 6.012459259764103\right)} + 3.350343815022304}, x\right) \]
    8. fma-def72.4%

      \[\leadsto \mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)}{\color{blue}{\mathsf{fma}\left(z, z + 6.012459259764103, 3.350343815022304\right)}}, x\right) \]
  3. Simplified72.4%

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)}{\mathsf{fma}\left(z, z + 6.012459259764103, 3.350343815022304\right)}, x\right)} \]
  4. Taylor expanded in y around 0 49.7%

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

    \[\leadsto x \]

Developer target: 99.4% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\frac{0.07512208616047561}{z} + 0.0692910599291889\right) \cdot y - \left(\frac{0.40462203869992125 \cdot y}{z \cdot z} - x\right)\\ \mathbf{if}\;z < -8120153.652456675:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z < 6.576118972787377 \cdot 10^{+20}:\\ \;\;\;\;x + \left(y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)\right) \cdot \frac{1}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0
         (-
          (* (+ (/ 0.07512208616047561 z) 0.0692910599291889) y)
          (- (/ (* 0.40462203869992125 y) (* z z)) x))))
   (if (< z -8120153.652456675)
     t_0
     (if (< z 6.576118972787377e+20)
       (+
        x
        (*
         (*
          y
          (+
           (* (+ (* z 0.0692910599291889) 0.4917317610505968) z)
           0.279195317918525))
         (/ 1.0 (+ (* (+ z 6.012459259764103) z) 3.350343815022304))))
       t_0))))
double code(double x, double y, double z) {
	double t_0 = (((0.07512208616047561 / z) + 0.0692910599291889) * y) - (((0.40462203869992125 * y) / (z * z)) - x);
	double tmp;
	if (z < -8120153.652456675) {
		tmp = t_0;
	} else if (z < 6.576118972787377e+20) {
		tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) * (1.0 / (((z + 6.012459259764103) * z) + 3.350343815022304)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (((0.07512208616047561d0 / z) + 0.0692910599291889d0) * y) - (((0.40462203869992125d0 * y) / (z * z)) - x)
    if (z < (-8120153.652456675d0)) then
        tmp = t_0
    else if (z < 6.576118972787377d+20) then
        tmp = x + ((y * ((((z * 0.0692910599291889d0) + 0.4917317610505968d0) * z) + 0.279195317918525d0)) * (1.0d0 / (((z + 6.012459259764103d0) * z) + 3.350343815022304d0)))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = (((0.07512208616047561 / z) + 0.0692910599291889) * y) - (((0.40462203869992125 * y) / (z * z)) - x);
	double tmp;
	if (z < -8120153.652456675) {
		tmp = t_0;
	} else if (z < 6.576118972787377e+20) {
		tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) * (1.0 / (((z + 6.012459259764103) * z) + 3.350343815022304)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = (((0.07512208616047561 / z) + 0.0692910599291889) * y) - (((0.40462203869992125 * y) / (z * z)) - x)
	tmp = 0
	if z < -8120153.652456675:
		tmp = t_0
	elif z < 6.576118972787377e+20:
		tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) * (1.0 / (((z + 6.012459259764103) * z) + 3.350343815022304)))
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(Float64(Float64(0.07512208616047561 / z) + 0.0692910599291889) * y) - Float64(Float64(Float64(0.40462203869992125 * y) / Float64(z * z)) - x))
	tmp = 0.0
	if (z < -8120153.652456675)
		tmp = t_0;
	elseif (z < 6.576118972787377e+20)
		tmp = Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) * Float64(1.0 / Float64(Float64(Float64(z + 6.012459259764103) * z) + 3.350343815022304))));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = (((0.07512208616047561 / z) + 0.0692910599291889) * y) - (((0.40462203869992125 * y) / (z * z)) - x);
	tmp = 0.0;
	if (z < -8120153.652456675)
		tmp = t_0;
	elseif (z < 6.576118972787377e+20)
		tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) * (1.0 / (((z + 6.012459259764103) * z) + 3.350343815022304)));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(0.07512208616047561 / z), $MachinePrecision] + 0.0692910599291889), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(0.40462203869992125 * y), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -8120153.652456675], t$95$0, If[Less[z, 6.576118972787377e+20], N[(x + N[(N[(y * N[(N[(N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision] * z), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[(N[(z + 6.012459259764103), $MachinePrecision] * z), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(\frac{0.07512208616047561}{z} + 0.0692910599291889\right) \cdot y - \left(\frac{0.40462203869992125 \cdot y}{z \cdot z} - x\right)\\
\mathbf{if}\;z < -8120153.652456675:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z < 6.576118972787377 \cdot 10^{+20}:\\
\;\;\;\;x + \left(y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)\right) \cdot \frac{1}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023196 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, B"
  :precision binary64

  :herbie-target
  (if (< z -8120153.652456675) (- (* (+ (/ 0.07512208616047561 z) 0.0692910599291889) y) (- (/ (* 0.40462203869992125 y) (* z z)) x)) (if (< z 6.576118972787377e+20) (+ x (* (* y (+ (* (+ (* z 0.0692910599291889) 0.4917317610505968) z) 0.279195317918525)) (/ 1.0 (+ (* (+ z 6.012459259764103) z) 3.350343815022304)))) (- (* (+ (/ 0.07512208616047561 z) 0.0692910599291889) y) (- (/ (* 0.40462203869992125 y) (* z z)) x))))

  (+ x (/ (* y (+ (* (+ (* z 0.0692910599291889) 0.4917317610505968) z) 0.279195317918525)) (+ (* (+ z 6.012459259764103) z) 3.350343815022304))))