Logarithmic Transform

Percentage Accurate: 41.2% → 85.9%
Time: 13.2s
Alternatives: 12
Speedup: 19.8×

Specification

?
\[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
(FPCore (c x y)
  :precision binary64
  (* c (log (+ 1.0 (* (- (pow E x) 1.0) y)))))
double code(double c, double x, double y) {
	return c * log((1.0 + ((pow(((double) M_E), x) - 1.0) * y)));
}
public static double code(double c, double x, double y) {
	return c * Math.log((1.0 + ((Math.pow(Math.E, x) - 1.0) * y)));
}
def code(c, x, y):
	return c * math.log((1.0 + ((math.pow(math.e, x) - 1.0) * y)))
function code(c, x, y)
	return Float64(c * log(Float64(1.0 + Float64(Float64((exp(1) ^ x) - 1.0) * y))))
end
function tmp = code(c, x, y)
	tmp = c * log((1.0 + (((2.71828182845904523536 ^ x) - 1.0) * y)));
end
code[c_, x_, y_] := N[(c * N[Log[N[(1.0 + N[(N[(N[Power[E, x], $MachinePrecision] - 1.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right)

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 41.2% accurate, 1.0× speedup?

\[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
(FPCore (c x y)
  :precision binary64
  (* c (log (+ 1.0 (* (- (pow E x) 1.0) y)))))
double code(double c, double x, double y) {
	return c * log((1.0 + ((pow(((double) M_E), x) - 1.0) * y)));
}
public static double code(double c, double x, double y) {
	return c * Math.log((1.0 + ((Math.pow(Math.E, x) - 1.0) * y)));
}
def code(c, x, y):
	return c * math.log((1.0 + ((math.pow(math.e, x) - 1.0) * y)))
function code(c, x, y)
	return Float64(c * log(Float64(1.0 + Float64(Float64((exp(1) ^ x) - 1.0) * y))))
end
function tmp = code(c, x, y)
	tmp = c * log((1.0 + (((2.71828182845904523536 ^ x) - 1.0) * y)));
end
code[c_, x_, y_] := N[(c * N[Log[N[(1.0 + N[(N[(N[Power[E, x], $MachinePrecision] - 1.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right)

Alternative 1: 85.9% accurate, 0.3× speedup?

\[\begin{array}{l} t_0 := e^{x} - 1\\ t_1 := {t\_0}^{2}\\ t_2 := \left({e}^{x} - 1\right) \cdot y\\ \mathbf{if}\;t\_2 \leq -4 \cdot 10^{-295}:\\ \;\;\;\;\left(\left(\left(t\_1 \cdot \left(\left(0.3333333333333333 \cdot y\right) \cdot t\_0 + -0.5\right)\right) \cdot y - \left(1 - e^{x}\right)\right) \cdot y\right) \cdot c\\ \mathbf{elif}\;t\_2 \leq 0:\\ \;\;\;\;\left(x \cdot \left(c + c \cdot \left(x \cdot \left(0.5 + -0.5 \cdot y\right)\right)\right)\right) \cdot y\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-8}:\\ \;\;\;\;\left(c \cdot \left(t\_0 + \left(t\_1 \cdot -0.5\right) \cdot y\right)\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;\log \left(y \cdot t\_0 - -1\right) \cdot c\\ \end{array} \]
(FPCore (c x y)
  :precision binary64
  (let* ((t_0 (- (exp x) 1.0))
       (t_1 (pow t_0 2.0))
       (t_2 (* (- (pow E x) 1.0) y)))
  (if (<= t_2 -4e-295)
    (*
     (*
      (-
       (* (* t_1 (+ (* (* 0.3333333333333333 y) t_0) -0.5)) y)
       (- 1.0 (exp x)))
      y)
     c)
    (if (<= t_2 0.0)
      (* (* x (+ c (* c (* x (+ 0.5 (* -0.5 y)))))) y)
      (if (<= t_2 2e-8)
        (* (* c (+ t_0 (* (* t_1 -0.5) y))) y)
        (* (log (- (* y t_0) -1.0)) c))))))
double code(double c, double x, double y) {
	double t_0 = exp(x) - 1.0;
	double t_1 = pow(t_0, 2.0);
	double t_2 = (pow(((double) M_E), x) - 1.0) * y;
	double tmp;
	if (t_2 <= -4e-295) {
		tmp = ((((t_1 * (((0.3333333333333333 * y) * t_0) + -0.5)) * y) - (1.0 - exp(x))) * y) * c;
	} else if (t_2 <= 0.0) {
		tmp = (x * (c + (c * (x * (0.5 + (-0.5 * y)))))) * y;
	} else if (t_2 <= 2e-8) {
		tmp = (c * (t_0 + ((t_1 * -0.5) * y))) * y;
	} else {
		tmp = log(((y * t_0) - -1.0)) * c;
	}
	return tmp;
}
public static double code(double c, double x, double y) {
	double t_0 = Math.exp(x) - 1.0;
	double t_1 = Math.pow(t_0, 2.0);
	double t_2 = (Math.pow(Math.E, x) - 1.0) * y;
	double tmp;
	if (t_2 <= -4e-295) {
		tmp = ((((t_1 * (((0.3333333333333333 * y) * t_0) + -0.5)) * y) - (1.0 - Math.exp(x))) * y) * c;
	} else if (t_2 <= 0.0) {
		tmp = (x * (c + (c * (x * (0.5 + (-0.5 * y)))))) * y;
	} else if (t_2 <= 2e-8) {
		tmp = (c * (t_0 + ((t_1 * -0.5) * y))) * y;
	} else {
		tmp = Math.log(((y * t_0) - -1.0)) * c;
	}
	return tmp;
}
def code(c, x, y):
	t_0 = math.exp(x) - 1.0
	t_1 = math.pow(t_0, 2.0)
	t_2 = (math.pow(math.e, x) - 1.0) * y
	tmp = 0
	if t_2 <= -4e-295:
		tmp = ((((t_1 * (((0.3333333333333333 * y) * t_0) + -0.5)) * y) - (1.0 - math.exp(x))) * y) * c
	elif t_2 <= 0.0:
		tmp = (x * (c + (c * (x * (0.5 + (-0.5 * y)))))) * y
	elif t_2 <= 2e-8:
		tmp = (c * (t_0 + ((t_1 * -0.5) * y))) * y
	else:
		tmp = math.log(((y * t_0) - -1.0)) * c
	return tmp
function code(c, x, y)
	t_0 = Float64(exp(x) - 1.0)
	t_1 = t_0 ^ 2.0
	t_2 = Float64(Float64((exp(1) ^ x) - 1.0) * y)
	tmp = 0.0
	if (t_2 <= -4e-295)
		tmp = Float64(Float64(Float64(Float64(Float64(t_1 * Float64(Float64(Float64(0.3333333333333333 * y) * t_0) + -0.5)) * y) - Float64(1.0 - exp(x))) * y) * c);
	elseif (t_2 <= 0.0)
		tmp = Float64(Float64(x * Float64(c + Float64(c * Float64(x * Float64(0.5 + Float64(-0.5 * y)))))) * y);
	elseif (t_2 <= 2e-8)
		tmp = Float64(Float64(c * Float64(t_0 + Float64(Float64(t_1 * -0.5) * y))) * y);
	else
		tmp = Float64(log(Float64(Float64(y * t_0) - -1.0)) * c);
	end
	return tmp
end
function tmp_2 = code(c, x, y)
	t_0 = exp(x) - 1.0;
	t_1 = t_0 ^ 2.0;
	t_2 = ((2.71828182845904523536 ^ x) - 1.0) * y;
	tmp = 0.0;
	if (t_2 <= -4e-295)
		tmp = ((((t_1 * (((0.3333333333333333 * y) * t_0) + -0.5)) * y) - (1.0 - exp(x))) * y) * c;
	elseif (t_2 <= 0.0)
		tmp = (x * (c + (c * (x * (0.5 + (-0.5 * y)))))) * y;
	elseif (t_2 <= 2e-8)
		tmp = (c * (t_0 + ((t_1 * -0.5) * y))) * y;
	else
		tmp = log(((y * t_0) - -1.0)) * c;
	end
	tmp_2 = tmp;
end
code[c_, x_, y_] := Block[{t$95$0 = N[(N[Exp[x], $MachinePrecision] - 1.0), $MachinePrecision]}, Block[{t$95$1 = N[Power[t$95$0, 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Power[E, x], $MachinePrecision] - 1.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$2, -4e-295], N[(N[(N[(N[(N[(t$95$1 * N[(N[(N[(0.3333333333333333 * y), $MachinePrecision] * t$95$0), $MachinePrecision] + -0.5), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] - N[(1.0 - N[Exp[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(N[(x * N[(c + N[(c * N[(x * N[(0.5 + N[(-0.5 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$2, 2e-8], N[(N[(c * N[(t$95$0 + N[(N[(t$95$1 * -0.5), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[(N[Log[N[(N[(y * t$95$0), $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision] * c), $MachinePrecision]]]]]]]
\begin{array}{l}
t_0 := e^{x} - 1\\
t_1 := {t\_0}^{2}\\
t_2 := \left({e}^{x} - 1\right) \cdot y\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{-295}:\\
\;\;\;\;\left(\left(\left(t\_1 \cdot \left(\left(0.3333333333333333 \cdot y\right) \cdot t\_0 + -0.5\right)\right) \cdot y - \left(1 - e^{x}\right)\right) \cdot y\right) \cdot c\\

\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\left(x \cdot \left(c + c \cdot \left(x \cdot \left(0.5 + -0.5 \cdot y\right)\right)\right)\right) \cdot y\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-8}:\\
\;\;\;\;\left(c \cdot \left(t\_0 + \left(t\_1 \cdot -0.5\right) \cdot y\right)\right) \cdot y\\

\mathbf{else}:\\
\;\;\;\;\log \left(y \cdot t\_0 - -1\right) \cdot c\\


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 (-.f64 (pow.f64 (E.f64) x) #s(literal 1 binary64)) y) < -4.0000000000000002e-295

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto c \cdot \color{blue}{\left(y \cdot \left(\left(y \cdot \left(\frac{-1}{2} \cdot {\left({e}^{x} - 1\right)}^{2} + \frac{1}{3} \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{3}\right)\right) + {e}^{x}\right) - 1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \left(y \cdot \color{blue}{\left(\left(y \cdot \left(\frac{-1}{2} \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2} + \frac{1}{3} \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{3}\right)\right) + {\mathsf{E}\left(\right)}^{x}\right) - 1\right)}\right) \]
      2. lower--.f64N/A

        \[\leadsto c \cdot \left(y \cdot \left(\left(y \cdot \left(\frac{-1}{2} \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2} + \frac{1}{3} \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{3}\right)\right) + {\mathsf{E}\left(\right)}^{x}\right) - \color{blue}{1}\right)\right) \]
    4. Applied rewrites45.4%

      \[\leadsto c \cdot \color{blue}{\left(y \cdot \left(\left(y \cdot \left(-0.5 \cdot {\left({e}^{x} - 1\right)}^{2} + 0.3333333333333333 \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{3}\right)\right) + {e}^{x}\right) - 1\right)\right)} \]
    5. Applied rewrites45.4%

      \[\leadsto \color{blue}{\left(\left(\left({\left(e^{x} - 1\right)}^{2} \cdot \left(\left(0.3333333333333333 \cdot y\right) \cdot \left(e^{x} - 1\right) + -0.5\right)\right) \cdot y - \left(1 - e^{x}\right)\right) \cdot y\right) \cdot c} \]

    if -4.0000000000000002e-295 < (*.f64 (-.f64 (pow.f64 (E.f64) x) #s(literal 1 binary64)) y) < -0.0

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \color{blue}{y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + \color{blue}{c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + \color{blue}{c} \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      6. lower-pow.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      7. lower--.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      8. lower-pow.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      9. lower-E.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      10. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \color{blue}{\left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
    4. Applied rewrites44.9%

      \[\leadsto \color{blue}{y \cdot \left(-0.5 \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
      3. lower-*.f6444.9%

        \[\leadsto \left(-0.5 \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
    6. Applied rewrites44.9%

      \[\leadsto \left(c \cdot \left(\left(e^{x} - 1\right) + \left({\left(e^{x} - 1\right)}^{2} \cdot -0.5\right) \cdot y\right)\right) \cdot \color{blue}{y} \]
    7. Taylor expanded in x around 0

      \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      2. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      4. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      5. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      6. lower-*.f6458.3%

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(0.5 + -0.5 \cdot y\right)\right)\right)\right) \cdot y \]
    9. Applied rewrites58.3%

      \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(0.5 + -0.5 \cdot y\right)\right)\right)\right) \cdot y \]

    if -0.0 < (*.f64 (-.f64 (pow.f64 (E.f64) x) #s(literal 1 binary64)) y) < 2e-8

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \color{blue}{y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + \color{blue}{c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + \color{blue}{c} \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      6. lower-pow.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      7. lower--.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      8. lower-pow.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      9. lower-E.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      10. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \color{blue}{\left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
    4. Applied rewrites44.9%

      \[\leadsto \color{blue}{y \cdot \left(-0.5 \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
      3. lower-*.f6444.9%

        \[\leadsto \left(-0.5 \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
    6. Applied rewrites44.9%

      \[\leadsto \left(c \cdot \left(\left(e^{x} - 1\right) + \left({\left(e^{x} - 1\right)}^{2} \cdot -0.5\right) \cdot y\right)\right) \cdot \color{blue}{y} \]

    if 2e-8 < (*.f64 (-.f64 (pow.f64 (E.f64) x) #s(literal 1 binary64)) y)

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right)} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \cdot c} \]
      3. lower-*.f6441.2%

        \[\leadsto \color{blue}{\log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \cdot c} \]
      4. lift-+.f64N/A

        \[\leadsto \log \color{blue}{\left(1 + \left({e}^{x} - 1\right) \cdot y\right)} \cdot c \]
      5. +-commutativeN/A

        \[\leadsto \log \color{blue}{\left(\left({e}^{x} - 1\right) \cdot y + 1\right)} \cdot c \]
      6. add-flipN/A

        \[\leadsto \log \color{blue}{\left(\left({e}^{x} - 1\right) \cdot y - \left(\mathsf{neg}\left(1\right)\right)\right)} \cdot c \]
      7. lower--.f64N/A

        \[\leadsto \log \color{blue}{\left(\left({e}^{x} - 1\right) \cdot y - \left(\mathsf{neg}\left(1\right)\right)\right)} \cdot c \]
      8. lift-*.f64N/A

        \[\leadsto \log \left(\color{blue}{\left({e}^{x} - 1\right) \cdot y} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      9. *-commutativeN/A

        \[\leadsto \log \left(\color{blue}{y \cdot \left({e}^{x} - 1\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      10. lower-*.f64N/A

        \[\leadsto \log \left(\color{blue}{y \cdot \left({e}^{x} - 1\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      11. lift-pow.f64N/A

        \[\leadsto \log \left(y \cdot \left(\color{blue}{{e}^{x}} - 1\right) - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      12. lift-E.f64N/A

        \[\leadsto \log \left(y \cdot \left({\color{blue}{\mathsf{E}\left(\right)}}^{x} - 1\right) - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      13. e-exp-1N/A

        \[\leadsto \log \left(y \cdot \left({\color{blue}{\left(e^{1}\right)}}^{x} - 1\right) - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      14. pow-expN/A

        \[\leadsto \log \left(y \cdot \left(\color{blue}{e^{1 \cdot x}} - 1\right) - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      15. *-lft-identityN/A

        \[\leadsto \log \left(y \cdot \left(e^{\color{blue}{x}} - 1\right) - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      16. lower-exp.f64N/A

        \[\leadsto \log \left(y \cdot \left(\color{blue}{e^{x}} - 1\right) - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      17. metadata-eval41.2%

        \[\leadsto \log \left(y \cdot \left(e^{x} - 1\right) - \color{blue}{-1}\right) \cdot c \]
    3. Applied rewrites41.2%

      \[\leadsto \color{blue}{\log \left(y \cdot \left(e^{x} - 1\right) - -1\right) \cdot c} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 2: 85.9% accurate, 0.3× speedup?

\[\begin{array}{l} t_0 := e^{x} - 1\\ t_1 := \left({e}^{x} - 1\right) \cdot y\\ t_2 := \left(c \cdot \left(t\_0 + \left({t\_0}^{2} \cdot -0.5\right) \cdot y\right)\right) \cdot y\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{-295}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\left(x \cdot \left(c + c \cdot \left(x \cdot \left(0.5 + -0.5 \cdot y\right)\right)\right)\right) \cdot y\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-8}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\log \left(y \cdot t\_0 - -1\right) \cdot c\\ \end{array} \]
(FPCore (c x y)
  :precision binary64
  (let* ((t_0 (- (exp x) 1.0))
       (t_1 (* (- (pow E x) 1.0) y))
       (t_2 (* (* c (+ t_0 (* (* (pow t_0 2.0) -0.5) y))) y)))
  (if (<= t_1 -4e-295)
    t_2
    (if (<= t_1 0.0)
      (* (* x (+ c (* c (* x (+ 0.5 (* -0.5 y)))))) y)
      (if (<= t_1 2e-8) t_2 (* (log (- (* y t_0) -1.0)) c))))))
double code(double c, double x, double y) {
	double t_0 = exp(x) - 1.0;
	double t_1 = (pow(((double) M_E), x) - 1.0) * y;
	double t_2 = (c * (t_0 + ((pow(t_0, 2.0) * -0.5) * y))) * y;
	double tmp;
	if (t_1 <= -4e-295) {
		tmp = t_2;
	} else if (t_1 <= 0.0) {
		tmp = (x * (c + (c * (x * (0.5 + (-0.5 * y)))))) * y;
	} else if (t_1 <= 2e-8) {
		tmp = t_2;
	} else {
		tmp = log(((y * t_0) - -1.0)) * c;
	}
	return tmp;
}
public static double code(double c, double x, double y) {
	double t_0 = Math.exp(x) - 1.0;
	double t_1 = (Math.pow(Math.E, x) - 1.0) * y;
	double t_2 = (c * (t_0 + ((Math.pow(t_0, 2.0) * -0.5) * y))) * y;
	double tmp;
	if (t_1 <= -4e-295) {
		tmp = t_2;
	} else if (t_1 <= 0.0) {
		tmp = (x * (c + (c * (x * (0.5 + (-0.5 * y)))))) * y;
	} else if (t_1 <= 2e-8) {
		tmp = t_2;
	} else {
		tmp = Math.log(((y * t_0) - -1.0)) * c;
	}
	return tmp;
}
def code(c, x, y):
	t_0 = math.exp(x) - 1.0
	t_1 = (math.pow(math.e, x) - 1.0) * y
	t_2 = (c * (t_0 + ((math.pow(t_0, 2.0) * -0.5) * y))) * y
	tmp = 0
	if t_1 <= -4e-295:
		tmp = t_2
	elif t_1 <= 0.0:
		tmp = (x * (c + (c * (x * (0.5 + (-0.5 * y)))))) * y
	elif t_1 <= 2e-8:
		tmp = t_2
	else:
		tmp = math.log(((y * t_0) - -1.0)) * c
	return tmp
function code(c, x, y)
	t_0 = Float64(exp(x) - 1.0)
	t_1 = Float64(Float64((exp(1) ^ x) - 1.0) * y)
	t_2 = Float64(Float64(c * Float64(t_0 + Float64(Float64((t_0 ^ 2.0) * -0.5) * y))) * y)
	tmp = 0.0
	if (t_1 <= -4e-295)
		tmp = t_2;
	elseif (t_1 <= 0.0)
		tmp = Float64(Float64(x * Float64(c + Float64(c * Float64(x * Float64(0.5 + Float64(-0.5 * y)))))) * y);
	elseif (t_1 <= 2e-8)
		tmp = t_2;
	else
		tmp = Float64(log(Float64(Float64(y * t_0) - -1.0)) * c);
	end
	return tmp
end
function tmp_2 = code(c, x, y)
	t_0 = exp(x) - 1.0;
	t_1 = ((2.71828182845904523536 ^ x) - 1.0) * y;
	t_2 = (c * (t_0 + (((t_0 ^ 2.0) * -0.5) * y))) * y;
	tmp = 0.0;
	if (t_1 <= -4e-295)
		tmp = t_2;
	elseif (t_1 <= 0.0)
		tmp = (x * (c + (c * (x * (0.5 + (-0.5 * y)))))) * y;
	elseif (t_1 <= 2e-8)
		tmp = t_2;
	else
		tmp = log(((y * t_0) - -1.0)) * c;
	end
	tmp_2 = tmp;
end
code[c_, x_, y_] := Block[{t$95$0 = N[(N[Exp[x], $MachinePrecision] - 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[E, x], $MachinePrecision] - 1.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * N[(t$95$0 + N[(N[(N[Power[t$95$0, 2.0], $MachinePrecision] * -0.5), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -4e-295], t$95$2, If[LessEqual[t$95$1, 0.0], N[(N[(x * N[(c + N[(c * N[(x * N[(0.5 + N[(-0.5 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, 2e-8], t$95$2, N[(N[Log[N[(N[(y * t$95$0), $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision] * c), $MachinePrecision]]]]]]]
\begin{array}{l}
t_0 := e^{x} - 1\\
t_1 := \left({e}^{x} - 1\right) \cdot y\\
t_2 := \left(c \cdot \left(t\_0 + \left({t\_0}^{2} \cdot -0.5\right) \cdot y\right)\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-295}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\left(x \cdot \left(c + c \cdot \left(x \cdot \left(0.5 + -0.5 \cdot y\right)\right)\right)\right) \cdot y\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-8}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;\log \left(y \cdot t\_0 - -1\right) \cdot c\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (-.f64 (pow.f64 (E.f64) x) #s(literal 1 binary64)) y) < -4.0000000000000002e-295 or -0.0 < (*.f64 (-.f64 (pow.f64 (E.f64) x) #s(literal 1 binary64)) y) < 2e-8

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \color{blue}{y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + \color{blue}{c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + \color{blue}{c} \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      6. lower-pow.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      7. lower--.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      8. lower-pow.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      9. lower-E.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      10. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \color{blue}{\left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
    4. Applied rewrites44.9%

      \[\leadsto \color{blue}{y \cdot \left(-0.5 \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
      3. lower-*.f6444.9%

        \[\leadsto \left(-0.5 \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
    6. Applied rewrites44.9%

      \[\leadsto \left(c \cdot \left(\left(e^{x} - 1\right) + \left({\left(e^{x} - 1\right)}^{2} \cdot -0.5\right) \cdot y\right)\right) \cdot \color{blue}{y} \]

    if -4.0000000000000002e-295 < (*.f64 (-.f64 (pow.f64 (E.f64) x) #s(literal 1 binary64)) y) < -0.0

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \color{blue}{y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + \color{blue}{c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + \color{blue}{c} \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      6. lower-pow.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      7. lower--.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      8. lower-pow.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      9. lower-E.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      10. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \color{blue}{\left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
    4. Applied rewrites44.9%

      \[\leadsto \color{blue}{y \cdot \left(-0.5 \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
      3. lower-*.f6444.9%

        \[\leadsto \left(-0.5 \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
    6. Applied rewrites44.9%

      \[\leadsto \left(c \cdot \left(\left(e^{x} - 1\right) + \left({\left(e^{x} - 1\right)}^{2} \cdot -0.5\right) \cdot y\right)\right) \cdot \color{blue}{y} \]
    7. Taylor expanded in x around 0

      \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      2. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      4. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      5. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      6. lower-*.f6458.3%

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(0.5 + -0.5 \cdot y\right)\right)\right)\right) \cdot y \]
    9. Applied rewrites58.3%

      \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(0.5 + -0.5 \cdot y\right)\right)\right)\right) \cdot y \]

    if 2e-8 < (*.f64 (-.f64 (pow.f64 (E.f64) x) #s(literal 1 binary64)) y)

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right)} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \cdot c} \]
      3. lower-*.f6441.2%

        \[\leadsto \color{blue}{\log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \cdot c} \]
      4. lift-+.f64N/A

        \[\leadsto \log \color{blue}{\left(1 + \left({e}^{x} - 1\right) \cdot y\right)} \cdot c \]
      5. +-commutativeN/A

        \[\leadsto \log \color{blue}{\left(\left({e}^{x} - 1\right) \cdot y + 1\right)} \cdot c \]
      6. add-flipN/A

        \[\leadsto \log \color{blue}{\left(\left({e}^{x} - 1\right) \cdot y - \left(\mathsf{neg}\left(1\right)\right)\right)} \cdot c \]
      7. lower--.f64N/A

        \[\leadsto \log \color{blue}{\left(\left({e}^{x} - 1\right) \cdot y - \left(\mathsf{neg}\left(1\right)\right)\right)} \cdot c \]
      8. lift-*.f64N/A

        \[\leadsto \log \left(\color{blue}{\left({e}^{x} - 1\right) \cdot y} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      9. *-commutativeN/A

        \[\leadsto \log \left(\color{blue}{y \cdot \left({e}^{x} - 1\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      10. lower-*.f64N/A

        \[\leadsto \log \left(\color{blue}{y \cdot \left({e}^{x} - 1\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      11. lift-pow.f64N/A

        \[\leadsto \log \left(y \cdot \left(\color{blue}{{e}^{x}} - 1\right) - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      12. lift-E.f64N/A

        \[\leadsto \log \left(y \cdot \left({\color{blue}{\mathsf{E}\left(\right)}}^{x} - 1\right) - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      13. e-exp-1N/A

        \[\leadsto \log \left(y \cdot \left({\color{blue}{\left(e^{1}\right)}}^{x} - 1\right) - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      14. pow-expN/A

        \[\leadsto \log \left(y \cdot \left(\color{blue}{e^{1 \cdot x}} - 1\right) - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      15. *-lft-identityN/A

        \[\leadsto \log \left(y \cdot \left(e^{\color{blue}{x}} - 1\right) - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      16. lower-exp.f64N/A

        \[\leadsto \log \left(y \cdot \left(\color{blue}{e^{x}} - 1\right) - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      17. metadata-eval41.2%

        \[\leadsto \log \left(y \cdot \left(e^{x} - 1\right) - \color{blue}{-1}\right) \cdot c \]
    3. Applied rewrites41.2%

      \[\leadsto \color{blue}{\log \left(y \cdot \left(e^{x} - 1\right) - -1\right) \cdot c} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 3: 85.5% accurate, 0.3× speedup?

\[\begin{array}{l} t_0 := \left({e}^{x} - 1\right) \cdot y\\ \mathbf{if}\;t\_0 \leq -4 \cdot 10^{-295}:\\ \;\;\;\;c \cdot \left(y \cdot \frac{e^{x + x} - 1}{e^{x} + 1}\right)\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\left(x \cdot \left(c + c \cdot \left(x \cdot \left(0.5 + -0.5 \cdot y\right)\right)\right)\right) \cdot y\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-22}:\\ \;\;\;\;\left(y \cdot c\right) \cdot e^{x} - \left(y \cdot c\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(\log \left(\left(y \cdot \left(e^{x} - 1\right)\right) \cdot 2 + 2\right) - \log 2\right)\\ \end{array} \]
(FPCore (c x y)
  :precision binary64
  (let* ((t_0 (* (- (pow E x) 1.0) y)))
  (if (<= t_0 -4e-295)
    (* c (* y (/ (- (exp (+ x x)) 1.0) (+ (exp x) 1.0))))
    (if (<= t_0 0.0)
      (* (* x (+ c (* c (* x (+ 0.5 (* -0.5 y)))))) y)
      (if (<= t_0 2e-22)
        (- (* (* y c) (exp x)) (* (* y c) 1.0))
        (*
         c
         (-
          (log (+ (* (* y (- (exp x) 1.0)) 2.0) 2.0))
          (log 2.0))))))))
double code(double c, double x, double y) {
	double t_0 = (pow(((double) M_E), x) - 1.0) * y;
	double tmp;
	if (t_0 <= -4e-295) {
		tmp = c * (y * ((exp((x + x)) - 1.0) / (exp(x) + 1.0)));
	} else if (t_0 <= 0.0) {
		tmp = (x * (c + (c * (x * (0.5 + (-0.5 * y)))))) * y;
	} else if (t_0 <= 2e-22) {
		tmp = ((y * c) * exp(x)) - ((y * c) * 1.0);
	} else {
		tmp = c * (log((((y * (exp(x) - 1.0)) * 2.0) + 2.0)) - log(2.0));
	}
	return tmp;
}
public static double code(double c, double x, double y) {
	double t_0 = (Math.pow(Math.E, x) - 1.0) * y;
	double tmp;
	if (t_0 <= -4e-295) {
		tmp = c * (y * ((Math.exp((x + x)) - 1.0) / (Math.exp(x) + 1.0)));
	} else if (t_0 <= 0.0) {
		tmp = (x * (c + (c * (x * (0.5 + (-0.5 * y)))))) * y;
	} else if (t_0 <= 2e-22) {
		tmp = ((y * c) * Math.exp(x)) - ((y * c) * 1.0);
	} else {
		tmp = c * (Math.log((((y * (Math.exp(x) - 1.0)) * 2.0) + 2.0)) - Math.log(2.0));
	}
	return tmp;
}
def code(c, x, y):
	t_0 = (math.pow(math.e, x) - 1.0) * y
	tmp = 0
	if t_0 <= -4e-295:
		tmp = c * (y * ((math.exp((x + x)) - 1.0) / (math.exp(x) + 1.0)))
	elif t_0 <= 0.0:
		tmp = (x * (c + (c * (x * (0.5 + (-0.5 * y)))))) * y
	elif t_0 <= 2e-22:
		tmp = ((y * c) * math.exp(x)) - ((y * c) * 1.0)
	else:
		tmp = c * (math.log((((y * (math.exp(x) - 1.0)) * 2.0) + 2.0)) - math.log(2.0))
	return tmp
function code(c, x, y)
	t_0 = Float64(Float64((exp(1) ^ x) - 1.0) * y)
	tmp = 0.0
	if (t_0 <= -4e-295)
		tmp = Float64(c * Float64(y * Float64(Float64(exp(Float64(x + x)) - 1.0) / Float64(exp(x) + 1.0))));
	elseif (t_0 <= 0.0)
		tmp = Float64(Float64(x * Float64(c + Float64(c * Float64(x * Float64(0.5 + Float64(-0.5 * y)))))) * y);
	elseif (t_0 <= 2e-22)
		tmp = Float64(Float64(Float64(y * c) * exp(x)) - Float64(Float64(y * c) * 1.0));
	else
		tmp = Float64(c * Float64(log(Float64(Float64(Float64(y * Float64(exp(x) - 1.0)) * 2.0) + 2.0)) - log(2.0)));
	end
	return tmp
end
function tmp_2 = code(c, x, y)
	t_0 = ((2.71828182845904523536 ^ x) - 1.0) * y;
	tmp = 0.0;
	if (t_0 <= -4e-295)
		tmp = c * (y * ((exp((x + x)) - 1.0) / (exp(x) + 1.0)));
	elseif (t_0 <= 0.0)
		tmp = (x * (c + (c * (x * (0.5 + (-0.5 * y)))))) * y;
	elseif (t_0 <= 2e-22)
		tmp = ((y * c) * exp(x)) - ((y * c) * 1.0);
	else
		tmp = c * (log((((y * (exp(x) - 1.0)) * 2.0) + 2.0)) - log(2.0));
	end
	tmp_2 = tmp;
end
code[c_, x_, y_] := Block[{t$95$0 = N[(N[(N[Power[E, x], $MachinePrecision] - 1.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$0, -4e-295], N[(c * N[(y * N[(N[(N[Exp[N[(x + x), $MachinePrecision]], $MachinePrecision] - 1.0), $MachinePrecision] / N[(N[Exp[x], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(x * N[(c + N[(c * N[(x * N[(0.5 + N[(-0.5 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 2e-22], N[(N[(N[(y * c), $MachinePrecision] * N[Exp[x], $MachinePrecision]), $MachinePrecision] - N[(N[(y * c), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision], N[(c * N[(N[Log[N[(N[(N[(y * N[(N[Exp[x], $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] + 2.0), $MachinePrecision]], $MachinePrecision] - N[Log[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left({e}^{x} - 1\right) \cdot y\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-295}:\\
\;\;\;\;c \cdot \left(y \cdot \frac{e^{x + x} - 1}{e^{x} + 1}\right)\\

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(x \cdot \left(c + c \cdot \left(x \cdot \left(0.5 + -0.5 \cdot y\right)\right)\right)\right) \cdot y\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-22}:\\
\;\;\;\;\left(y \cdot c\right) \cdot e^{x} - \left(y \cdot c\right) \cdot 1\\

\mathbf{else}:\\
\;\;\;\;c \cdot \left(\log \left(\left(y \cdot \left(e^{x} - 1\right)\right) \cdot 2 + 2\right) - \log 2\right)\\


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 (-.f64 (pow.f64 (E.f64) x) #s(literal 1 binary64)) y) < -4.0000000000000002e-295

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \color{blue}{c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto c \cdot \left(y \cdot \color{blue}{\left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto c \cdot \left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - \color{blue}{1}\right)\right) \]
      4. lower-pow.f64N/A

        \[\leadsto c \cdot \left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      5. lower-E.f6445.3%

        \[\leadsto c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right) \]
    4. Applied rewrites45.3%

      \[\leadsto \color{blue}{c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto c \cdot \left(y \cdot \left({e}^{x} - \color{blue}{1}\right)\right) \]
      2. flip--N/A

        \[\leadsto c \cdot \left(y \cdot \frac{{e}^{x} \cdot {e}^{x} - 1 \cdot 1}{\color{blue}{{e}^{x} + 1}}\right) \]
      3. lower-unsound-/.f64N/A

        \[\leadsto c \cdot \left(y \cdot \frac{{e}^{x} \cdot {e}^{x} - 1 \cdot 1}{\color{blue}{{e}^{x} + 1}}\right) \]
    6. Applied rewrites45.3%

      \[\leadsto c \cdot \left(y \cdot \frac{e^{x + x} - 1}{\color{blue}{e^{x} + 1}}\right) \]

    if -4.0000000000000002e-295 < (*.f64 (-.f64 (pow.f64 (E.f64) x) #s(literal 1 binary64)) y) < -0.0

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \color{blue}{y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + \color{blue}{c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + \color{blue}{c} \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      6. lower-pow.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      7. lower--.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      8. lower-pow.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      9. lower-E.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      10. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \color{blue}{\left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
    4. Applied rewrites44.9%

      \[\leadsto \color{blue}{y \cdot \left(-0.5 \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
      3. lower-*.f6444.9%

        \[\leadsto \left(-0.5 \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
    6. Applied rewrites44.9%

      \[\leadsto \left(c \cdot \left(\left(e^{x} - 1\right) + \left({\left(e^{x} - 1\right)}^{2} \cdot -0.5\right) \cdot y\right)\right) \cdot \color{blue}{y} \]
    7. Taylor expanded in x around 0

      \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      2. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      4. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      5. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      6. lower-*.f6458.3%

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(0.5 + -0.5 \cdot y\right)\right)\right)\right) \cdot y \]
    9. Applied rewrites58.3%

      \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(0.5 + -0.5 \cdot y\right)\right)\right)\right) \cdot y \]

    if -0.0 < (*.f64 (-.f64 (pow.f64 (E.f64) x) #s(literal 1 binary64)) y) < 2.0000000000000001e-22

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \color{blue}{c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto c \cdot \left(y \cdot \color{blue}{\left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto c \cdot \left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - \color{blue}{1}\right)\right) \]
      4. lower-pow.f64N/A

        \[\leadsto c \cdot \left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      5. lower-E.f6445.3%

        \[\leadsto c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right) \]
    4. Applied rewrites45.3%

      \[\leadsto \color{blue}{c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(y \cdot \left({e}^{x} - 1\right)\right)} \]
      2. lift-*.f64N/A

        \[\leadsto c \cdot \left(y \cdot \color{blue}{\left({e}^{x} - 1\right)}\right) \]
      3. associate-*r*N/A

        \[\leadsto \left(c \cdot y\right) \cdot \color{blue}{\left({e}^{x} - 1\right)} \]
      4. lift--.f64N/A

        \[\leadsto \left(c \cdot y\right) \cdot \left({e}^{x} - \color{blue}{1}\right) \]
      5. sub-flipN/A

        \[\leadsto \left(c \cdot y\right) \cdot \left({e}^{x} + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \]
      6. distribute-lft-inN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} + \color{blue}{\left(c \cdot y\right) \cdot \left(\mathsf{neg}\left(1\right)\right)} \]
      7. add-flipN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \color{blue}{\left(\mathsf{neg}\left(\left(c \cdot y\right) \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right)} \]
      8. distribute-rgt-neg-outN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \left(c \cdot y\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(1\right)\right)\right)\right)} \]
      9. metadata-evalN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \left(c \cdot y\right) \cdot \left(\mathsf{neg}\left(-1\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \left(c \cdot y\right) \cdot 1 \]
      11. lower--.f64N/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \color{blue}{\left(c \cdot y\right) \cdot 1} \]
      12. lower-*.f64N/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \color{blue}{\left(c \cdot y\right)} \cdot 1 \]
      13. *-commutativeN/A

        \[\leadsto \left(y \cdot c\right) \cdot {e}^{x} - \left(\color{blue}{c} \cdot y\right) \cdot 1 \]
      14. lower-*.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot {e}^{x} - \left(\color{blue}{c} \cdot y\right) \cdot 1 \]
      15. lift-pow.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot {e}^{x} - \left(c \cdot \color{blue}{y}\right) \cdot 1 \]
      16. lift-E.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot {\mathsf{E}\left(\right)}^{x} - \left(c \cdot y\right) \cdot 1 \]
      17. e-exp-1N/A

        \[\leadsto \left(y \cdot c\right) \cdot {\left(e^{1}\right)}^{x} - \left(c \cdot y\right) \cdot 1 \]
      18. pow-expN/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{1 \cdot x} - \left(c \cdot \color{blue}{y}\right) \cdot 1 \]
      19. *-lft-identityN/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(c \cdot y\right) \cdot 1 \]
      20. lower-exp.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(c \cdot \color{blue}{y}\right) \cdot 1 \]
      21. lower-*.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(c \cdot y\right) \cdot \color{blue}{1} \]
      22. *-commutativeN/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(y \cdot c\right) \cdot 1 \]
      23. lower-*.f6445.0%

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(y \cdot c\right) \cdot 1 \]
    6. Applied rewrites45.0%

      \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \color{blue}{\left(y \cdot c\right) \cdot 1} \]

    if 2.0000000000000001e-22 < (*.f64 (-.f64 (pow.f64 (E.f64) x) #s(literal 1 binary64)) y)

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Step-by-step derivation
      1. lift-log.f64N/A

        \[\leadsto c \cdot \color{blue}{\log \left(1 + \left({e}^{x} - 1\right) \cdot y\right)} \]
      2. lift-+.f64N/A

        \[\leadsto c \cdot \log \color{blue}{\left(1 + \left({e}^{x} - 1\right) \cdot y\right)} \]
      3. +-commutativeN/A

        \[\leadsto c \cdot \log \color{blue}{\left(\left({e}^{x} - 1\right) \cdot y + 1\right)} \]
      4. metadata-evalN/A

        \[\leadsto c \cdot \log \left(\left({e}^{x} - 1\right) \cdot y + \color{blue}{\frac{2}{2}}\right) \]
      5. add-to-fractionN/A

        \[\leadsto c \cdot \log \color{blue}{\left(\frac{\left(\left({e}^{x} - 1\right) \cdot y\right) \cdot 2 + 2}{2}\right)} \]
      6. log-divN/A

        \[\leadsto c \cdot \color{blue}{\left(\log \left(\left(\left({e}^{x} - 1\right) \cdot y\right) \cdot 2 + 2\right) - \log 2\right)} \]
      7. lower-unsound--.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(\log \left(\left(\left({e}^{x} - 1\right) \cdot y\right) \cdot 2 + 2\right) - \log 2\right)} \]
    3. Applied rewrites41.2%

      \[\leadsto c \cdot \color{blue}{\left(\log \left(\left(y \cdot \left(e^{x} - 1\right)\right) \cdot 2 + 2\right) - \log 2\right)} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 4: 85.5% accurate, 0.4× speedup?

\[\begin{array}{l} t_0 := \left({e}^{x} - 1\right) \cdot y\\ \mathbf{if}\;t\_0 \leq -4 \cdot 10^{-295}:\\ \;\;\;\;c \cdot \left(y \cdot \frac{e^{x + x} - 1}{e^{x} + 1}\right)\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\left(x \cdot \left(c + c \cdot \left(x \cdot \left(0.5 + -0.5 \cdot y\right)\right)\right)\right) \cdot y\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-22}:\\ \;\;\;\;\left(y \cdot c\right) \cdot e^{x} - \left(y \cdot c\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\log \left(y \cdot \left(e^{x} - 1\right) - -1\right) \cdot c\\ \end{array} \]
(FPCore (c x y)
  :precision binary64
  (let* ((t_0 (* (- (pow E x) 1.0) y)))
  (if (<= t_0 -4e-295)
    (* c (* y (/ (- (exp (+ x x)) 1.0) (+ (exp x) 1.0))))
    (if (<= t_0 0.0)
      (* (* x (+ c (* c (* x (+ 0.5 (* -0.5 y)))))) y)
      (if (<= t_0 2e-22)
        (- (* (* y c) (exp x)) (* (* y c) 1.0))
        (* (log (- (* y (- (exp x) 1.0)) -1.0)) c))))))
double code(double c, double x, double y) {
	double t_0 = (pow(((double) M_E), x) - 1.0) * y;
	double tmp;
	if (t_0 <= -4e-295) {
		tmp = c * (y * ((exp((x + x)) - 1.0) / (exp(x) + 1.0)));
	} else if (t_0 <= 0.0) {
		tmp = (x * (c + (c * (x * (0.5 + (-0.5 * y)))))) * y;
	} else if (t_0 <= 2e-22) {
		tmp = ((y * c) * exp(x)) - ((y * c) * 1.0);
	} else {
		tmp = log(((y * (exp(x) - 1.0)) - -1.0)) * c;
	}
	return tmp;
}
public static double code(double c, double x, double y) {
	double t_0 = (Math.pow(Math.E, x) - 1.0) * y;
	double tmp;
	if (t_0 <= -4e-295) {
		tmp = c * (y * ((Math.exp((x + x)) - 1.0) / (Math.exp(x) + 1.0)));
	} else if (t_0 <= 0.0) {
		tmp = (x * (c + (c * (x * (0.5 + (-0.5 * y)))))) * y;
	} else if (t_0 <= 2e-22) {
		tmp = ((y * c) * Math.exp(x)) - ((y * c) * 1.0);
	} else {
		tmp = Math.log(((y * (Math.exp(x) - 1.0)) - -1.0)) * c;
	}
	return tmp;
}
def code(c, x, y):
	t_0 = (math.pow(math.e, x) - 1.0) * y
	tmp = 0
	if t_0 <= -4e-295:
		tmp = c * (y * ((math.exp((x + x)) - 1.0) / (math.exp(x) + 1.0)))
	elif t_0 <= 0.0:
		tmp = (x * (c + (c * (x * (0.5 + (-0.5 * y)))))) * y
	elif t_0 <= 2e-22:
		tmp = ((y * c) * math.exp(x)) - ((y * c) * 1.0)
	else:
		tmp = math.log(((y * (math.exp(x) - 1.0)) - -1.0)) * c
	return tmp
function code(c, x, y)
	t_0 = Float64(Float64((exp(1) ^ x) - 1.0) * y)
	tmp = 0.0
	if (t_0 <= -4e-295)
		tmp = Float64(c * Float64(y * Float64(Float64(exp(Float64(x + x)) - 1.0) / Float64(exp(x) + 1.0))));
	elseif (t_0 <= 0.0)
		tmp = Float64(Float64(x * Float64(c + Float64(c * Float64(x * Float64(0.5 + Float64(-0.5 * y)))))) * y);
	elseif (t_0 <= 2e-22)
		tmp = Float64(Float64(Float64(y * c) * exp(x)) - Float64(Float64(y * c) * 1.0));
	else
		tmp = Float64(log(Float64(Float64(y * Float64(exp(x) - 1.0)) - -1.0)) * c);
	end
	return tmp
end
function tmp_2 = code(c, x, y)
	t_0 = ((2.71828182845904523536 ^ x) - 1.0) * y;
	tmp = 0.0;
	if (t_0 <= -4e-295)
		tmp = c * (y * ((exp((x + x)) - 1.0) / (exp(x) + 1.0)));
	elseif (t_0 <= 0.0)
		tmp = (x * (c + (c * (x * (0.5 + (-0.5 * y)))))) * y;
	elseif (t_0 <= 2e-22)
		tmp = ((y * c) * exp(x)) - ((y * c) * 1.0);
	else
		tmp = log(((y * (exp(x) - 1.0)) - -1.0)) * c;
	end
	tmp_2 = tmp;
end
code[c_, x_, y_] := Block[{t$95$0 = N[(N[(N[Power[E, x], $MachinePrecision] - 1.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$0, -4e-295], N[(c * N[(y * N[(N[(N[Exp[N[(x + x), $MachinePrecision]], $MachinePrecision] - 1.0), $MachinePrecision] / N[(N[Exp[x], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(x * N[(c + N[(c * N[(x * N[(0.5 + N[(-0.5 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 2e-22], N[(N[(N[(y * c), $MachinePrecision] * N[Exp[x], $MachinePrecision]), $MachinePrecision] - N[(N[(y * c), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision], N[(N[Log[N[(N[(y * N[(N[Exp[x], $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision] * c), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left({e}^{x} - 1\right) \cdot y\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-295}:\\
\;\;\;\;c \cdot \left(y \cdot \frac{e^{x + x} - 1}{e^{x} + 1}\right)\\

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(x \cdot \left(c + c \cdot \left(x \cdot \left(0.5 + -0.5 \cdot y\right)\right)\right)\right) \cdot y\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-22}:\\
\;\;\;\;\left(y \cdot c\right) \cdot e^{x} - \left(y \cdot c\right) \cdot 1\\

\mathbf{else}:\\
\;\;\;\;\log \left(y \cdot \left(e^{x} - 1\right) - -1\right) \cdot c\\


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 (-.f64 (pow.f64 (E.f64) x) #s(literal 1 binary64)) y) < -4.0000000000000002e-295

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \color{blue}{c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto c \cdot \left(y \cdot \color{blue}{\left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto c \cdot \left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - \color{blue}{1}\right)\right) \]
      4. lower-pow.f64N/A

        \[\leadsto c \cdot \left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      5. lower-E.f6445.3%

        \[\leadsto c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right) \]
    4. Applied rewrites45.3%

      \[\leadsto \color{blue}{c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto c \cdot \left(y \cdot \left({e}^{x} - \color{blue}{1}\right)\right) \]
      2. flip--N/A

        \[\leadsto c \cdot \left(y \cdot \frac{{e}^{x} \cdot {e}^{x} - 1 \cdot 1}{\color{blue}{{e}^{x} + 1}}\right) \]
      3. lower-unsound-/.f64N/A

        \[\leadsto c \cdot \left(y \cdot \frac{{e}^{x} \cdot {e}^{x} - 1 \cdot 1}{\color{blue}{{e}^{x} + 1}}\right) \]
    6. Applied rewrites45.3%

      \[\leadsto c \cdot \left(y \cdot \frac{e^{x + x} - 1}{\color{blue}{e^{x} + 1}}\right) \]

    if -4.0000000000000002e-295 < (*.f64 (-.f64 (pow.f64 (E.f64) x) #s(literal 1 binary64)) y) < -0.0

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \color{blue}{y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + \color{blue}{c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + \color{blue}{c} \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      6. lower-pow.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      7. lower--.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      8. lower-pow.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      9. lower-E.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      10. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \color{blue}{\left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
    4. Applied rewrites44.9%

      \[\leadsto \color{blue}{y \cdot \left(-0.5 \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
      3. lower-*.f6444.9%

        \[\leadsto \left(-0.5 \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
    6. Applied rewrites44.9%

      \[\leadsto \left(c \cdot \left(\left(e^{x} - 1\right) + \left({\left(e^{x} - 1\right)}^{2} \cdot -0.5\right) \cdot y\right)\right) \cdot \color{blue}{y} \]
    7. Taylor expanded in x around 0

      \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      2. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      4. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      5. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      6. lower-*.f6458.3%

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(0.5 + -0.5 \cdot y\right)\right)\right)\right) \cdot y \]
    9. Applied rewrites58.3%

      \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(0.5 + -0.5 \cdot y\right)\right)\right)\right) \cdot y \]

    if -0.0 < (*.f64 (-.f64 (pow.f64 (E.f64) x) #s(literal 1 binary64)) y) < 2.0000000000000001e-22

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \color{blue}{c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto c \cdot \left(y \cdot \color{blue}{\left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto c \cdot \left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - \color{blue}{1}\right)\right) \]
      4. lower-pow.f64N/A

        \[\leadsto c \cdot \left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      5. lower-E.f6445.3%

        \[\leadsto c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right) \]
    4. Applied rewrites45.3%

      \[\leadsto \color{blue}{c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(y \cdot \left({e}^{x} - 1\right)\right)} \]
      2. lift-*.f64N/A

        \[\leadsto c \cdot \left(y \cdot \color{blue}{\left({e}^{x} - 1\right)}\right) \]
      3. associate-*r*N/A

        \[\leadsto \left(c \cdot y\right) \cdot \color{blue}{\left({e}^{x} - 1\right)} \]
      4. lift--.f64N/A

        \[\leadsto \left(c \cdot y\right) \cdot \left({e}^{x} - \color{blue}{1}\right) \]
      5. sub-flipN/A

        \[\leadsto \left(c \cdot y\right) \cdot \left({e}^{x} + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \]
      6. distribute-lft-inN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} + \color{blue}{\left(c \cdot y\right) \cdot \left(\mathsf{neg}\left(1\right)\right)} \]
      7. add-flipN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \color{blue}{\left(\mathsf{neg}\left(\left(c \cdot y\right) \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right)} \]
      8. distribute-rgt-neg-outN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \left(c \cdot y\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(1\right)\right)\right)\right)} \]
      9. metadata-evalN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \left(c \cdot y\right) \cdot \left(\mathsf{neg}\left(-1\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \left(c \cdot y\right) \cdot 1 \]
      11. lower--.f64N/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \color{blue}{\left(c \cdot y\right) \cdot 1} \]
      12. lower-*.f64N/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \color{blue}{\left(c \cdot y\right)} \cdot 1 \]
      13. *-commutativeN/A

        \[\leadsto \left(y \cdot c\right) \cdot {e}^{x} - \left(\color{blue}{c} \cdot y\right) \cdot 1 \]
      14. lower-*.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot {e}^{x} - \left(\color{blue}{c} \cdot y\right) \cdot 1 \]
      15. lift-pow.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot {e}^{x} - \left(c \cdot \color{blue}{y}\right) \cdot 1 \]
      16. lift-E.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot {\mathsf{E}\left(\right)}^{x} - \left(c \cdot y\right) \cdot 1 \]
      17. e-exp-1N/A

        \[\leadsto \left(y \cdot c\right) \cdot {\left(e^{1}\right)}^{x} - \left(c \cdot y\right) \cdot 1 \]
      18. pow-expN/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{1 \cdot x} - \left(c \cdot \color{blue}{y}\right) \cdot 1 \]
      19. *-lft-identityN/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(c \cdot y\right) \cdot 1 \]
      20. lower-exp.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(c \cdot \color{blue}{y}\right) \cdot 1 \]
      21. lower-*.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(c \cdot y\right) \cdot \color{blue}{1} \]
      22. *-commutativeN/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(y \cdot c\right) \cdot 1 \]
      23. lower-*.f6445.0%

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(y \cdot c\right) \cdot 1 \]
    6. Applied rewrites45.0%

      \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \color{blue}{\left(y \cdot c\right) \cdot 1} \]

    if 2.0000000000000001e-22 < (*.f64 (-.f64 (pow.f64 (E.f64) x) #s(literal 1 binary64)) y)

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right)} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \cdot c} \]
      3. lower-*.f6441.2%

        \[\leadsto \color{blue}{\log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \cdot c} \]
      4. lift-+.f64N/A

        \[\leadsto \log \color{blue}{\left(1 + \left({e}^{x} - 1\right) \cdot y\right)} \cdot c \]
      5. +-commutativeN/A

        \[\leadsto \log \color{blue}{\left(\left({e}^{x} - 1\right) \cdot y + 1\right)} \cdot c \]
      6. add-flipN/A

        \[\leadsto \log \color{blue}{\left(\left({e}^{x} - 1\right) \cdot y - \left(\mathsf{neg}\left(1\right)\right)\right)} \cdot c \]
      7. lower--.f64N/A

        \[\leadsto \log \color{blue}{\left(\left({e}^{x} - 1\right) \cdot y - \left(\mathsf{neg}\left(1\right)\right)\right)} \cdot c \]
      8. lift-*.f64N/A

        \[\leadsto \log \left(\color{blue}{\left({e}^{x} - 1\right) \cdot y} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      9. *-commutativeN/A

        \[\leadsto \log \left(\color{blue}{y \cdot \left({e}^{x} - 1\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      10. lower-*.f64N/A

        \[\leadsto \log \left(\color{blue}{y \cdot \left({e}^{x} - 1\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      11. lift-pow.f64N/A

        \[\leadsto \log \left(y \cdot \left(\color{blue}{{e}^{x}} - 1\right) - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      12. lift-E.f64N/A

        \[\leadsto \log \left(y \cdot \left({\color{blue}{\mathsf{E}\left(\right)}}^{x} - 1\right) - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      13. e-exp-1N/A

        \[\leadsto \log \left(y \cdot \left({\color{blue}{\left(e^{1}\right)}}^{x} - 1\right) - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      14. pow-expN/A

        \[\leadsto \log \left(y \cdot \left(\color{blue}{e^{1 \cdot x}} - 1\right) - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      15. *-lft-identityN/A

        \[\leadsto \log \left(y \cdot \left(e^{\color{blue}{x}} - 1\right) - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      16. lower-exp.f64N/A

        \[\leadsto \log \left(y \cdot \left(\color{blue}{e^{x}} - 1\right) - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      17. metadata-eval41.2%

        \[\leadsto \log \left(y \cdot \left(e^{x} - 1\right) - \color{blue}{-1}\right) \cdot c \]
    3. Applied rewrites41.2%

      \[\leadsto \color{blue}{\log \left(y \cdot \left(e^{x} - 1\right) - -1\right) \cdot c} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 5: 85.5% accurate, 0.4× speedup?

\[\begin{array}{l} t_0 := \left({e}^{x} - 1\right) \cdot y\\ \mathbf{if}\;t\_0 \leq -4 \cdot 10^{-295}:\\ \;\;\;\;y \cdot \left(e^{x} \cdot c - c\right)\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\left(x \cdot \left(c + c \cdot \left(x \cdot \left(0.5 + -0.5 \cdot y\right)\right)\right)\right) \cdot y\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-22}:\\ \;\;\;\;\left(y \cdot c\right) \cdot e^{x} - \left(y \cdot c\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\log \left(y \cdot \left(e^{x} - 1\right) - -1\right) \cdot c\\ \end{array} \]
(FPCore (c x y)
  :precision binary64
  (let* ((t_0 (* (- (pow E x) 1.0) y)))
  (if (<= t_0 -4e-295)
    (* y (- (* (exp x) c) c))
    (if (<= t_0 0.0)
      (* (* x (+ c (* c (* x (+ 0.5 (* -0.5 y)))))) y)
      (if (<= t_0 2e-22)
        (- (* (* y c) (exp x)) (* (* y c) 1.0))
        (* (log (- (* y (- (exp x) 1.0)) -1.0)) c))))))
double code(double c, double x, double y) {
	double t_0 = (pow(((double) M_E), x) - 1.0) * y;
	double tmp;
	if (t_0 <= -4e-295) {
		tmp = y * ((exp(x) * c) - c);
	} else if (t_0 <= 0.0) {
		tmp = (x * (c + (c * (x * (0.5 + (-0.5 * y)))))) * y;
	} else if (t_0 <= 2e-22) {
		tmp = ((y * c) * exp(x)) - ((y * c) * 1.0);
	} else {
		tmp = log(((y * (exp(x) - 1.0)) - -1.0)) * c;
	}
	return tmp;
}
public static double code(double c, double x, double y) {
	double t_0 = (Math.pow(Math.E, x) - 1.0) * y;
	double tmp;
	if (t_0 <= -4e-295) {
		tmp = y * ((Math.exp(x) * c) - c);
	} else if (t_0 <= 0.0) {
		tmp = (x * (c + (c * (x * (0.5 + (-0.5 * y)))))) * y;
	} else if (t_0 <= 2e-22) {
		tmp = ((y * c) * Math.exp(x)) - ((y * c) * 1.0);
	} else {
		tmp = Math.log(((y * (Math.exp(x) - 1.0)) - -1.0)) * c;
	}
	return tmp;
}
def code(c, x, y):
	t_0 = (math.pow(math.e, x) - 1.0) * y
	tmp = 0
	if t_0 <= -4e-295:
		tmp = y * ((math.exp(x) * c) - c)
	elif t_0 <= 0.0:
		tmp = (x * (c + (c * (x * (0.5 + (-0.5 * y)))))) * y
	elif t_0 <= 2e-22:
		tmp = ((y * c) * math.exp(x)) - ((y * c) * 1.0)
	else:
		tmp = math.log(((y * (math.exp(x) - 1.0)) - -1.0)) * c
	return tmp
function code(c, x, y)
	t_0 = Float64(Float64((exp(1) ^ x) - 1.0) * y)
	tmp = 0.0
	if (t_0 <= -4e-295)
		tmp = Float64(y * Float64(Float64(exp(x) * c) - c));
	elseif (t_0 <= 0.0)
		tmp = Float64(Float64(x * Float64(c + Float64(c * Float64(x * Float64(0.5 + Float64(-0.5 * y)))))) * y);
	elseif (t_0 <= 2e-22)
		tmp = Float64(Float64(Float64(y * c) * exp(x)) - Float64(Float64(y * c) * 1.0));
	else
		tmp = Float64(log(Float64(Float64(y * Float64(exp(x) - 1.0)) - -1.0)) * c);
	end
	return tmp
end
function tmp_2 = code(c, x, y)
	t_0 = ((2.71828182845904523536 ^ x) - 1.0) * y;
	tmp = 0.0;
	if (t_0 <= -4e-295)
		tmp = y * ((exp(x) * c) - c);
	elseif (t_0 <= 0.0)
		tmp = (x * (c + (c * (x * (0.5 + (-0.5 * y)))))) * y;
	elseif (t_0 <= 2e-22)
		tmp = ((y * c) * exp(x)) - ((y * c) * 1.0);
	else
		tmp = log(((y * (exp(x) - 1.0)) - -1.0)) * c;
	end
	tmp_2 = tmp;
end
code[c_, x_, y_] := Block[{t$95$0 = N[(N[(N[Power[E, x], $MachinePrecision] - 1.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$0, -4e-295], N[(y * N[(N[(N[Exp[x], $MachinePrecision] * c), $MachinePrecision] - c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(x * N[(c + N[(c * N[(x * N[(0.5 + N[(-0.5 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 2e-22], N[(N[(N[(y * c), $MachinePrecision] * N[Exp[x], $MachinePrecision]), $MachinePrecision] - N[(N[(y * c), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision], N[(N[Log[N[(N[(y * N[(N[Exp[x], $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision] * c), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left({e}^{x} - 1\right) \cdot y\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-295}:\\
\;\;\;\;y \cdot \left(e^{x} \cdot c - c\right)\\

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(x \cdot \left(c + c \cdot \left(x \cdot \left(0.5 + -0.5 \cdot y\right)\right)\right)\right) \cdot y\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-22}:\\
\;\;\;\;\left(y \cdot c\right) \cdot e^{x} - \left(y \cdot c\right) \cdot 1\\

\mathbf{else}:\\
\;\;\;\;\log \left(y \cdot \left(e^{x} - 1\right) - -1\right) \cdot c\\


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 (-.f64 (pow.f64 (E.f64) x) #s(literal 1 binary64)) y) < -4.0000000000000002e-295

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \color{blue}{c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto c \cdot \left(y \cdot \color{blue}{\left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto c \cdot \left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - \color{blue}{1}\right)\right) \]
      4. lower-pow.f64N/A

        \[\leadsto c \cdot \left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      5. lower-E.f6445.3%

        \[\leadsto c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right) \]
    4. Applied rewrites45.3%

      \[\leadsto \color{blue}{c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(y \cdot \left({e}^{x} - 1\right)\right)} \]
      2. lift-*.f64N/A

        \[\leadsto c \cdot \left(y \cdot \color{blue}{\left({e}^{x} - 1\right)}\right) \]
      3. associate-*r*N/A

        \[\leadsto \left(c \cdot y\right) \cdot \color{blue}{\left({e}^{x} - 1\right)} \]
      4. lift--.f64N/A

        \[\leadsto \left(c \cdot y\right) \cdot \left({e}^{x} - \color{blue}{1}\right) \]
      5. sub-flipN/A

        \[\leadsto \left(c \cdot y\right) \cdot \left({e}^{x} + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \]
      6. distribute-lft-inN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} + \color{blue}{\left(c \cdot y\right) \cdot \left(\mathsf{neg}\left(1\right)\right)} \]
      7. add-flipN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \color{blue}{\left(\mathsf{neg}\left(\left(c \cdot y\right) \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right)} \]
      8. distribute-rgt-neg-outN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \left(c \cdot y\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(1\right)\right)\right)\right)} \]
      9. metadata-evalN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \left(c \cdot y\right) \cdot \left(\mathsf{neg}\left(-1\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \left(c \cdot y\right) \cdot 1 \]
      11. lower--.f64N/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \color{blue}{\left(c \cdot y\right) \cdot 1} \]
      12. lower-*.f64N/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \color{blue}{\left(c \cdot y\right)} \cdot 1 \]
      13. *-commutativeN/A

        \[\leadsto \left(y \cdot c\right) \cdot {e}^{x} - \left(\color{blue}{c} \cdot y\right) \cdot 1 \]
      14. lower-*.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot {e}^{x} - \left(\color{blue}{c} \cdot y\right) \cdot 1 \]
      15. lift-pow.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot {e}^{x} - \left(c \cdot \color{blue}{y}\right) \cdot 1 \]
      16. lift-E.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot {\mathsf{E}\left(\right)}^{x} - \left(c \cdot y\right) \cdot 1 \]
      17. e-exp-1N/A

        \[\leadsto \left(y \cdot c\right) \cdot {\left(e^{1}\right)}^{x} - \left(c \cdot y\right) \cdot 1 \]
      18. pow-expN/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{1 \cdot x} - \left(c \cdot \color{blue}{y}\right) \cdot 1 \]
      19. *-lft-identityN/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(c \cdot y\right) \cdot 1 \]
      20. lower-exp.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(c \cdot \color{blue}{y}\right) \cdot 1 \]
      21. lower-*.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(c \cdot y\right) \cdot \color{blue}{1} \]
      22. *-commutativeN/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(y \cdot c\right) \cdot 1 \]
      23. lower-*.f6445.0%

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(y \cdot c\right) \cdot 1 \]
    6. Applied rewrites45.0%

      \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \color{blue}{\left(y \cdot c\right) \cdot 1} \]
    7. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \color{blue}{\left(y \cdot c\right) \cdot 1} \]
      2. lift-*.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \color{blue}{\left(y \cdot c\right)} \cdot 1 \]
      3. lift-*.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(\color{blue}{y} \cdot c\right) \cdot 1 \]
      4. associate-*l*N/A

        \[\leadsto y \cdot \left(c \cdot e^{x}\right) - \color{blue}{\left(y \cdot c\right)} \cdot 1 \]
      5. lift-*.f64N/A

        \[\leadsto y \cdot \left(c \cdot e^{x}\right) - \left(y \cdot c\right) \cdot \color{blue}{1} \]
      6. *-rgt-identityN/A

        \[\leadsto y \cdot \left(c \cdot e^{x}\right) - y \cdot \color{blue}{c} \]
      7. lift-*.f64N/A

        \[\leadsto y \cdot \left(c \cdot e^{x}\right) - y \cdot \color{blue}{c} \]
      8. distribute-lft-out--N/A

        \[\leadsto y \cdot \color{blue}{\left(c \cdot e^{x} - c\right)} \]
      9. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(c \cdot e^{x} - c\right)} \]
      10. lower--.f64N/A

        \[\leadsto y \cdot \left(c \cdot e^{x} - \color{blue}{c}\right) \]
      11. *-commutativeN/A

        \[\leadsto y \cdot \left(e^{x} \cdot c - c\right) \]
      12. lower-*.f6445.3%

        \[\leadsto y \cdot \left(e^{x} \cdot c - c\right) \]
    8. Applied rewrites45.3%

      \[\leadsto y \cdot \color{blue}{\left(e^{x} \cdot c - c\right)} \]

    if -4.0000000000000002e-295 < (*.f64 (-.f64 (pow.f64 (E.f64) x) #s(literal 1 binary64)) y) < -0.0

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \color{blue}{y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + \color{blue}{c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + \color{blue}{c} \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      6. lower-pow.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      7. lower--.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      8. lower-pow.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      9. lower-E.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      10. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \color{blue}{\left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
    4. Applied rewrites44.9%

      \[\leadsto \color{blue}{y \cdot \left(-0.5 \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
      3. lower-*.f6444.9%

        \[\leadsto \left(-0.5 \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
    6. Applied rewrites44.9%

      \[\leadsto \left(c \cdot \left(\left(e^{x} - 1\right) + \left({\left(e^{x} - 1\right)}^{2} \cdot -0.5\right) \cdot y\right)\right) \cdot \color{blue}{y} \]
    7. Taylor expanded in x around 0

      \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      2. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      4. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      5. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right)\right)\right)\right) \cdot y \]
      6. lower-*.f6458.3%

        \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(0.5 + -0.5 \cdot y\right)\right)\right)\right) \cdot y \]
    9. Applied rewrites58.3%

      \[\leadsto \left(x \cdot \left(c + c \cdot \left(x \cdot \left(0.5 + -0.5 \cdot y\right)\right)\right)\right) \cdot y \]

    if -0.0 < (*.f64 (-.f64 (pow.f64 (E.f64) x) #s(literal 1 binary64)) y) < 2.0000000000000001e-22

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \color{blue}{c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto c \cdot \left(y \cdot \color{blue}{\left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto c \cdot \left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - \color{blue}{1}\right)\right) \]
      4. lower-pow.f64N/A

        \[\leadsto c \cdot \left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      5. lower-E.f6445.3%

        \[\leadsto c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right) \]
    4. Applied rewrites45.3%

      \[\leadsto \color{blue}{c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(y \cdot \left({e}^{x} - 1\right)\right)} \]
      2. lift-*.f64N/A

        \[\leadsto c \cdot \left(y \cdot \color{blue}{\left({e}^{x} - 1\right)}\right) \]
      3. associate-*r*N/A

        \[\leadsto \left(c \cdot y\right) \cdot \color{blue}{\left({e}^{x} - 1\right)} \]
      4. lift--.f64N/A

        \[\leadsto \left(c \cdot y\right) \cdot \left({e}^{x} - \color{blue}{1}\right) \]
      5. sub-flipN/A

        \[\leadsto \left(c \cdot y\right) \cdot \left({e}^{x} + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \]
      6. distribute-lft-inN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} + \color{blue}{\left(c \cdot y\right) \cdot \left(\mathsf{neg}\left(1\right)\right)} \]
      7. add-flipN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \color{blue}{\left(\mathsf{neg}\left(\left(c \cdot y\right) \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right)} \]
      8. distribute-rgt-neg-outN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \left(c \cdot y\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(1\right)\right)\right)\right)} \]
      9. metadata-evalN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \left(c \cdot y\right) \cdot \left(\mathsf{neg}\left(-1\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \left(c \cdot y\right) \cdot 1 \]
      11. lower--.f64N/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \color{blue}{\left(c \cdot y\right) \cdot 1} \]
      12. lower-*.f64N/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \color{blue}{\left(c \cdot y\right)} \cdot 1 \]
      13. *-commutativeN/A

        \[\leadsto \left(y \cdot c\right) \cdot {e}^{x} - \left(\color{blue}{c} \cdot y\right) \cdot 1 \]
      14. lower-*.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot {e}^{x} - \left(\color{blue}{c} \cdot y\right) \cdot 1 \]
      15. lift-pow.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot {e}^{x} - \left(c \cdot \color{blue}{y}\right) \cdot 1 \]
      16. lift-E.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot {\mathsf{E}\left(\right)}^{x} - \left(c \cdot y\right) \cdot 1 \]
      17. e-exp-1N/A

        \[\leadsto \left(y \cdot c\right) \cdot {\left(e^{1}\right)}^{x} - \left(c \cdot y\right) \cdot 1 \]
      18. pow-expN/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{1 \cdot x} - \left(c \cdot \color{blue}{y}\right) \cdot 1 \]
      19. *-lft-identityN/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(c \cdot y\right) \cdot 1 \]
      20. lower-exp.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(c \cdot \color{blue}{y}\right) \cdot 1 \]
      21. lower-*.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(c \cdot y\right) \cdot \color{blue}{1} \]
      22. *-commutativeN/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(y \cdot c\right) \cdot 1 \]
      23. lower-*.f6445.0%

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(y \cdot c\right) \cdot 1 \]
    6. Applied rewrites45.0%

      \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \color{blue}{\left(y \cdot c\right) \cdot 1} \]

    if 2.0000000000000001e-22 < (*.f64 (-.f64 (pow.f64 (E.f64) x) #s(literal 1 binary64)) y)

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right)} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \cdot c} \]
      3. lower-*.f6441.2%

        \[\leadsto \color{blue}{\log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \cdot c} \]
      4. lift-+.f64N/A

        \[\leadsto \log \color{blue}{\left(1 + \left({e}^{x} - 1\right) \cdot y\right)} \cdot c \]
      5. +-commutativeN/A

        \[\leadsto \log \color{blue}{\left(\left({e}^{x} - 1\right) \cdot y + 1\right)} \cdot c \]
      6. add-flipN/A

        \[\leadsto \log \color{blue}{\left(\left({e}^{x} - 1\right) \cdot y - \left(\mathsf{neg}\left(1\right)\right)\right)} \cdot c \]
      7. lower--.f64N/A

        \[\leadsto \log \color{blue}{\left(\left({e}^{x} - 1\right) \cdot y - \left(\mathsf{neg}\left(1\right)\right)\right)} \cdot c \]
      8. lift-*.f64N/A

        \[\leadsto \log \left(\color{blue}{\left({e}^{x} - 1\right) \cdot y} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      9. *-commutativeN/A

        \[\leadsto \log \left(\color{blue}{y \cdot \left({e}^{x} - 1\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      10. lower-*.f64N/A

        \[\leadsto \log \left(\color{blue}{y \cdot \left({e}^{x} - 1\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      11. lift-pow.f64N/A

        \[\leadsto \log \left(y \cdot \left(\color{blue}{{e}^{x}} - 1\right) - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      12. lift-E.f64N/A

        \[\leadsto \log \left(y \cdot \left({\color{blue}{\mathsf{E}\left(\right)}}^{x} - 1\right) - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      13. e-exp-1N/A

        \[\leadsto \log \left(y \cdot \left({\color{blue}{\left(e^{1}\right)}}^{x} - 1\right) - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      14. pow-expN/A

        \[\leadsto \log \left(y \cdot \left(\color{blue}{e^{1 \cdot x}} - 1\right) - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      15. *-lft-identityN/A

        \[\leadsto \log \left(y \cdot \left(e^{\color{blue}{x}} - 1\right) - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      16. lower-exp.f64N/A

        \[\leadsto \log \left(y \cdot \left(\color{blue}{e^{x}} - 1\right) - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot c \]
      17. metadata-eval41.2%

        \[\leadsto \log \left(y \cdot \left(e^{x} - 1\right) - \color{blue}{-1}\right) \cdot c \]
    3. Applied rewrites41.2%

      \[\leadsto \color{blue}{\log \left(y \cdot \left(e^{x} - 1\right) - -1\right) \cdot c} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 6: 76.7% accurate, 1.7× speedup?

\[\begin{array}{l} \mathbf{if}\;x \leq -820:\\ \;\;\;\;y \cdot \left(e^{x} \cdot c - c\right)\\ \mathbf{elif}\;x \leq -2.55 \cdot 10^{-49}:\\ \;\;\;\;\log \left(x \cdot y - -1\right) \cdot c\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(c \cdot \left(1 + x \cdot \left(0.5 + \left(-0.5 \cdot y + x \cdot \left(0.16666666666666666 + \left(-0.5 \cdot y + x \cdot \left(0.041666666666666664 + -0.2916666666666667 \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y\\ \end{array} \]
(FPCore (c x y)
  :precision binary64
  (if (<= x -820.0)
  (* y (- (* (exp x) c) c))
  (if (<= x -2.55e-49)
    (* (log (- (* x y) -1.0)) c)
    (*
     (*
      x
      (*
       c
       (+
        1.0
        (*
         x
         (+
          0.5
          (+
           (* -0.5 y)
           (*
            x
            (+
             0.16666666666666666
             (+
              (* -0.5 y)
              (*
               x
               (+
                0.041666666666666664
                (* -0.2916666666666667 y))))))))))))
     y))))
double code(double c, double x, double y) {
	double tmp;
	if (x <= -820.0) {
		tmp = y * ((exp(x) * c) - c);
	} else if (x <= -2.55e-49) {
		tmp = log(((x * y) - -1.0)) * c;
	} else {
		tmp = (x * (c * (1.0 + (x * (0.5 + ((-0.5 * y) + (x * (0.16666666666666666 + ((-0.5 * y) + (x * (0.041666666666666664 + (-0.2916666666666667 * y)))))))))))) * y;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(c, x, y)
use fmin_fmax_functions
    real(8), intent (in) :: c
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-820.0d0)) then
        tmp = y * ((exp(x) * c) - c)
    else if (x <= (-2.55d-49)) then
        tmp = log(((x * y) - (-1.0d0))) * c
    else
        tmp = (x * (c * (1.0d0 + (x * (0.5d0 + (((-0.5d0) * y) + (x * (0.16666666666666666d0 + (((-0.5d0) * y) + (x * (0.041666666666666664d0 + ((-0.2916666666666667d0) * y)))))))))))) * y
    end if
    code = tmp
end function
public static double code(double c, double x, double y) {
	double tmp;
	if (x <= -820.0) {
		tmp = y * ((Math.exp(x) * c) - c);
	} else if (x <= -2.55e-49) {
		tmp = Math.log(((x * y) - -1.0)) * c;
	} else {
		tmp = (x * (c * (1.0 + (x * (0.5 + ((-0.5 * y) + (x * (0.16666666666666666 + ((-0.5 * y) + (x * (0.041666666666666664 + (-0.2916666666666667 * y)))))))))))) * y;
	}
	return tmp;
}
def code(c, x, y):
	tmp = 0
	if x <= -820.0:
		tmp = y * ((math.exp(x) * c) - c)
	elif x <= -2.55e-49:
		tmp = math.log(((x * y) - -1.0)) * c
	else:
		tmp = (x * (c * (1.0 + (x * (0.5 + ((-0.5 * y) + (x * (0.16666666666666666 + ((-0.5 * y) + (x * (0.041666666666666664 + (-0.2916666666666667 * y)))))))))))) * y
	return tmp
function code(c, x, y)
	tmp = 0.0
	if (x <= -820.0)
		tmp = Float64(y * Float64(Float64(exp(x) * c) - c));
	elseif (x <= -2.55e-49)
		tmp = Float64(log(Float64(Float64(x * y) - -1.0)) * c);
	else
		tmp = Float64(Float64(x * Float64(c * Float64(1.0 + Float64(x * Float64(0.5 + Float64(Float64(-0.5 * y) + Float64(x * Float64(0.16666666666666666 + Float64(Float64(-0.5 * y) + Float64(x * Float64(0.041666666666666664 + Float64(-0.2916666666666667 * y)))))))))))) * y);
	end
	return tmp
end
function tmp_2 = code(c, x, y)
	tmp = 0.0;
	if (x <= -820.0)
		tmp = y * ((exp(x) * c) - c);
	elseif (x <= -2.55e-49)
		tmp = log(((x * y) - -1.0)) * c;
	else
		tmp = (x * (c * (1.0 + (x * (0.5 + ((-0.5 * y) + (x * (0.16666666666666666 + ((-0.5 * y) + (x * (0.041666666666666664 + (-0.2916666666666667 * y)))))))))))) * y;
	end
	tmp_2 = tmp;
end
code[c_, x_, y_] := If[LessEqual[x, -820.0], N[(y * N[(N[(N[Exp[x], $MachinePrecision] * c), $MachinePrecision] - c), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.55e-49], N[(N[Log[N[(N[(x * y), $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision] * c), $MachinePrecision], N[(N[(x * N[(c * N[(1.0 + N[(x * N[(0.5 + N[(N[(-0.5 * y), $MachinePrecision] + N[(x * N[(0.16666666666666666 + N[(N[(-0.5 * y), $MachinePrecision] + N[(x * N[(0.041666666666666664 + N[(-0.2916666666666667 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;x \leq -820:\\
\;\;\;\;y \cdot \left(e^{x} \cdot c - c\right)\\

\mathbf{elif}\;x \leq -2.55 \cdot 10^{-49}:\\
\;\;\;\;\log \left(x \cdot y - -1\right) \cdot c\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(c \cdot \left(1 + x \cdot \left(0.5 + \left(-0.5 \cdot y + x \cdot \left(0.16666666666666666 + \left(-0.5 \cdot y + x \cdot \left(0.041666666666666664 + -0.2916666666666667 \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -820

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \color{blue}{c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto c \cdot \left(y \cdot \color{blue}{\left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto c \cdot \left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - \color{blue}{1}\right)\right) \]
      4. lower-pow.f64N/A

        \[\leadsto c \cdot \left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      5. lower-E.f6445.3%

        \[\leadsto c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right) \]
    4. Applied rewrites45.3%

      \[\leadsto \color{blue}{c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(y \cdot \left({e}^{x} - 1\right)\right)} \]
      2. lift-*.f64N/A

        \[\leadsto c \cdot \left(y \cdot \color{blue}{\left({e}^{x} - 1\right)}\right) \]
      3. associate-*r*N/A

        \[\leadsto \left(c \cdot y\right) \cdot \color{blue}{\left({e}^{x} - 1\right)} \]
      4. lift--.f64N/A

        \[\leadsto \left(c \cdot y\right) \cdot \left({e}^{x} - \color{blue}{1}\right) \]
      5. sub-flipN/A

        \[\leadsto \left(c \cdot y\right) \cdot \left({e}^{x} + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \]
      6. distribute-lft-inN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} + \color{blue}{\left(c \cdot y\right) \cdot \left(\mathsf{neg}\left(1\right)\right)} \]
      7. add-flipN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \color{blue}{\left(\mathsf{neg}\left(\left(c \cdot y\right) \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right)} \]
      8. distribute-rgt-neg-outN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \left(c \cdot y\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(1\right)\right)\right)\right)} \]
      9. metadata-evalN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \left(c \cdot y\right) \cdot \left(\mathsf{neg}\left(-1\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \left(c \cdot y\right) \cdot 1 \]
      11. lower--.f64N/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \color{blue}{\left(c \cdot y\right) \cdot 1} \]
      12. lower-*.f64N/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \color{blue}{\left(c \cdot y\right)} \cdot 1 \]
      13. *-commutativeN/A

        \[\leadsto \left(y \cdot c\right) \cdot {e}^{x} - \left(\color{blue}{c} \cdot y\right) \cdot 1 \]
      14. lower-*.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot {e}^{x} - \left(\color{blue}{c} \cdot y\right) \cdot 1 \]
      15. lift-pow.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot {e}^{x} - \left(c \cdot \color{blue}{y}\right) \cdot 1 \]
      16. lift-E.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot {\mathsf{E}\left(\right)}^{x} - \left(c \cdot y\right) \cdot 1 \]
      17. e-exp-1N/A

        \[\leadsto \left(y \cdot c\right) \cdot {\left(e^{1}\right)}^{x} - \left(c \cdot y\right) \cdot 1 \]
      18. pow-expN/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{1 \cdot x} - \left(c \cdot \color{blue}{y}\right) \cdot 1 \]
      19. *-lft-identityN/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(c \cdot y\right) \cdot 1 \]
      20. lower-exp.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(c \cdot \color{blue}{y}\right) \cdot 1 \]
      21. lower-*.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(c \cdot y\right) \cdot \color{blue}{1} \]
      22. *-commutativeN/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(y \cdot c\right) \cdot 1 \]
      23. lower-*.f6445.0%

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(y \cdot c\right) \cdot 1 \]
    6. Applied rewrites45.0%

      \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \color{blue}{\left(y \cdot c\right) \cdot 1} \]
    7. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \color{blue}{\left(y \cdot c\right) \cdot 1} \]
      2. lift-*.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \color{blue}{\left(y \cdot c\right)} \cdot 1 \]
      3. lift-*.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(\color{blue}{y} \cdot c\right) \cdot 1 \]
      4. associate-*l*N/A

        \[\leadsto y \cdot \left(c \cdot e^{x}\right) - \color{blue}{\left(y \cdot c\right)} \cdot 1 \]
      5. lift-*.f64N/A

        \[\leadsto y \cdot \left(c \cdot e^{x}\right) - \left(y \cdot c\right) \cdot \color{blue}{1} \]
      6. *-rgt-identityN/A

        \[\leadsto y \cdot \left(c \cdot e^{x}\right) - y \cdot \color{blue}{c} \]
      7. lift-*.f64N/A

        \[\leadsto y \cdot \left(c \cdot e^{x}\right) - y \cdot \color{blue}{c} \]
      8. distribute-lft-out--N/A

        \[\leadsto y \cdot \color{blue}{\left(c \cdot e^{x} - c\right)} \]
      9. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(c \cdot e^{x} - c\right)} \]
      10. lower--.f64N/A

        \[\leadsto y \cdot \left(c \cdot e^{x} - \color{blue}{c}\right) \]
      11. *-commutativeN/A

        \[\leadsto y \cdot \left(e^{x} \cdot c - c\right) \]
      12. lower-*.f6445.3%

        \[\leadsto y \cdot \left(e^{x} \cdot c - c\right) \]
    8. Applied rewrites45.3%

      \[\leadsto y \cdot \color{blue}{\left(e^{x} \cdot c - c\right)} \]

    if -820 < x < -2.5500000000000001e-49

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in x around 0

      \[\leadsto c \cdot \log \left(1 + \color{blue}{\left(x \cdot \log e\right)} \cdot y\right) \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \log \left(1 + \left(x \cdot \color{blue}{\log \mathsf{E}\left(\right)}\right) \cdot y\right) \]
      2. lower-log.f64N/A

        \[\leadsto c \cdot \log \left(1 + \left(x \cdot \log \mathsf{E}\left(\right)\right) \cdot y\right) \]
      3. lower-E.f6440.2%

        \[\leadsto c \cdot \log \left(1 + \left(x \cdot \log e\right) \cdot y\right) \]
    4. Applied rewrites40.2%

      \[\leadsto c \cdot \log \left(1 + \color{blue}{\left(x \cdot \log e\right)} \cdot y\right) \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{c \cdot \log \left(1 + \left(x \cdot \log e\right) \cdot y\right)} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\log \left(1 + \left(x \cdot \log e\right) \cdot y\right) \cdot c} \]
      3. lower-*.f6440.2%

        \[\leadsto \color{blue}{\log \left(1 + \left(x \cdot \log e\right) \cdot y\right) \cdot c} \]
    6. Applied rewrites40.2%

      \[\leadsto \color{blue}{\log \left(x \cdot y - -1\right) \cdot c} \]

    if -2.5500000000000001e-49 < x

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \color{blue}{y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + \color{blue}{c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + \color{blue}{c} \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      6. lower-pow.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      7. lower--.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      8. lower-pow.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      9. lower-E.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      10. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \color{blue}{\left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
    4. Applied rewrites44.9%

      \[\leadsto \color{blue}{y \cdot \left(-0.5 \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
      3. lower-*.f6444.9%

        \[\leadsto \left(-0.5 \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
    6. Applied rewrites44.9%

      \[\leadsto \left(c \cdot \left(\left(e^{x} - 1\right) + \left({\left(e^{x} - 1\right)}^{2} \cdot -0.5\right) \cdot y\right)\right) \cdot \color{blue}{y} \]
    7. Taylor expanded in x around 0

      \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      2. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      4. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      5. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      6. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      7. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      8. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
    9. Applied rewrites54.7%

      \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(0.5 + -0.5 \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(0.041666666666666664 + -0.2916666666666667 \cdot y\right)\right) + c \cdot \left(0.16666666666666666 + -0.5 \cdot y\right)\right)\right)\right)\right) \cdot y \]
    10. Taylor expanded in c around 0

      \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
    11. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      2. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      4. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      5. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      6. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      7. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      8. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      9. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
    12. Applied rewrites57.9%

      \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(0.5 + \left(-0.5 \cdot y + x \cdot \left(0.16666666666666666 + \left(-0.5 \cdot y + x \cdot \left(0.041666666666666664 + -0.2916666666666667 \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 7: 76.7% accurate, 1.8× speedup?

\[\begin{array}{l} \mathbf{if}\;x \leq -1.78 \cdot 10^{-10}:\\ \;\;\;\;\left(\left(e^{x} - 1\right) \cdot c\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(c \cdot \left(1 + x \cdot \left(0.5 + \left(-0.5 \cdot y + x \cdot \left(0.16666666666666666 + \left(-0.5 \cdot y + x \cdot \left(0.041666666666666664 + -0.2916666666666667 \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y\\ \end{array} \]
(FPCore (c x y)
  :precision binary64
  (if (<= x -1.78e-10)
  (* (* (- (exp x) 1.0) c) y)
  (*
   (*
    x
    (*
     c
     (+
      1.0
      (*
       x
       (+
        0.5
        (+
         (* -0.5 y)
         (*
          x
          (+
           0.16666666666666666
           (+
            (* -0.5 y)
            (*
             x
             (+
              0.041666666666666664
              (* -0.2916666666666667 y))))))))))))
   y)))
double code(double c, double x, double y) {
	double tmp;
	if (x <= -1.78e-10) {
		tmp = ((exp(x) - 1.0) * c) * y;
	} else {
		tmp = (x * (c * (1.0 + (x * (0.5 + ((-0.5 * y) + (x * (0.16666666666666666 + ((-0.5 * y) + (x * (0.041666666666666664 + (-0.2916666666666667 * y)))))))))))) * y;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(c, x, y)
use fmin_fmax_functions
    real(8), intent (in) :: c
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-1.78d-10)) then
        tmp = ((exp(x) - 1.0d0) * c) * y
    else
        tmp = (x * (c * (1.0d0 + (x * (0.5d0 + (((-0.5d0) * y) + (x * (0.16666666666666666d0 + (((-0.5d0) * y) + (x * (0.041666666666666664d0 + ((-0.2916666666666667d0) * y)))))))))))) * y
    end if
    code = tmp
end function
public static double code(double c, double x, double y) {
	double tmp;
	if (x <= -1.78e-10) {
		tmp = ((Math.exp(x) - 1.0) * c) * y;
	} else {
		tmp = (x * (c * (1.0 + (x * (0.5 + ((-0.5 * y) + (x * (0.16666666666666666 + ((-0.5 * y) + (x * (0.041666666666666664 + (-0.2916666666666667 * y)))))))))))) * y;
	}
	return tmp;
}
def code(c, x, y):
	tmp = 0
	if x <= -1.78e-10:
		tmp = ((math.exp(x) - 1.0) * c) * y
	else:
		tmp = (x * (c * (1.0 + (x * (0.5 + ((-0.5 * y) + (x * (0.16666666666666666 + ((-0.5 * y) + (x * (0.041666666666666664 + (-0.2916666666666667 * y)))))))))))) * y
	return tmp
function code(c, x, y)
	tmp = 0.0
	if (x <= -1.78e-10)
		tmp = Float64(Float64(Float64(exp(x) - 1.0) * c) * y);
	else
		tmp = Float64(Float64(x * Float64(c * Float64(1.0 + Float64(x * Float64(0.5 + Float64(Float64(-0.5 * y) + Float64(x * Float64(0.16666666666666666 + Float64(Float64(-0.5 * y) + Float64(x * Float64(0.041666666666666664 + Float64(-0.2916666666666667 * y)))))))))))) * y);
	end
	return tmp
end
function tmp_2 = code(c, x, y)
	tmp = 0.0;
	if (x <= -1.78e-10)
		tmp = ((exp(x) - 1.0) * c) * y;
	else
		tmp = (x * (c * (1.0 + (x * (0.5 + ((-0.5 * y) + (x * (0.16666666666666666 + ((-0.5 * y) + (x * (0.041666666666666664 + (-0.2916666666666667 * y)))))))))))) * y;
	end
	tmp_2 = tmp;
end
code[c_, x_, y_] := If[LessEqual[x, -1.78e-10], N[(N[(N[(N[Exp[x], $MachinePrecision] - 1.0), $MachinePrecision] * c), $MachinePrecision] * y), $MachinePrecision], N[(N[(x * N[(c * N[(1.0 + N[(x * N[(0.5 + N[(N[(-0.5 * y), $MachinePrecision] + N[(x * N[(0.16666666666666666 + N[(N[(-0.5 * y), $MachinePrecision] + N[(x * N[(0.041666666666666664 + N[(-0.2916666666666667 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq -1.78 \cdot 10^{-10}:\\
\;\;\;\;\left(\left(e^{x} - 1\right) \cdot c\right) \cdot y\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(c \cdot \left(1 + x \cdot \left(0.5 + \left(-0.5 \cdot y + x \cdot \left(0.16666666666666666 + \left(-0.5 \cdot y + x \cdot \left(0.041666666666666664 + -0.2916666666666667 \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.7800000000000001e-10

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \color{blue}{c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto c \cdot \left(y \cdot \color{blue}{\left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto c \cdot \left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - \color{blue}{1}\right)\right) \]
      4. lower-pow.f64N/A

        \[\leadsto c \cdot \left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      5. lower-E.f6445.3%

        \[\leadsto c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right) \]
    4. Applied rewrites45.3%

      \[\leadsto \color{blue}{c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(y \cdot \left({e}^{x} - 1\right)\right)} \]
      2. lift-*.f64N/A

        \[\leadsto c \cdot \left(y \cdot \color{blue}{\left({e}^{x} - 1\right)}\right) \]
      3. *-commutativeN/A

        \[\leadsto c \cdot \left(\left({e}^{x} - 1\right) \cdot \color{blue}{y}\right) \]
      4. associate-*l*N/A

        \[\leadsto \left(c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
      5. lift-*.f64N/A

        \[\leadsto \left(c \cdot \left({e}^{x} - 1\right)\right) \cdot y \]
      6. lower-*.f6445.3%

        \[\leadsto \left(c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
      7. lift-*.f64N/A

        \[\leadsto \left(c \cdot \left({e}^{x} - 1\right)\right) \cdot y \]
      8. *-commutativeN/A

        \[\leadsto \left(\left({e}^{x} - 1\right) \cdot c\right) \cdot y \]
      9. lower-*.f6445.3%

        \[\leadsto \left(\left({e}^{x} - 1\right) \cdot c\right) \cdot y \]
      10. lift-pow.f64N/A

        \[\leadsto \left(\left({e}^{x} - 1\right) \cdot c\right) \cdot y \]
      11. lift-E.f64N/A

        \[\leadsto \left(\left({\mathsf{E}\left(\right)}^{x} - 1\right) \cdot c\right) \cdot y \]
      12. e-exp-1N/A

        \[\leadsto \left(\left({\left(e^{1}\right)}^{x} - 1\right) \cdot c\right) \cdot y \]
      13. pow-expN/A

        \[\leadsto \left(\left(e^{1 \cdot x} - 1\right) \cdot c\right) \cdot y \]
      14. *-lft-identityN/A

        \[\leadsto \left(\left(e^{x} - 1\right) \cdot c\right) \cdot y \]
      15. lower-exp.f6445.3%

        \[\leadsto \left(\left(e^{x} - 1\right) \cdot c\right) \cdot y \]
    6. Applied rewrites45.3%

      \[\leadsto \left(\left(e^{x} - 1\right) \cdot c\right) \cdot \color{blue}{y} \]

    if -1.7800000000000001e-10 < x

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \color{blue}{y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + \color{blue}{c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + \color{blue}{c} \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      6. lower-pow.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      7. lower--.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      8. lower-pow.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      9. lower-E.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      10. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \color{blue}{\left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
    4. Applied rewrites44.9%

      \[\leadsto \color{blue}{y \cdot \left(-0.5 \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
      3. lower-*.f6444.9%

        \[\leadsto \left(-0.5 \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
    6. Applied rewrites44.9%

      \[\leadsto \left(c \cdot \left(\left(e^{x} - 1\right) + \left({\left(e^{x} - 1\right)}^{2} \cdot -0.5\right) \cdot y\right)\right) \cdot \color{blue}{y} \]
    7. Taylor expanded in x around 0

      \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      2. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      4. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      5. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      6. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      7. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      8. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
    9. Applied rewrites54.7%

      \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(0.5 + -0.5 \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(0.041666666666666664 + -0.2916666666666667 \cdot y\right)\right) + c \cdot \left(0.16666666666666666 + -0.5 \cdot y\right)\right)\right)\right)\right) \cdot y \]
    10. Taylor expanded in c around 0

      \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
    11. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      2. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      4. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      5. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      6. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      7. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      8. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      9. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
    12. Applied rewrites57.9%

      \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(0.5 + \left(-0.5 \cdot y + x \cdot \left(0.16666666666666666 + \left(-0.5 \cdot y + x \cdot \left(0.041666666666666664 + -0.2916666666666667 \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 8: 75.8% accurate, 1.8× speedup?

\[\begin{array}{l} \mathbf{if}\;x \leq -1.78 \cdot 10^{-10}:\\ \;\;\;\;y \cdot \left(e^{x} \cdot c - c\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(c \cdot \left(1 + x \cdot \left(0.5 + \left(-0.5 \cdot y + x \cdot \left(0.16666666666666666 + \left(-0.5 \cdot y + x \cdot \left(0.041666666666666664 + -0.2916666666666667 \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y\\ \end{array} \]
(FPCore (c x y)
  :precision binary64
  (if (<= x -1.78e-10)
  (* y (- (* (exp x) c) c))
  (*
   (*
    x
    (*
     c
     (+
      1.0
      (*
       x
       (+
        0.5
        (+
         (* -0.5 y)
         (*
          x
          (+
           0.16666666666666666
           (+
            (* -0.5 y)
            (*
             x
             (+
              0.041666666666666664
              (* -0.2916666666666667 y))))))))))))
   y)))
double code(double c, double x, double y) {
	double tmp;
	if (x <= -1.78e-10) {
		tmp = y * ((exp(x) * c) - c);
	} else {
		tmp = (x * (c * (1.0 + (x * (0.5 + ((-0.5 * y) + (x * (0.16666666666666666 + ((-0.5 * y) + (x * (0.041666666666666664 + (-0.2916666666666667 * y)))))))))))) * y;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(c, x, y)
use fmin_fmax_functions
    real(8), intent (in) :: c
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-1.78d-10)) then
        tmp = y * ((exp(x) * c) - c)
    else
        tmp = (x * (c * (1.0d0 + (x * (0.5d0 + (((-0.5d0) * y) + (x * (0.16666666666666666d0 + (((-0.5d0) * y) + (x * (0.041666666666666664d0 + ((-0.2916666666666667d0) * y)))))))))))) * y
    end if
    code = tmp
end function
public static double code(double c, double x, double y) {
	double tmp;
	if (x <= -1.78e-10) {
		tmp = y * ((Math.exp(x) * c) - c);
	} else {
		tmp = (x * (c * (1.0 + (x * (0.5 + ((-0.5 * y) + (x * (0.16666666666666666 + ((-0.5 * y) + (x * (0.041666666666666664 + (-0.2916666666666667 * y)))))))))))) * y;
	}
	return tmp;
}
def code(c, x, y):
	tmp = 0
	if x <= -1.78e-10:
		tmp = y * ((math.exp(x) * c) - c)
	else:
		tmp = (x * (c * (1.0 + (x * (0.5 + ((-0.5 * y) + (x * (0.16666666666666666 + ((-0.5 * y) + (x * (0.041666666666666664 + (-0.2916666666666667 * y)))))))))))) * y
	return tmp
function code(c, x, y)
	tmp = 0.0
	if (x <= -1.78e-10)
		tmp = Float64(y * Float64(Float64(exp(x) * c) - c));
	else
		tmp = Float64(Float64(x * Float64(c * Float64(1.0 + Float64(x * Float64(0.5 + Float64(Float64(-0.5 * y) + Float64(x * Float64(0.16666666666666666 + Float64(Float64(-0.5 * y) + Float64(x * Float64(0.041666666666666664 + Float64(-0.2916666666666667 * y)))))))))))) * y);
	end
	return tmp
end
function tmp_2 = code(c, x, y)
	tmp = 0.0;
	if (x <= -1.78e-10)
		tmp = y * ((exp(x) * c) - c);
	else
		tmp = (x * (c * (1.0 + (x * (0.5 + ((-0.5 * y) + (x * (0.16666666666666666 + ((-0.5 * y) + (x * (0.041666666666666664 + (-0.2916666666666667 * y)))))))))))) * y;
	end
	tmp_2 = tmp;
end
code[c_, x_, y_] := If[LessEqual[x, -1.78e-10], N[(y * N[(N[(N[Exp[x], $MachinePrecision] * c), $MachinePrecision] - c), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(c * N[(1.0 + N[(x * N[(0.5 + N[(N[(-0.5 * y), $MachinePrecision] + N[(x * N[(0.16666666666666666 + N[(N[(-0.5 * y), $MachinePrecision] + N[(x * N[(0.041666666666666664 + N[(-0.2916666666666667 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq -1.78 \cdot 10^{-10}:\\
\;\;\;\;y \cdot \left(e^{x} \cdot c - c\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(c \cdot \left(1 + x \cdot \left(0.5 + \left(-0.5 \cdot y + x \cdot \left(0.16666666666666666 + \left(-0.5 \cdot y + x \cdot \left(0.041666666666666664 + -0.2916666666666667 \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.7800000000000001e-10

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \color{blue}{c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto c \cdot \left(y \cdot \color{blue}{\left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto c \cdot \left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - \color{blue}{1}\right)\right) \]
      4. lower-pow.f64N/A

        \[\leadsto c \cdot \left(y \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      5. lower-E.f6445.3%

        \[\leadsto c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right) \]
    4. Applied rewrites45.3%

      \[\leadsto \color{blue}{c \cdot \left(y \cdot \left({e}^{x} - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(y \cdot \left({e}^{x} - 1\right)\right)} \]
      2. lift-*.f64N/A

        \[\leadsto c \cdot \left(y \cdot \color{blue}{\left({e}^{x} - 1\right)}\right) \]
      3. associate-*r*N/A

        \[\leadsto \left(c \cdot y\right) \cdot \color{blue}{\left({e}^{x} - 1\right)} \]
      4. lift--.f64N/A

        \[\leadsto \left(c \cdot y\right) \cdot \left({e}^{x} - \color{blue}{1}\right) \]
      5. sub-flipN/A

        \[\leadsto \left(c \cdot y\right) \cdot \left({e}^{x} + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \]
      6. distribute-lft-inN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} + \color{blue}{\left(c \cdot y\right) \cdot \left(\mathsf{neg}\left(1\right)\right)} \]
      7. add-flipN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \color{blue}{\left(\mathsf{neg}\left(\left(c \cdot y\right) \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right)} \]
      8. distribute-rgt-neg-outN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \left(c \cdot y\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(1\right)\right)\right)\right)} \]
      9. metadata-evalN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \left(c \cdot y\right) \cdot \left(\mathsf{neg}\left(-1\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \left(c \cdot y\right) \cdot 1 \]
      11. lower--.f64N/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \color{blue}{\left(c \cdot y\right) \cdot 1} \]
      12. lower-*.f64N/A

        \[\leadsto \left(c \cdot y\right) \cdot {e}^{x} - \color{blue}{\left(c \cdot y\right)} \cdot 1 \]
      13. *-commutativeN/A

        \[\leadsto \left(y \cdot c\right) \cdot {e}^{x} - \left(\color{blue}{c} \cdot y\right) \cdot 1 \]
      14. lower-*.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot {e}^{x} - \left(\color{blue}{c} \cdot y\right) \cdot 1 \]
      15. lift-pow.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot {e}^{x} - \left(c \cdot \color{blue}{y}\right) \cdot 1 \]
      16. lift-E.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot {\mathsf{E}\left(\right)}^{x} - \left(c \cdot y\right) \cdot 1 \]
      17. e-exp-1N/A

        \[\leadsto \left(y \cdot c\right) \cdot {\left(e^{1}\right)}^{x} - \left(c \cdot y\right) \cdot 1 \]
      18. pow-expN/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{1 \cdot x} - \left(c \cdot \color{blue}{y}\right) \cdot 1 \]
      19. *-lft-identityN/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(c \cdot y\right) \cdot 1 \]
      20. lower-exp.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(c \cdot \color{blue}{y}\right) \cdot 1 \]
      21. lower-*.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(c \cdot y\right) \cdot \color{blue}{1} \]
      22. *-commutativeN/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(y \cdot c\right) \cdot 1 \]
      23. lower-*.f6445.0%

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(y \cdot c\right) \cdot 1 \]
    6. Applied rewrites45.0%

      \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \color{blue}{\left(y \cdot c\right) \cdot 1} \]
    7. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \color{blue}{\left(y \cdot c\right) \cdot 1} \]
      2. lift-*.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \color{blue}{\left(y \cdot c\right)} \cdot 1 \]
      3. lift-*.f64N/A

        \[\leadsto \left(y \cdot c\right) \cdot e^{x} - \left(\color{blue}{y} \cdot c\right) \cdot 1 \]
      4. associate-*l*N/A

        \[\leadsto y \cdot \left(c \cdot e^{x}\right) - \color{blue}{\left(y \cdot c\right)} \cdot 1 \]
      5. lift-*.f64N/A

        \[\leadsto y \cdot \left(c \cdot e^{x}\right) - \left(y \cdot c\right) \cdot \color{blue}{1} \]
      6. *-rgt-identityN/A

        \[\leadsto y \cdot \left(c \cdot e^{x}\right) - y \cdot \color{blue}{c} \]
      7. lift-*.f64N/A

        \[\leadsto y \cdot \left(c \cdot e^{x}\right) - y \cdot \color{blue}{c} \]
      8. distribute-lft-out--N/A

        \[\leadsto y \cdot \color{blue}{\left(c \cdot e^{x} - c\right)} \]
      9. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(c \cdot e^{x} - c\right)} \]
      10. lower--.f64N/A

        \[\leadsto y \cdot \left(c \cdot e^{x} - \color{blue}{c}\right) \]
      11. *-commutativeN/A

        \[\leadsto y \cdot \left(e^{x} \cdot c - c\right) \]
      12. lower-*.f6445.3%

        \[\leadsto y \cdot \left(e^{x} \cdot c - c\right) \]
    8. Applied rewrites45.3%

      \[\leadsto y \cdot \color{blue}{\left(e^{x} \cdot c - c\right)} \]

    if -1.7800000000000001e-10 < x

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \color{blue}{y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + \color{blue}{c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + \color{blue}{c} \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      6. lower-pow.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      7. lower--.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      8. lower-pow.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      9. lower-E.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      10. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \color{blue}{\left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
    4. Applied rewrites44.9%

      \[\leadsto \color{blue}{y \cdot \left(-0.5 \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
      3. lower-*.f6444.9%

        \[\leadsto \left(-0.5 \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
    6. Applied rewrites44.9%

      \[\leadsto \left(c \cdot \left(\left(e^{x} - 1\right) + \left({\left(e^{x} - 1\right)}^{2} \cdot -0.5\right) \cdot y\right)\right) \cdot \color{blue}{y} \]
    7. Taylor expanded in x around 0

      \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      2. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      4. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      5. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      6. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      7. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      8. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
    9. Applied rewrites54.7%

      \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(0.5 + -0.5 \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(0.041666666666666664 + -0.2916666666666667 \cdot y\right)\right) + c \cdot \left(0.16666666666666666 + -0.5 \cdot y\right)\right)\right)\right)\right) \cdot y \]
    10. Taylor expanded in c around 0

      \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
    11. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      2. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      4. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      5. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      6. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      7. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      8. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      9. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
    12. Applied rewrites57.9%

      \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(0.5 + \left(-0.5 \cdot y + x \cdot \left(0.16666666666666666 + \left(-0.5 \cdot y + x \cdot \left(0.041666666666666664 + -0.2916666666666667 \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 9: 65.1% accurate, 1.2× speedup?

\[\mathsf{copysign}\left(1, c\right) \cdot \begin{array}{l} \mathbf{if}\;\left|c\right| \leq 8200:\\ \;\;\;\;\left(y \cdot \left|c\right|\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(\left|c\right| \cdot \left(1 + x \cdot \left(0.5 + \left(-0.5 \cdot y + x \cdot \left(0.16666666666666666 + \left(-0.5 \cdot y + x \cdot \left(0.041666666666666664 + -0.2916666666666667 \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y\\ \end{array} \]
(FPCore (c x y)
  :precision binary64
  (*
 (copysign 1.0 c)
 (if (<= (fabs c) 8200.0)
   (* (* y (fabs c)) x)
   (*
    (*
     x
     (*
      (fabs c)
      (+
       1.0
       (*
        x
        (+
         0.5
         (+
          (* -0.5 y)
          (*
           x
           (+
            0.16666666666666666
            (+
             (* -0.5 y)
             (*
              x
              (+
               0.041666666666666664
               (* -0.2916666666666667 y))))))))))))
    y))))
double code(double c, double x, double y) {
	double tmp;
	if (fabs(c) <= 8200.0) {
		tmp = (y * fabs(c)) * x;
	} else {
		tmp = (x * (fabs(c) * (1.0 + (x * (0.5 + ((-0.5 * y) + (x * (0.16666666666666666 + ((-0.5 * y) + (x * (0.041666666666666664 + (-0.2916666666666667 * y)))))))))))) * y;
	}
	return copysign(1.0, c) * tmp;
}
public static double code(double c, double x, double y) {
	double tmp;
	if (Math.abs(c) <= 8200.0) {
		tmp = (y * Math.abs(c)) * x;
	} else {
		tmp = (x * (Math.abs(c) * (1.0 + (x * (0.5 + ((-0.5 * y) + (x * (0.16666666666666666 + ((-0.5 * y) + (x * (0.041666666666666664 + (-0.2916666666666667 * y)))))))))))) * y;
	}
	return Math.copySign(1.0, c) * tmp;
}
def code(c, x, y):
	tmp = 0
	if math.fabs(c) <= 8200.0:
		tmp = (y * math.fabs(c)) * x
	else:
		tmp = (x * (math.fabs(c) * (1.0 + (x * (0.5 + ((-0.5 * y) + (x * (0.16666666666666666 + ((-0.5 * y) + (x * (0.041666666666666664 + (-0.2916666666666667 * y)))))))))))) * y
	return math.copysign(1.0, c) * tmp
function code(c, x, y)
	tmp = 0.0
	if (abs(c) <= 8200.0)
		tmp = Float64(Float64(y * abs(c)) * x);
	else
		tmp = Float64(Float64(x * Float64(abs(c) * Float64(1.0 + Float64(x * Float64(0.5 + Float64(Float64(-0.5 * y) + Float64(x * Float64(0.16666666666666666 + Float64(Float64(-0.5 * y) + Float64(x * Float64(0.041666666666666664 + Float64(-0.2916666666666667 * y)))))))))))) * y);
	end
	return Float64(copysign(1.0, c) * tmp)
end
function tmp_2 = code(c, x, y)
	tmp = 0.0;
	if (abs(c) <= 8200.0)
		tmp = (y * abs(c)) * x;
	else
		tmp = (x * (abs(c) * (1.0 + (x * (0.5 + ((-0.5 * y) + (x * (0.16666666666666666 + ((-0.5 * y) + (x * (0.041666666666666664 + (-0.2916666666666667 * y)))))))))))) * y;
	end
	tmp_2 = (sign(c) * abs(1.0)) * tmp;
end
code[c_, x_, y_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[c], $MachinePrecision], 8200.0], N[(N[(y * N[Abs[c], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(x * N[(N[Abs[c], $MachinePrecision] * N[(1.0 + N[(x * N[(0.5 + N[(N[(-0.5 * y), $MachinePrecision] + N[(x * N[(0.16666666666666666 + N[(N[(-0.5 * y), $MachinePrecision] + N[(x * N[(0.041666666666666664 + N[(-0.2916666666666667 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, c\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|c\right| \leq 8200:\\
\;\;\;\;\left(y \cdot \left|c\right|\right) \cdot x\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(\left|c\right| \cdot \left(1 + x \cdot \left(0.5 + \left(-0.5 \cdot y + x \cdot \left(0.16666666666666666 + \left(-0.5 \cdot y + x \cdot \left(0.041666666666666664 + -0.2916666666666667 \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < 8200

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in x around 0

      \[\leadsto \color{blue}{c \cdot \left(x \cdot \left(y \cdot \log e\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(x \cdot \left(y \cdot \log \mathsf{E}\left(\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto c \cdot \left(x \cdot \color{blue}{\left(y \cdot \log \mathsf{E}\left(\right)\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto c \cdot \left(x \cdot \left(y \cdot \color{blue}{\log \mathsf{E}\left(\right)}\right)\right) \]
      4. lower-log.f64N/A

        \[\leadsto c \cdot \left(x \cdot \left(y \cdot \log \mathsf{E}\left(\right)\right)\right) \]
      5. lower-E.f6456.3%

        \[\leadsto c \cdot \left(x \cdot \left(y \cdot \log e\right)\right) \]
    4. Applied rewrites56.3%

      \[\leadsto \color{blue}{c \cdot \left(x \cdot \left(y \cdot \log e\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(x \cdot \left(y \cdot \log e\right)\right)} \]
      2. lift-*.f64N/A

        \[\leadsto c \cdot \left(x \cdot \color{blue}{\left(y \cdot \log e\right)}\right) \]
      3. *-commutativeN/A

        \[\leadsto c \cdot \left(\left(y \cdot \log e\right) \cdot \color{blue}{x}\right) \]
      4. lift-*.f64N/A

        \[\leadsto c \cdot \left(\left(y \cdot \log e\right) \cdot x\right) \]
      5. lift-log.f64N/A

        \[\leadsto c \cdot \left(\left(y \cdot \log e\right) \cdot x\right) \]
      6. lift-E.f64N/A

        \[\leadsto c \cdot \left(\left(y \cdot \log \mathsf{E}\left(\right)\right) \cdot x\right) \]
      7. log-EN/A

        \[\leadsto c \cdot \left(\left(y \cdot 1\right) \cdot x\right) \]
      8. *-rgt-identityN/A

        \[\leadsto c \cdot \left(y \cdot x\right) \]
      9. associate-*r*N/A

        \[\leadsto \left(c \cdot y\right) \cdot \color{blue}{x} \]
      10. lower-*.f64N/A

        \[\leadsto \left(c \cdot y\right) \cdot \color{blue}{x} \]
      11. *-commutativeN/A

        \[\leadsto \left(y \cdot c\right) \cdot x \]
      12. lower-*.f6462.3%

        \[\leadsto \left(y \cdot c\right) \cdot x \]
    6. Applied rewrites62.3%

      \[\leadsto \left(y \cdot c\right) \cdot \color{blue}{x} \]

    if 8200 < c

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \color{blue}{y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + \color{blue}{c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + \color{blue}{c} \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      6. lower-pow.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      7. lower--.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      8. lower-pow.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      9. lower-E.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      10. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \color{blue}{\left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
    4. Applied rewrites44.9%

      \[\leadsto \color{blue}{y \cdot \left(-0.5 \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
      3. lower-*.f6444.9%

        \[\leadsto \left(-0.5 \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
    6. Applied rewrites44.9%

      \[\leadsto \left(c \cdot \left(\left(e^{x} - 1\right) + \left({\left(e^{x} - 1\right)}^{2} \cdot -0.5\right) \cdot y\right)\right) \cdot \color{blue}{y} \]
    7. Taylor expanded in x around 0

      \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      2. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      4. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      5. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      6. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      7. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      8. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
    9. Applied rewrites54.7%

      \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(0.5 + -0.5 \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(0.041666666666666664 + -0.2916666666666667 \cdot y\right)\right) + c \cdot \left(0.16666666666666666 + -0.5 \cdot y\right)\right)\right)\right)\right) \cdot y \]
    10. Taylor expanded in c around 0

      \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
    11. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      2. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      4. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      5. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      6. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      7. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      8. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
      9. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(\frac{1}{2} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{6} + \left(\frac{-1}{2} \cdot y + x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
    12. Applied rewrites57.9%

      \[\leadsto \left(x \cdot \left(c \cdot \left(1 + x \cdot \left(0.5 + \left(-0.5 \cdot y + x \cdot \left(0.16666666666666666 + \left(-0.5 \cdot y + x \cdot \left(0.041666666666666664 + -0.2916666666666667 \cdot y\right)\right)\right)\right)\right)\right)\right)\right) \cdot y \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 10: 64.8% accurate, 1.3× speedup?

\[\mathsf{copysign}\left(1, c\right) \cdot \begin{array}{l} \mathbf{if}\;\left|c\right| \leq 10^{+118}:\\ \;\;\;\;\left(y \cdot \left|c\right|\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(\left|c\right| + x \cdot \left(0.5 \cdot \left|c\right| + x \cdot \left(0.041666666666666664 \cdot \left(\left|c\right| \cdot x\right) + 0.16666666666666666 \cdot \left|c\right|\right)\right)\right)\right) \cdot y\\ \end{array} \]
(FPCore (c x y)
  :precision binary64
  (*
 (copysign 1.0 c)
 (if (<= (fabs c) 1e+118)
   (* (* y (fabs c)) x)
   (*
    (*
     x
     (+
      (fabs c)
      (*
       x
       (+
        (* 0.5 (fabs c))
        (*
         x
         (+
          (* 0.041666666666666664 (* (fabs c) x))
          (* 0.16666666666666666 (fabs c))))))))
    y))))
double code(double c, double x, double y) {
	double tmp;
	if (fabs(c) <= 1e+118) {
		tmp = (y * fabs(c)) * x;
	} else {
		tmp = (x * (fabs(c) + (x * ((0.5 * fabs(c)) + (x * ((0.041666666666666664 * (fabs(c) * x)) + (0.16666666666666666 * fabs(c)))))))) * y;
	}
	return copysign(1.0, c) * tmp;
}
public static double code(double c, double x, double y) {
	double tmp;
	if (Math.abs(c) <= 1e+118) {
		tmp = (y * Math.abs(c)) * x;
	} else {
		tmp = (x * (Math.abs(c) + (x * ((0.5 * Math.abs(c)) + (x * ((0.041666666666666664 * (Math.abs(c) * x)) + (0.16666666666666666 * Math.abs(c)))))))) * y;
	}
	return Math.copySign(1.0, c) * tmp;
}
def code(c, x, y):
	tmp = 0
	if math.fabs(c) <= 1e+118:
		tmp = (y * math.fabs(c)) * x
	else:
		tmp = (x * (math.fabs(c) + (x * ((0.5 * math.fabs(c)) + (x * ((0.041666666666666664 * (math.fabs(c) * x)) + (0.16666666666666666 * math.fabs(c)))))))) * y
	return math.copysign(1.0, c) * tmp
function code(c, x, y)
	tmp = 0.0
	if (abs(c) <= 1e+118)
		tmp = Float64(Float64(y * abs(c)) * x);
	else
		tmp = Float64(Float64(x * Float64(abs(c) + Float64(x * Float64(Float64(0.5 * abs(c)) + Float64(x * Float64(Float64(0.041666666666666664 * Float64(abs(c) * x)) + Float64(0.16666666666666666 * abs(c)))))))) * y);
	end
	return Float64(copysign(1.0, c) * tmp)
end
function tmp_2 = code(c, x, y)
	tmp = 0.0;
	if (abs(c) <= 1e+118)
		tmp = (y * abs(c)) * x;
	else
		tmp = (x * (abs(c) + (x * ((0.5 * abs(c)) + (x * ((0.041666666666666664 * (abs(c) * x)) + (0.16666666666666666 * abs(c)))))))) * y;
	end
	tmp_2 = (sign(c) * abs(1.0)) * tmp;
end
code[c_, x_, y_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[c], $MachinePrecision], 1e+118], N[(N[(y * N[Abs[c], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(x * N[(N[Abs[c], $MachinePrecision] + N[(x * N[(N[(0.5 * N[Abs[c], $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(0.041666666666666664 * N[(N[Abs[c], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + N[(0.16666666666666666 * N[Abs[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, c\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|c\right| \leq 10^{+118}:\\
\;\;\;\;\left(y \cdot \left|c\right|\right) \cdot x\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(\left|c\right| + x \cdot \left(0.5 \cdot \left|c\right| + x \cdot \left(0.041666666666666664 \cdot \left(\left|c\right| \cdot x\right) + 0.16666666666666666 \cdot \left|c\right|\right)\right)\right)\right) \cdot y\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < 9.9999999999999997e117

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in x around 0

      \[\leadsto \color{blue}{c \cdot \left(x \cdot \left(y \cdot \log e\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(x \cdot \left(y \cdot \log \mathsf{E}\left(\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto c \cdot \left(x \cdot \color{blue}{\left(y \cdot \log \mathsf{E}\left(\right)\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto c \cdot \left(x \cdot \left(y \cdot \color{blue}{\log \mathsf{E}\left(\right)}\right)\right) \]
      4. lower-log.f64N/A

        \[\leadsto c \cdot \left(x \cdot \left(y \cdot \log \mathsf{E}\left(\right)\right)\right) \]
      5. lower-E.f6456.3%

        \[\leadsto c \cdot \left(x \cdot \left(y \cdot \log e\right)\right) \]
    4. Applied rewrites56.3%

      \[\leadsto \color{blue}{c \cdot \left(x \cdot \left(y \cdot \log e\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(x \cdot \left(y \cdot \log e\right)\right)} \]
      2. lift-*.f64N/A

        \[\leadsto c \cdot \left(x \cdot \color{blue}{\left(y \cdot \log e\right)}\right) \]
      3. *-commutativeN/A

        \[\leadsto c \cdot \left(\left(y \cdot \log e\right) \cdot \color{blue}{x}\right) \]
      4. lift-*.f64N/A

        \[\leadsto c \cdot \left(\left(y \cdot \log e\right) \cdot x\right) \]
      5. lift-log.f64N/A

        \[\leadsto c \cdot \left(\left(y \cdot \log e\right) \cdot x\right) \]
      6. lift-E.f64N/A

        \[\leadsto c \cdot \left(\left(y \cdot \log \mathsf{E}\left(\right)\right) \cdot x\right) \]
      7. log-EN/A

        \[\leadsto c \cdot \left(\left(y \cdot 1\right) \cdot x\right) \]
      8. *-rgt-identityN/A

        \[\leadsto c \cdot \left(y \cdot x\right) \]
      9. associate-*r*N/A

        \[\leadsto \left(c \cdot y\right) \cdot \color{blue}{x} \]
      10. lower-*.f64N/A

        \[\leadsto \left(c \cdot y\right) \cdot \color{blue}{x} \]
      11. *-commutativeN/A

        \[\leadsto \left(y \cdot c\right) \cdot x \]
      12. lower-*.f6462.3%

        \[\leadsto \left(y \cdot c\right) \cdot x \]
    6. Applied rewrites62.3%

      \[\leadsto \left(y \cdot c\right) \cdot \color{blue}{x} \]

    if 9.9999999999999997e117 < c

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in y around 0

      \[\leadsto \color{blue}{y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right)} \]
      2. lower-+.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + \color{blue}{c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + \color{blue}{c} \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      6. lower-pow.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      7. lower--.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      8. lower-pow.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({\mathsf{E}\left(\right)}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      9. lower-E.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({\mathsf{E}\left(\right)}^{x} - 1\right)\right) \]
      10. lower-*.f64N/A

        \[\leadsto y \cdot \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \color{blue}{\left({\mathsf{E}\left(\right)}^{x} - 1\right)}\right) \]
    4. Applied rewrites44.9%

      \[\leadsto \color{blue}{y \cdot \left(-0.5 \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(\frac{-1}{2} \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
      3. lower-*.f6444.9%

        \[\leadsto \left(-0.5 \cdot \left(c \cdot \left(y \cdot {\left({e}^{x} - 1\right)}^{2}\right)\right) + c \cdot \left({e}^{x} - 1\right)\right) \cdot \color{blue}{y} \]
    6. Applied rewrites44.9%

      \[\leadsto \left(c \cdot \left(\left(e^{x} - 1\right) + \left({\left(e^{x} - 1\right)}^{2} \cdot -0.5\right) \cdot y\right)\right) \cdot \color{blue}{y} \]
    7. Taylor expanded in x around 0

      \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      2. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      4. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      5. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      6. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      7. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
      8. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(\frac{1}{24} + \frac{-7}{24} \cdot y\right)\right) + c \cdot \left(\frac{1}{6} + \frac{-1}{2} \cdot y\right)\right)\right)\right)\right) \cdot y \]
    9. Applied rewrites54.7%

      \[\leadsto \left(x \cdot \left(c + x \cdot \left(c \cdot \left(0.5 + -0.5 \cdot y\right) + x \cdot \left(c \cdot \left(x \cdot \left(0.041666666666666664 + -0.2916666666666667 \cdot y\right)\right) + c \cdot \left(0.16666666666666666 + -0.5 \cdot y\right)\right)\right)\right)\right) \cdot y \]
    10. Taylor expanded in y around 0

      \[\leadsto \left(x \cdot \left(c + x \cdot \left(\frac{1}{2} \cdot c + x \cdot \left(\frac{1}{24} \cdot \left(c \cdot x\right) + \frac{1}{6} \cdot c\right)\right)\right)\right) \cdot y \]
    11. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(\frac{1}{2} \cdot c + x \cdot \left(\frac{1}{24} \cdot \left(c \cdot x\right) + \frac{1}{6} \cdot c\right)\right)\right)\right) \cdot y \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(\frac{1}{2} \cdot c + x \cdot \left(\frac{1}{24} \cdot \left(c \cdot x\right) + \frac{1}{6} \cdot c\right)\right)\right)\right) \cdot y \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(\frac{1}{2} \cdot c + x \cdot \left(\frac{1}{24} \cdot \left(c \cdot x\right) + \frac{1}{6} \cdot c\right)\right)\right)\right) \cdot y \]
      4. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(\frac{1}{2} \cdot c + x \cdot \left(\frac{1}{24} \cdot \left(c \cdot x\right) + \frac{1}{6} \cdot c\right)\right)\right)\right) \cdot y \]
      5. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(\frac{1}{2} \cdot c + x \cdot \left(\frac{1}{24} \cdot \left(c \cdot x\right) + \frac{1}{6} \cdot c\right)\right)\right)\right) \cdot y \]
      6. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(\frac{1}{2} \cdot c + x \cdot \left(\frac{1}{24} \cdot \left(c \cdot x\right) + \frac{1}{6} \cdot c\right)\right)\right)\right) \cdot y \]
      7. lower-*.f6458.1%

        \[\leadsto \left(x \cdot \left(c + x \cdot \left(0.5 \cdot c + x \cdot \left(0.041666666666666664 \cdot \left(c \cdot x\right) + 0.16666666666666666 \cdot c\right)\right)\right)\right) \cdot y \]
    12. Applied rewrites58.1%

      \[\leadsto \left(x \cdot \left(c + x \cdot \left(0.5 \cdot c + x \cdot \left(0.041666666666666664 \cdot \left(c \cdot x\right) + 0.16666666666666666 \cdot c\right)\right)\right)\right) \cdot y \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 11: 64.8% accurate, 1.7× speedup?

\[\mathsf{copysign}\left(1, c\right) \cdot \begin{array}{l} \mathbf{if}\;\left|c\right| \leq 10^{+116}:\\ \;\;\;\;\left(y \cdot \left|c\right|\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left|c\right|\right) \cdot y\\ \end{array} \]
(FPCore (c x y)
  :precision binary64
  (*
 (copysign 1.0 c)
 (if (<= (fabs c) 1e+116) (* (* y (fabs c)) x) (* (* x (fabs c)) y))))
double code(double c, double x, double y) {
	double tmp;
	if (fabs(c) <= 1e+116) {
		tmp = (y * fabs(c)) * x;
	} else {
		tmp = (x * fabs(c)) * y;
	}
	return copysign(1.0, c) * tmp;
}
public static double code(double c, double x, double y) {
	double tmp;
	if (Math.abs(c) <= 1e+116) {
		tmp = (y * Math.abs(c)) * x;
	} else {
		tmp = (x * Math.abs(c)) * y;
	}
	return Math.copySign(1.0, c) * tmp;
}
def code(c, x, y):
	tmp = 0
	if math.fabs(c) <= 1e+116:
		tmp = (y * math.fabs(c)) * x
	else:
		tmp = (x * math.fabs(c)) * y
	return math.copysign(1.0, c) * tmp
function code(c, x, y)
	tmp = 0.0
	if (abs(c) <= 1e+116)
		tmp = Float64(Float64(y * abs(c)) * x);
	else
		tmp = Float64(Float64(x * abs(c)) * y);
	end
	return Float64(copysign(1.0, c) * tmp)
end
function tmp_2 = code(c, x, y)
	tmp = 0.0;
	if (abs(c) <= 1e+116)
		tmp = (y * abs(c)) * x;
	else
		tmp = (x * abs(c)) * y;
	end
	tmp_2 = (sign(c) * abs(1.0)) * tmp;
end
code[c_, x_, y_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[c], $MachinePrecision], 1e+116], N[(N[(y * N[Abs[c], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(x * N[Abs[c], $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, c\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|c\right| \leq 10^{+116}:\\
\;\;\;\;\left(y \cdot \left|c\right|\right) \cdot x\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left|c\right|\right) \cdot y\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < 1e116

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in x around 0

      \[\leadsto \color{blue}{c \cdot \left(x \cdot \left(y \cdot \log e\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(x \cdot \left(y \cdot \log \mathsf{E}\left(\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto c \cdot \left(x \cdot \color{blue}{\left(y \cdot \log \mathsf{E}\left(\right)\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto c \cdot \left(x \cdot \left(y \cdot \color{blue}{\log \mathsf{E}\left(\right)}\right)\right) \]
      4. lower-log.f64N/A

        \[\leadsto c \cdot \left(x \cdot \left(y \cdot \log \mathsf{E}\left(\right)\right)\right) \]
      5. lower-E.f6456.3%

        \[\leadsto c \cdot \left(x \cdot \left(y \cdot \log e\right)\right) \]
    4. Applied rewrites56.3%

      \[\leadsto \color{blue}{c \cdot \left(x \cdot \left(y \cdot \log e\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(x \cdot \left(y \cdot \log e\right)\right)} \]
      2. lift-*.f64N/A

        \[\leadsto c \cdot \left(x \cdot \color{blue}{\left(y \cdot \log e\right)}\right) \]
      3. *-commutativeN/A

        \[\leadsto c \cdot \left(\left(y \cdot \log e\right) \cdot \color{blue}{x}\right) \]
      4. lift-*.f64N/A

        \[\leadsto c \cdot \left(\left(y \cdot \log e\right) \cdot x\right) \]
      5. lift-log.f64N/A

        \[\leadsto c \cdot \left(\left(y \cdot \log e\right) \cdot x\right) \]
      6. lift-E.f64N/A

        \[\leadsto c \cdot \left(\left(y \cdot \log \mathsf{E}\left(\right)\right) \cdot x\right) \]
      7. log-EN/A

        \[\leadsto c \cdot \left(\left(y \cdot 1\right) \cdot x\right) \]
      8. *-rgt-identityN/A

        \[\leadsto c \cdot \left(y \cdot x\right) \]
      9. associate-*r*N/A

        \[\leadsto \left(c \cdot y\right) \cdot \color{blue}{x} \]
      10. lower-*.f64N/A

        \[\leadsto \left(c \cdot y\right) \cdot \color{blue}{x} \]
      11. *-commutativeN/A

        \[\leadsto \left(y \cdot c\right) \cdot x \]
      12. lower-*.f6462.3%

        \[\leadsto \left(y \cdot c\right) \cdot x \]
    6. Applied rewrites62.3%

      \[\leadsto \left(y \cdot c\right) \cdot \color{blue}{x} \]

    if 1e116 < c

    1. Initial program 41.2%

      \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
    2. Taylor expanded in x around 0

      \[\leadsto \color{blue}{c \cdot \left(x \cdot \left(y \cdot \log e\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(x \cdot \left(y \cdot \log \mathsf{E}\left(\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto c \cdot \left(x \cdot \color{blue}{\left(y \cdot \log \mathsf{E}\left(\right)\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto c \cdot \left(x \cdot \left(y \cdot \color{blue}{\log \mathsf{E}\left(\right)}\right)\right) \]
      4. lower-log.f64N/A

        \[\leadsto c \cdot \left(x \cdot \left(y \cdot \log \mathsf{E}\left(\right)\right)\right) \]
      5. lower-E.f6456.3%

        \[\leadsto c \cdot \left(x \cdot \left(y \cdot \log e\right)\right) \]
    4. Applied rewrites56.3%

      \[\leadsto \color{blue}{c \cdot \left(x \cdot \left(y \cdot \log e\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto c \cdot \color{blue}{\left(x \cdot \left(y \cdot \log e\right)\right)} \]
      2. lift-*.f64N/A

        \[\leadsto c \cdot \left(x \cdot \color{blue}{\left(y \cdot \log e\right)}\right) \]
      3. associate-*r*N/A

        \[\leadsto \left(c \cdot x\right) \cdot \color{blue}{\left(y \cdot \log e\right)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(c \cdot x\right) \cdot \left(y \cdot \color{blue}{\log e}\right) \]
      5. lift-log.f64N/A

        \[\leadsto \left(c \cdot x\right) \cdot \left(y \cdot \log e\right) \]
      6. lift-E.f64N/A

        \[\leadsto \left(c \cdot x\right) \cdot \left(y \cdot \log \mathsf{E}\left(\right)\right) \]
      7. log-EN/A

        \[\leadsto \left(c \cdot x\right) \cdot \left(y \cdot 1\right) \]
      8. *-rgt-identityN/A

        \[\leadsto \left(c \cdot x\right) \cdot y \]
      9. lower-*.f64N/A

        \[\leadsto \left(c \cdot x\right) \cdot \color{blue}{y} \]
      10. *-commutativeN/A

        \[\leadsto \left(x \cdot c\right) \cdot y \]
      11. lower-*.f6459.8%

        \[\leadsto \left(x \cdot c\right) \cdot y \]
    6. Applied rewrites59.8%

      \[\leadsto \left(x \cdot c\right) \cdot \color{blue}{y} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 12: 59.8% accurate, 19.8× speedup?

\[\left(x \cdot c\right) \cdot y \]
(FPCore (c x y)
  :precision binary64
  (* (* x c) y))
double code(double c, double x, double y) {
	return (x * c) * y;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(c, x, y)
use fmin_fmax_functions
    real(8), intent (in) :: c
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (x * c) * y
end function
public static double code(double c, double x, double y) {
	return (x * c) * y;
}
def code(c, x, y):
	return (x * c) * y
function code(c, x, y)
	return Float64(Float64(x * c) * y)
end
function tmp = code(c, x, y)
	tmp = (x * c) * y;
end
code[c_, x_, y_] := N[(N[(x * c), $MachinePrecision] * y), $MachinePrecision]
\left(x \cdot c\right) \cdot y
Derivation
  1. Initial program 41.2%

    \[c \cdot \log \left(1 + \left({e}^{x} - 1\right) \cdot y\right) \]
  2. Taylor expanded in x around 0

    \[\leadsto \color{blue}{c \cdot \left(x \cdot \left(y \cdot \log e\right)\right)} \]
  3. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto c \cdot \color{blue}{\left(x \cdot \left(y \cdot \log \mathsf{E}\left(\right)\right)\right)} \]
    2. lower-*.f64N/A

      \[\leadsto c \cdot \left(x \cdot \color{blue}{\left(y \cdot \log \mathsf{E}\left(\right)\right)}\right) \]
    3. lower-*.f64N/A

      \[\leadsto c \cdot \left(x \cdot \left(y \cdot \color{blue}{\log \mathsf{E}\left(\right)}\right)\right) \]
    4. lower-log.f64N/A

      \[\leadsto c \cdot \left(x \cdot \left(y \cdot \log \mathsf{E}\left(\right)\right)\right) \]
    5. lower-E.f6456.3%

      \[\leadsto c \cdot \left(x \cdot \left(y \cdot \log e\right)\right) \]
  4. Applied rewrites56.3%

    \[\leadsto \color{blue}{c \cdot \left(x \cdot \left(y \cdot \log e\right)\right)} \]
  5. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto c \cdot \color{blue}{\left(x \cdot \left(y \cdot \log e\right)\right)} \]
    2. lift-*.f64N/A

      \[\leadsto c \cdot \left(x \cdot \color{blue}{\left(y \cdot \log e\right)}\right) \]
    3. associate-*r*N/A

      \[\leadsto \left(c \cdot x\right) \cdot \color{blue}{\left(y \cdot \log e\right)} \]
    4. lift-*.f64N/A

      \[\leadsto \left(c \cdot x\right) \cdot \left(y \cdot \color{blue}{\log e}\right) \]
    5. lift-log.f64N/A

      \[\leadsto \left(c \cdot x\right) \cdot \left(y \cdot \log e\right) \]
    6. lift-E.f64N/A

      \[\leadsto \left(c \cdot x\right) \cdot \left(y \cdot \log \mathsf{E}\left(\right)\right) \]
    7. log-EN/A

      \[\leadsto \left(c \cdot x\right) \cdot \left(y \cdot 1\right) \]
    8. *-rgt-identityN/A

      \[\leadsto \left(c \cdot x\right) \cdot y \]
    9. lower-*.f64N/A

      \[\leadsto \left(c \cdot x\right) \cdot \color{blue}{y} \]
    10. *-commutativeN/A

      \[\leadsto \left(x \cdot c\right) \cdot y \]
    11. lower-*.f6459.8%

      \[\leadsto \left(x \cdot c\right) \cdot y \]
  6. Applied rewrites59.8%

    \[\leadsto \left(x \cdot c\right) \cdot \color{blue}{y} \]
  7. Add Preprocessing

Reproduce

?
herbie shell --seed 2025258 
(FPCore (c x y)
  :name "Logarithmic Transform"
  :precision binary64
  (* c (log (+ 1.0 (* (- (pow E x) 1.0) y)))))