exact-inv-exp2Ce

Percentage Accurate: 100.0% → 100.0%
Time: 1.6min
Alternatives: 7
Speedup: 1.0×

Specification

?
\[e^{2 \cdot Ce} \]
(FPCore (Ce)
  :precision binary64
  :pre TRUE
  (exp (* 2.0 Ce)))
double code(double Ce) {
	return exp((2.0 * Ce));
}
real(8) function code(ce)
use fmin_fmax_functions
    real(8), intent (in) :: ce
    code = exp((2.0d0 * ce))
end function
public static double code(double Ce) {
	return Math.exp((2.0 * Ce));
}
def code(Ce):
	return math.exp((2.0 * Ce))
function code(Ce)
	return exp(Float64(2.0 * Ce))
end
function tmp = code(Ce)
	tmp = exp((2.0 * Ce));
end
code[Ce_] := N[Exp[N[(2.0 * Ce), $MachinePrecision]], $MachinePrecision]
f(Ce):
	Ce in [-inf, +inf]
code: THEORY
BEGIN
f(Ce: real): real =
	exp(((2) * Ce))
END code
e^{2 \cdot Ce}

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 7 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: 100.0% accurate, 1.0× speedup?

\[e^{2 \cdot Ce} \]
(FPCore (Ce)
  :precision binary64
  :pre TRUE
  (exp (* 2.0 Ce)))
double code(double Ce) {
	return exp((2.0 * Ce));
}
real(8) function code(ce)
use fmin_fmax_functions
    real(8), intent (in) :: ce
    code = exp((2.0d0 * ce))
end function
public static double code(double Ce) {
	return Math.exp((2.0 * Ce));
}
def code(Ce):
	return math.exp((2.0 * Ce))
function code(Ce)
	return exp(Float64(2.0 * Ce))
end
function tmp = code(Ce)
	tmp = exp((2.0 * Ce));
end
code[Ce_] := N[Exp[N[(2.0 * Ce), $MachinePrecision]], $MachinePrecision]
f(Ce):
	Ce in [-inf, +inf]
code: THEORY
BEGIN
f(Ce: real): real =
	exp(((2) * Ce))
END code
e^{2 \cdot Ce}

Alternative 1: 100.0% accurate, 1.0× speedup?

\[e^{Ce + Ce} \]
(FPCore (Ce)
  :precision binary64
  :pre TRUE
  (exp (+ Ce Ce)))
double code(double Ce) {
	return exp((Ce + Ce));
}
real(8) function code(ce)
use fmin_fmax_functions
    real(8), intent (in) :: ce
    code = exp((ce + ce))
end function
public static double code(double Ce) {
	return Math.exp((Ce + Ce));
}
def code(Ce):
	return math.exp((Ce + Ce))
function code(Ce)
	return exp(Float64(Ce + Ce))
end
function tmp = code(Ce)
	tmp = exp((Ce + Ce));
end
code[Ce_] := N[Exp[N[(Ce + Ce), $MachinePrecision]], $MachinePrecision]
f(Ce):
	Ce in [-inf, +inf]
code: THEORY
BEGIN
f(Ce: real): real =
	exp((Ce + Ce))
END code
e^{Ce + Ce}
Derivation
  1. Initial program 100.0%

    \[e^{2 \cdot Ce} \]
  2. Applied rewrites100.0%

    \[\leadsto e^{Ce + Ce} \]
  3. Add Preprocessing

Alternative 2: 87.5% accurate, 0.8× speedup?

\[\begin{array}{l} \mathbf{if}\;2 \cdot Ce \leq -2000000:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(Ce, Ce, Ce\right), 2, 1\right)\\ \end{array} \]
(FPCore (Ce)
  :precision binary64
  :pre TRUE
  (if (<= (* 2.0 Ce) -2000000.0) 0.0 (fma (fma Ce Ce Ce) 2.0 1.0)))
double code(double Ce) {
	double tmp;
	if ((2.0 * Ce) <= -2000000.0) {
		tmp = 0.0;
	} else {
		tmp = fma(fma(Ce, Ce, Ce), 2.0, 1.0);
	}
	return tmp;
}
function code(Ce)
	tmp = 0.0
	if (Float64(2.0 * Ce) <= -2000000.0)
		tmp = 0.0;
	else
		tmp = fma(fma(Ce, Ce, Ce), 2.0, 1.0);
	end
	return tmp
end
code[Ce_] := If[LessEqual[N[(2.0 * Ce), $MachinePrecision], -2000000.0], 0.0, N[(N[(Ce * Ce + Ce), $MachinePrecision] * 2.0 + 1.0), $MachinePrecision]]
f(Ce):
	Ce in [-inf, +inf]
code: THEORY
BEGIN
f(Ce: real): real =
	LET tmp = IF (((2) * Ce) <= (-2e6)) THEN (0) ELSE ((((Ce * Ce) + Ce) * (2)) + (1)) ENDIF IN
	tmp
END code
\begin{array}{l}
\mathbf{if}\;2 \cdot Ce \leq -2000000:\\
\;\;\;\;0\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(Ce, Ce, Ce\right), 2, 1\right)\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 #s(literal 2 binary64) Ce) < -2e6

    1. Initial program 100.0%

      \[e^{2 \cdot Ce} \]
    2. Taylor expanded in Ce around 0

      \[\leadsto 1 + 2 \cdot Ce \]
    3. Applied rewrites51.3%

      \[\leadsto 1 + 2 \cdot Ce \]
    4. Applied rewrites51.3%

      \[\leadsto \mathsf{fma}\left(Ce, 2, 1\right) \]
    5. Taylor expanded in Ce around inf

      \[\leadsto 2 \cdot Ce \]
    6. Applied rewrites3.8%

      \[\leadsto 2 \cdot Ce \]
    7. Applied rewrites26.6%

      \[\leadsto 0 \]

    if -2e6 < (*.f64 #s(literal 2 binary64) Ce)

    1. Initial program 100.0%

      \[e^{2 \cdot Ce} \]
    2. Taylor expanded in Ce around 0

      \[\leadsto 1 + Ce \cdot \left(2 + 2 \cdot Ce\right) \]
    3. Applied rewrites63.6%

      \[\leadsto 1 + Ce \cdot \left(2 + 2 \cdot Ce\right) \]
    4. Applied rewrites63.6%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(Ce, Ce, Ce\right), 2, 1\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 87.5% accurate, 0.4× speedup?

\[\begin{array}{l} t_0 := e^{2 \cdot Ce}\\ \mathbf{if}\;t\_0 \leq 0.001:\\ \;\;\;\;0\\ \mathbf{elif}\;t\_0 \leq 2:\\ \;\;\;\;\mathsf{fma}\left(Ce, 2, 1\right)\\ \mathbf{else}:\\ \;\;\;\;Ce \cdot Ce\\ \end{array} \]
(FPCore (Ce)
  :precision binary64
  :pre TRUE
  (let* ((t_0 (exp (* 2.0 Ce))))
  (if (<= t_0 0.001)
    0.0
    (if (<= t_0 2.0) (fma Ce 2.0 1.0) (* Ce Ce)))))
double code(double Ce) {
	double t_0 = exp((2.0 * Ce));
	double tmp;
	if (t_0 <= 0.001) {
		tmp = 0.0;
	} else if (t_0 <= 2.0) {
		tmp = fma(Ce, 2.0, 1.0);
	} else {
		tmp = Ce * Ce;
	}
	return tmp;
}
function code(Ce)
	t_0 = exp(Float64(2.0 * Ce))
	tmp = 0.0
	if (t_0 <= 0.001)
		tmp = 0.0;
	elseif (t_0 <= 2.0)
		tmp = fma(Ce, 2.0, 1.0);
	else
		tmp = Float64(Ce * Ce);
	end
	return tmp
end
code[Ce_] := Block[{t$95$0 = N[Exp[N[(2.0 * Ce), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, 0.001], 0.0, If[LessEqual[t$95$0, 2.0], N[(Ce * 2.0 + 1.0), $MachinePrecision], N[(Ce * Ce), $MachinePrecision]]]]
f(Ce):
	Ce in [-inf, +inf]
code: THEORY
BEGIN
f(Ce: real): real =
	LET t_0 = (exp(((2) * Ce))) IN
		LET tmp_1 = IF (t_0 <= (2)) THEN ((Ce * (2)) + (1)) ELSE (Ce * Ce) ENDIF IN
		LET tmp = IF (t_0 <= (1000000000000000020816681711721685132943093776702880859375e-60)) THEN (0) ELSE tmp_1 ENDIF IN
	tmp
END code
\begin{array}{l}
t_0 := e^{2 \cdot Ce}\\
\mathbf{if}\;t\_0 \leq 0.001:\\
\;\;\;\;0\\

\mathbf{elif}\;t\_0 \leq 2:\\
\;\;\;\;\mathsf{fma}\left(Ce, 2, 1\right)\\

\mathbf{else}:\\
\;\;\;\;Ce \cdot Ce\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (exp.f64 (*.f64 #s(literal 2 binary64) Ce)) < 1e-3

    1. Initial program 100.0%

      \[e^{2 \cdot Ce} \]
    2. Taylor expanded in Ce around 0

      \[\leadsto 1 + 2 \cdot Ce \]
    3. Applied rewrites51.3%

      \[\leadsto 1 + 2 \cdot Ce \]
    4. Applied rewrites51.3%

      \[\leadsto \mathsf{fma}\left(Ce, 2, 1\right) \]
    5. Taylor expanded in Ce around inf

      \[\leadsto 2 \cdot Ce \]
    6. Applied rewrites3.8%

      \[\leadsto 2 \cdot Ce \]
    7. Applied rewrites26.6%

      \[\leadsto 0 \]

    if 1e-3 < (exp.f64 (*.f64 #s(literal 2 binary64) Ce)) < 2

    1. Initial program 100.0%

      \[e^{2 \cdot Ce} \]
    2. Taylor expanded in Ce around 0

      \[\leadsto 1 + 2 \cdot Ce \]
    3. Applied rewrites51.3%

      \[\leadsto 1 + 2 \cdot Ce \]
    4. Applied rewrites51.3%

      \[\leadsto \mathsf{fma}\left(Ce, 2, 1\right) \]

    if 2 < (exp.f64 (*.f64 #s(literal 2 binary64) Ce))

    1. Initial program 100.0%

      \[e^{2 \cdot Ce} \]
    2. Taylor expanded in Ce around 0

      \[\leadsto 1 + 2 \cdot Ce \]
    3. Applied rewrites51.3%

      \[\leadsto 1 + 2 \cdot Ce \]
    4. Applied rewrites51.3%

      \[\leadsto \mathsf{fma}\left(Ce, 2, 1\right) \]
    5. Taylor expanded in Ce around inf

      \[\leadsto 2 \cdot Ce \]
    6. Applied rewrites3.8%

      \[\leadsto 2 \cdot Ce \]
    7. Applied rewrites16.2%

      \[\leadsto Ce \cdot Ce \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 4: 87.1% accurate, 0.4× speedup?

\[\begin{array}{l} t_0 := e^{2 \cdot Ce}\\ \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;0\\ \mathbf{elif}\;t\_0 \leq 2:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;Ce \cdot Ce\\ \end{array} \]
(FPCore (Ce)
  :precision binary64
  :pre TRUE
  (let* ((t_0 (exp (* 2.0 Ce))))
  (if (<= t_0 0.0) 0.0 (if (<= t_0 2.0) 1.0 (* Ce Ce)))))
double code(double Ce) {
	double t_0 = exp((2.0 * Ce));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = 0.0;
	} else if (t_0 <= 2.0) {
		tmp = 1.0;
	} else {
		tmp = Ce * Ce;
	}
	return tmp;
}
real(8) function code(ce)
use fmin_fmax_functions
    real(8), intent (in) :: ce
    real(8) :: t_0
    real(8) :: tmp
    t_0 = exp((2.0d0 * ce))
    if (t_0 <= 0.0d0) then
        tmp = 0.0d0
    else if (t_0 <= 2.0d0) then
        tmp = 1.0d0
    else
        tmp = ce * ce
    end if
    code = tmp
end function
public static double code(double Ce) {
	double t_0 = Math.exp((2.0 * Ce));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = 0.0;
	} else if (t_0 <= 2.0) {
		tmp = 1.0;
	} else {
		tmp = Ce * Ce;
	}
	return tmp;
}
def code(Ce):
	t_0 = math.exp((2.0 * Ce))
	tmp = 0
	if t_0 <= 0.0:
		tmp = 0.0
	elif t_0 <= 2.0:
		tmp = 1.0
	else:
		tmp = Ce * Ce
	return tmp
function code(Ce)
	t_0 = exp(Float64(2.0 * Ce))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = 0.0;
	elseif (t_0 <= 2.0)
		tmp = 1.0;
	else
		tmp = Float64(Ce * Ce);
	end
	return tmp
end
function tmp_2 = code(Ce)
	t_0 = exp((2.0 * Ce));
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = 0.0;
	elseif (t_0 <= 2.0)
		tmp = 1.0;
	else
		tmp = Ce * Ce;
	end
	tmp_2 = tmp;
end
code[Ce_] := Block[{t$95$0 = N[Exp[N[(2.0 * Ce), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], 0.0, If[LessEqual[t$95$0, 2.0], 1.0, N[(Ce * Ce), $MachinePrecision]]]]
f(Ce):
	Ce in [-inf, +inf]
code: THEORY
BEGIN
f(Ce: real): real =
	LET t_0 = (exp(((2) * Ce))) IN
		LET tmp_1 = IF (t_0 <= (2)) THEN (1) ELSE (Ce * Ce) ENDIF IN
		LET tmp = IF (t_0 <= (0)) THEN (0) ELSE tmp_1 ENDIF IN
	tmp
END code
\begin{array}{l}
t_0 := e^{2 \cdot Ce}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;0\\

\mathbf{elif}\;t\_0 \leq 2:\\
\;\;\;\;1\\

\mathbf{else}:\\
\;\;\;\;Ce \cdot Ce\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (exp.f64 (*.f64 #s(literal 2 binary64) Ce)) < 0.0

    1. Initial program 100.0%

      \[e^{2 \cdot Ce} \]
    2. Taylor expanded in Ce around 0

      \[\leadsto 1 + 2 \cdot Ce \]
    3. Applied rewrites51.3%

      \[\leadsto 1 + 2 \cdot Ce \]
    4. Applied rewrites51.3%

      \[\leadsto \mathsf{fma}\left(Ce, 2, 1\right) \]
    5. Taylor expanded in Ce around inf

      \[\leadsto 2 \cdot Ce \]
    6. Applied rewrites3.8%

      \[\leadsto 2 \cdot Ce \]
    7. Applied rewrites26.6%

      \[\leadsto 0 \]

    if 0.0 < (exp.f64 (*.f64 #s(literal 2 binary64) Ce)) < 2

    1. Initial program 100.0%

      \[e^{2 \cdot Ce} \]
    2. Taylor expanded in Ce around 0

      \[\leadsto 1 \]
    3. Applied rewrites50.4%

      \[\leadsto 1 \]

    if 2 < (exp.f64 (*.f64 #s(literal 2 binary64) Ce))

    1. Initial program 100.0%

      \[e^{2 \cdot Ce} \]
    2. Taylor expanded in Ce around 0

      \[\leadsto 1 + 2 \cdot Ce \]
    3. Applied rewrites51.3%

      \[\leadsto 1 + 2 \cdot Ce \]
    4. Applied rewrites51.3%

      \[\leadsto \mathsf{fma}\left(Ce, 2, 1\right) \]
    5. Taylor expanded in Ce around inf

      \[\leadsto 2 \cdot Ce \]
    6. Applied rewrites3.8%

      \[\leadsto 2 \cdot Ce \]
    7. Applied rewrites16.2%

      \[\leadsto Ce \cdot Ce \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 5: 74.9% accurate, 1.4× speedup?

\[\begin{array}{l} \mathbf{if}\;2 \cdot Ce \leq -5:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;Ce - -1\\ \end{array} \]
(FPCore (Ce)
  :precision binary64
  :pre TRUE
  (if (<= (* 2.0 Ce) -5.0) 0.0 (- Ce -1.0)))
double code(double Ce) {
	double tmp;
	if ((2.0 * Ce) <= -5.0) {
		tmp = 0.0;
	} else {
		tmp = Ce - -1.0;
	}
	return tmp;
}
real(8) function code(ce)
use fmin_fmax_functions
    real(8), intent (in) :: ce
    real(8) :: tmp
    if ((2.0d0 * ce) <= (-5.0d0)) then
        tmp = 0.0d0
    else
        tmp = ce - (-1.0d0)
    end if
    code = tmp
end function
public static double code(double Ce) {
	double tmp;
	if ((2.0 * Ce) <= -5.0) {
		tmp = 0.0;
	} else {
		tmp = Ce - -1.0;
	}
	return tmp;
}
def code(Ce):
	tmp = 0
	if (2.0 * Ce) <= -5.0:
		tmp = 0.0
	else:
		tmp = Ce - -1.0
	return tmp
function code(Ce)
	tmp = 0.0
	if (Float64(2.0 * Ce) <= -5.0)
		tmp = 0.0;
	else
		tmp = Float64(Ce - -1.0);
	end
	return tmp
end
function tmp_2 = code(Ce)
	tmp = 0.0;
	if ((2.0 * Ce) <= -5.0)
		tmp = 0.0;
	else
		tmp = Ce - -1.0;
	end
	tmp_2 = tmp;
end
code[Ce_] := If[LessEqual[N[(2.0 * Ce), $MachinePrecision], -5.0], 0.0, N[(Ce - -1.0), $MachinePrecision]]
f(Ce):
	Ce in [-inf, +inf]
code: THEORY
BEGIN
f(Ce: real): real =
	LET tmp = IF (((2) * Ce) <= (-5)) THEN (0) ELSE (Ce - (-1)) ENDIF IN
	tmp
END code
\begin{array}{l}
\mathbf{if}\;2 \cdot Ce \leq -5:\\
\;\;\;\;0\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 #s(literal 2 binary64) Ce) < -5

    1. Initial program 100.0%

      \[e^{2 \cdot Ce} \]
    2. Taylor expanded in Ce around 0

      \[\leadsto 1 + 2 \cdot Ce \]
    3. Applied rewrites51.3%

      \[\leadsto 1 + 2 \cdot Ce \]
    4. Applied rewrites51.3%

      \[\leadsto \mathsf{fma}\left(Ce, 2, 1\right) \]
    5. Taylor expanded in Ce around inf

      \[\leadsto 2 \cdot Ce \]
    6. Applied rewrites3.8%

      \[\leadsto 2 \cdot Ce \]
    7. Applied rewrites26.6%

      \[\leadsto 0 \]

    if -5 < (*.f64 #s(literal 2 binary64) Ce)

    1. Initial program 100.0%

      \[e^{2 \cdot Ce} \]
    2. Taylor expanded in Ce around 0

      \[\leadsto 1 + 2 \cdot Ce \]
    3. Applied rewrites51.3%

      \[\leadsto 1 + 2 \cdot Ce \]
    4. Applied rewrites51.3%

      \[\leadsto Ce - \left(-1 - Ce\right) \]
    5. Taylor expanded in Ce around 0

      \[\leadsto Ce - -1 \]
    6. Applied rewrites50.8%

      \[\leadsto Ce - -1 \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 74.0% accurate, 1.9× speedup?

\[\begin{array}{l} \mathbf{if}\;2 \cdot Ce \leq -2000000:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
(FPCore (Ce)
  :precision binary64
  :pre TRUE
  (if (<= (* 2.0 Ce) -2000000.0) 0.0 1.0))
double code(double Ce) {
	double tmp;
	if ((2.0 * Ce) <= -2000000.0) {
		tmp = 0.0;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
real(8) function code(ce)
use fmin_fmax_functions
    real(8), intent (in) :: ce
    real(8) :: tmp
    if ((2.0d0 * ce) <= (-2000000.0d0)) then
        tmp = 0.0d0
    else
        tmp = 1.0d0
    end if
    code = tmp
end function
public static double code(double Ce) {
	double tmp;
	if ((2.0 * Ce) <= -2000000.0) {
		tmp = 0.0;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
def code(Ce):
	tmp = 0
	if (2.0 * Ce) <= -2000000.0:
		tmp = 0.0
	else:
		tmp = 1.0
	return tmp
function code(Ce)
	tmp = 0.0
	if (Float64(2.0 * Ce) <= -2000000.0)
		tmp = 0.0;
	else
		tmp = 1.0;
	end
	return tmp
end
function tmp_2 = code(Ce)
	tmp = 0.0;
	if ((2.0 * Ce) <= -2000000.0)
		tmp = 0.0;
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
code[Ce_] := If[LessEqual[N[(2.0 * Ce), $MachinePrecision], -2000000.0], 0.0, 1.0]
f(Ce):
	Ce in [-inf, +inf]
code: THEORY
BEGIN
f(Ce: real): real =
	LET tmp = IF (((2) * Ce) <= (-2e6)) THEN (0) ELSE (1) ENDIF IN
	tmp
END code
\begin{array}{l}
\mathbf{if}\;2 \cdot Ce \leq -2000000:\\
\;\;\;\;0\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 #s(literal 2 binary64) Ce) < -2e6

    1. Initial program 100.0%

      \[e^{2 \cdot Ce} \]
    2. Taylor expanded in Ce around 0

      \[\leadsto 1 + 2 \cdot Ce \]
    3. Applied rewrites51.3%

      \[\leadsto 1 + 2 \cdot Ce \]
    4. Applied rewrites51.3%

      \[\leadsto \mathsf{fma}\left(Ce, 2, 1\right) \]
    5. Taylor expanded in Ce around inf

      \[\leadsto 2 \cdot Ce \]
    6. Applied rewrites3.8%

      \[\leadsto 2 \cdot Ce \]
    7. Applied rewrites26.6%

      \[\leadsto 0 \]

    if -2e6 < (*.f64 #s(literal 2 binary64) Ce)

    1. Initial program 100.0%

      \[e^{2 \cdot Ce} \]
    2. Taylor expanded in Ce around 0

      \[\leadsto 1 \]
    3. Applied rewrites50.4%

      \[\leadsto 1 \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 7: 50.4% accurate, 15.0× speedup?

\[1 \]
(FPCore (Ce)
  :precision binary64
  :pre TRUE
  1.0)
double code(double Ce) {
	return 1.0;
}
real(8) function code(ce)
use fmin_fmax_functions
    real(8), intent (in) :: ce
    code = 1.0d0
end function
public static double code(double Ce) {
	return 1.0;
}
def code(Ce):
	return 1.0
function code(Ce)
	return 1.0
end
function tmp = code(Ce)
	tmp = 1.0;
end
code[Ce_] := 1.0
f(Ce):
	Ce in [-inf, +inf]
code: THEORY
BEGIN
f(Ce: real): real =
	1
END code
1
Derivation
  1. Initial program 100.0%

    \[e^{2 \cdot Ce} \]
  2. Taylor expanded in Ce around 0

    \[\leadsto 1 \]
  3. Applied rewrites50.4%

    \[\leadsto 1 \]
  4. Add Preprocessing

Reproduce

?
herbie shell --seed 2026050 +o generate:egglog
(FPCore (Ce)
  :name "exact-inv-exp2Ce"
  :precision binary64
  (exp (* 2.0 Ce)))