
(FPCore (x y z) :precision binary64 (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))
double code(double x, double y, double z) {
return x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (y / ((1.1283791670955126d0 * exp(z)) - (x * y)))
end function
public static double code(double x, double y, double z) {
return x + (y / ((1.1283791670955126 * Math.exp(z)) - (x * y)));
}
def code(x, y, z): return x + (y / ((1.1283791670955126 * math.exp(z)) - (x * y)))
function code(x, y, z) return Float64(x + Float64(y / Float64(Float64(1.1283791670955126 * exp(z)) - Float64(x * y)))) end
function tmp = code(x, y, z) tmp = x + (y / ((1.1283791670955126 * exp(z)) - (x * y))); end
code[x_, y_, z_] := N[(x + N[(y / N[(N[(1.1283791670955126 * N[Exp[z], $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))
double code(double x, double y, double z) {
return x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (y / ((1.1283791670955126d0 * exp(z)) - (x * y)))
end function
public static double code(double x, double y, double z) {
return x + (y / ((1.1283791670955126 * Math.exp(z)) - (x * y)));
}
def code(x, y, z): return x + (y / ((1.1283791670955126 * math.exp(z)) - (x * y)))
function code(x, y, z) return Float64(x + Float64(y / Float64(Float64(1.1283791670955126 * exp(z)) - Float64(x * y)))) end
function tmp = code(x, y, z) tmp = x + (y / ((1.1283791670955126 * exp(z)) - (x * y))); end
code[x_, y_, z_] := N[(x + N[(y / N[(N[(1.1283791670955126 * N[Exp[z], $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}
\end{array}
(FPCore (x y z) :precision binary64 (+ x (/ -1.0 (fma (exp z) (/ -1.1283791670955126 y) x))))
double code(double x, double y, double z) {
return x + (-1.0 / fma(exp(z), (-1.1283791670955126 / y), x));
}
function code(x, y, z) return Float64(x + Float64(-1.0 / fma(exp(z), Float64(-1.1283791670955126 / y), x))) end
code[x_, y_, z_] := N[(x + N[(-1.0 / N[(N[Exp[z], $MachinePrecision] * N[(-1.1283791670955126 / y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{-1}{\mathsf{fma}\left(e^{z}, \frac{-1.1283791670955126}{y}, x\right)}
\end{array}
Initial program 94.1%
*-lft-identity94.1%
metadata-eval94.1%
times-frac94.1%
neg-mul-194.1%
sub0-neg94.2%
associate-+l-94.2%
neg-sub094.3%
+-commutative94.3%
sub-neg94.3%
associate-/l*94.3%
div-sub94.2%
associate-*r/99.9%
*-inverses99.9%
*-rgt-identity99.9%
associate-*l/99.9%
cancel-sign-sub-inv99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
associate-*l/99.9%
distribute-rgt-neg-in99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ x (/ y (- (* (exp z) 1.1283791670955126) (* x y)))))) (if (<= t_0 2e+265) t_0 (- x (/ 1.0 x)))))
double code(double x, double y, double z) {
double t_0 = x + (y / ((exp(z) * 1.1283791670955126) - (x * y)));
double tmp;
if (t_0 <= 2e+265) {
tmp = t_0;
} else {
tmp = x - (1.0 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x + (y / ((exp(z) * 1.1283791670955126d0) - (x * y)))
if (t_0 <= 2d+265) then
tmp = t_0
else
tmp = x - (1.0d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (y / ((Math.exp(z) * 1.1283791670955126) - (x * y)));
double tmp;
if (t_0 <= 2e+265) {
tmp = t_0;
} else {
tmp = x - (1.0 / x);
}
return tmp;
}
def code(x, y, z): t_0 = x + (y / ((math.exp(z) * 1.1283791670955126) - (x * y))) tmp = 0 if t_0 <= 2e+265: tmp = t_0 else: tmp = x - (1.0 / x) return tmp
function code(x, y, z) t_0 = Float64(x + Float64(y / Float64(Float64(exp(z) * 1.1283791670955126) - Float64(x * y)))) tmp = 0.0 if (t_0 <= 2e+265) tmp = t_0; else tmp = Float64(x - Float64(1.0 / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (y / ((exp(z) * 1.1283791670955126) - (x * y))); tmp = 0.0; if (t_0 <= 2e+265) tmp = t_0; else tmp = x - (1.0 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(y / N[(N[(N[Exp[z], $MachinePrecision] * 1.1283791670955126), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e+265], t$95$0, N[(x - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{+265}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x - \frac{1}{x}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 y (-.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)) (*.f64 x y)))) < 2.00000000000000013e265Initial program 98.3%
if 2.00000000000000013e265 < (+.f64 x (/.f64 y (-.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)) (*.f64 x y)))) Initial program 45.2%
*-lft-identity45.2%
metadata-eval45.2%
times-frac45.2%
neg-mul-145.2%
sub0-neg46.5%
associate-+l-46.5%
neg-sub046.8%
+-commutative46.8%
sub-neg46.8%
associate-/l*46.8%
div-sub46.8%
associate-*r/100.0%
*-inverses100.0%
*-rgt-identity100.0%
associate-*l/100.0%
cancel-sign-sub-inv100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
associate-*l/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
Final simplification98.4%
(FPCore (x y z) :precision binary64 (if (<= (exp z) 7.5e-162) (- x (/ 1.0 x)) (if (<= (exp z) 1.0) (+ x (/ y (- 1.1283791670955126 (* x y)))) x)))
double code(double x, double y, double z) {
double tmp;
if (exp(z) <= 7.5e-162) {
tmp = x - (1.0 / x);
} else if (exp(z) <= 1.0) {
tmp = x + (y / (1.1283791670955126 - (x * y)));
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (exp(z) <= 7.5d-162) then
tmp = x - (1.0d0 / x)
else if (exp(z) <= 1.0d0) then
tmp = x + (y / (1.1283791670955126d0 - (x * y)))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (Math.exp(z) <= 7.5e-162) {
tmp = x - (1.0 / x);
} else if (Math.exp(z) <= 1.0) {
tmp = x + (y / (1.1283791670955126 - (x * y)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if math.exp(z) <= 7.5e-162: tmp = x - (1.0 / x) elif math.exp(z) <= 1.0: tmp = x + (y / (1.1283791670955126 - (x * y))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (exp(z) <= 7.5e-162) tmp = Float64(x - Float64(1.0 / x)); elseif (exp(z) <= 1.0) tmp = Float64(x + Float64(y / Float64(1.1283791670955126 - Float64(x * y)))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (exp(z) <= 7.5e-162) tmp = x - (1.0 / x); elseif (exp(z) <= 1.0) tmp = x + (y / (1.1283791670955126 - (x * y))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[Exp[z], $MachinePrecision], 7.5e-162], N[(x - N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Exp[z], $MachinePrecision], 1.0], N[(x + N[(y / N[(1.1283791670955126 - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{z} \leq 7.5 \cdot 10^{-162}:\\
\;\;\;\;x - \frac{1}{x}\\
\mathbf{elif}\;e^{z} \leq 1:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (exp.f64 z) < 7.49999999999999972e-162Initial program 87.7%
*-lft-identity87.7%
metadata-eval87.7%
times-frac87.7%
neg-mul-187.7%
sub0-neg87.9%
associate-+l-87.9%
neg-sub088.3%
+-commutative88.3%
sub-neg88.3%
associate-/l*88.3%
div-sub88.2%
associate-*r/100.0%
*-inverses100.0%
*-rgt-identity100.0%
associate-*l/100.0%
cancel-sign-sub-inv100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
associate-*l/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if 7.49999999999999972e-162 < (exp.f64 z) < 1Initial program 99.8%
Taylor expanded in z around 0 99.8%
if 1 < (exp.f64 z) Initial program 91.0%
*-lft-identity91.0%
metadata-eval91.0%
times-frac91.0%
neg-mul-191.0%
sub0-neg91.0%
associate-+l-91.0%
neg-sub091.0%
+-commutative91.0%
sub-neg91.0%
associate-/l*91.0%
div-sub91.0%
associate-*r/100.0%
*-inverses100.0%
*-rgt-identity100.0%
associate-*l/100.0%
cancel-sign-sub-inv100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
associate-*l/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (<= x -2.4e-104) x (if (<= x 1.95e-170) (- x (* y -0.8862269254527579)) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.4e-104) {
tmp = x;
} else if (x <= 1.95e-170) {
tmp = x - (y * -0.8862269254527579);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-2.4d-104)) then
tmp = x
else if (x <= 1.95d-170) then
tmp = x - (y * (-0.8862269254527579d0))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -2.4e-104) {
tmp = x;
} else if (x <= 1.95e-170) {
tmp = x - (y * -0.8862269254527579);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2.4e-104: tmp = x elif x <= 1.95e-170: tmp = x - (y * -0.8862269254527579) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2.4e-104) tmp = x; elseif (x <= 1.95e-170) tmp = Float64(x - Float64(y * -0.8862269254527579)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2.4e-104) tmp = x; elseif (x <= 1.95e-170) tmp = x - (y * -0.8862269254527579); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2.4e-104], x, If[LessEqual[x, 1.95e-170], N[(x - N[(y * -0.8862269254527579), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{-104}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{-170}:\\
\;\;\;\;x - y \cdot -0.8862269254527579\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.4000000000000001e-104 or 1.95000000000000011e-170 < x Initial program 96.1%
*-lft-identity96.1%
metadata-eval96.1%
times-frac96.1%
neg-mul-196.1%
sub0-neg96.1%
associate-+l-96.1%
neg-sub096.1%
+-commutative96.1%
sub-neg96.1%
associate-/l*96.1%
div-sub96.1%
associate-*r/100.0%
*-inverses100.0%
*-rgt-identity100.0%
associate-*l/100.0%
cancel-sign-sub-inv100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
associate-*l/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around inf 87.0%
if -2.4000000000000001e-104 < x < 1.95000000000000011e-170Initial program 89.3%
*-lft-identity89.3%
metadata-eval89.3%
times-frac89.3%
neg-mul-189.3%
sub0-neg89.5%
associate-+l-89.5%
neg-sub089.8%
+-commutative89.8%
sub-neg89.8%
associate-/l*89.8%
div-sub89.7%
associate-*r/99.7%
*-inverses99.7%
*-rgt-identity99.7%
associate-*l/99.7%
cancel-sign-sub-inv99.7%
distribute-lft-neg-in99.7%
distribute-rgt-neg-in99.7%
associate-*l/99.7%
distribute-rgt-neg-in99.7%
Simplified99.7%
Taylor expanded in z around 0 69.7%
associate-*r/69.7%
metadata-eval69.7%
Simplified69.7%
Taylor expanded in x around 0 55.7%
*-commutative55.7%
Simplified55.7%
Final simplification77.8%
(FPCore (x y z) :precision binary64 (if (<= z -3.5e-17) (- x (/ 1.0 x)) (if (<= z 6.2e-45) (- x (* y -0.8862269254527579)) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.5e-17) {
tmp = x - (1.0 / x);
} else if (z <= 6.2e-45) {
tmp = x - (y * -0.8862269254527579);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-3.5d-17)) then
tmp = x - (1.0d0 / x)
else if (z <= 6.2d-45) then
tmp = x - (y * (-0.8862269254527579d0))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.5e-17) {
tmp = x - (1.0 / x);
} else if (z <= 6.2e-45) {
tmp = x - (y * -0.8862269254527579);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.5e-17: tmp = x - (1.0 / x) elif z <= 6.2e-45: tmp = x - (y * -0.8862269254527579) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.5e-17) tmp = Float64(x - Float64(1.0 / x)); elseif (z <= 6.2e-45) tmp = Float64(x - Float64(y * -0.8862269254527579)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.5e-17) tmp = x - (1.0 / x); elseif (z <= 6.2e-45) tmp = x - (y * -0.8862269254527579); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.5e-17], N[(x - N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e-45], N[(x - N[(y * -0.8862269254527579), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-17}:\\
\;\;\;\;x - \frac{1}{x}\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-45}:\\
\;\;\;\;x - y \cdot -0.8862269254527579\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.5000000000000002e-17Initial program 88.2%
*-lft-identity88.2%
metadata-eval88.2%
times-frac88.2%
neg-mul-188.2%
sub0-neg88.4%
associate-+l-88.4%
neg-sub088.7%
+-commutative88.7%
sub-neg88.7%
associate-/l*88.8%
div-sub88.7%
associate-*r/100.0%
*-inverses100.0%
*-rgt-identity100.0%
associate-*l/100.0%
cancel-sign-sub-inv100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
associate-*l/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if -3.5000000000000002e-17 < z < 6.2000000000000002e-45Initial program 99.8%
*-lft-identity99.8%
metadata-eval99.8%
times-frac99.8%
neg-mul-199.8%
sub0-neg99.8%
associate-+l-99.8%
neg-sub099.8%
+-commutative99.8%
sub-neg99.8%
associate-/l*99.8%
div-sub99.8%
associate-*r/99.8%
*-inverses99.8%
*-rgt-identity99.8%
associate-*l/99.8%
cancel-sign-sub-inv99.8%
distribute-lft-neg-in99.8%
distribute-rgt-neg-in99.8%
associate-*l/99.8%
distribute-rgt-neg-in99.8%
Simplified99.8%
Taylor expanded in z around 0 99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 80.7%
*-commutative80.7%
Simplified80.7%
if 6.2000000000000002e-45 < z Initial program 91.5%
*-lft-identity91.5%
metadata-eval91.5%
times-frac91.5%
neg-mul-191.5%
sub0-neg91.5%
associate-+l-91.5%
neg-sub091.5%
+-commutative91.5%
sub-neg91.5%
associate-/l*91.5%
div-sub91.5%
associate-*r/100.0%
*-inverses100.0%
*-rgt-identity100.0%
associate-*l/100.0%
cancel-sign-sub-inv100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
associate-*l/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around inf 97.3%
Final simplification90.9%
(FPCore (x y z) :precision binary64 (if (<= x -9.5e-169) x (if (<= x 1.25e-169) (/ (- y) -1.1283791670955126) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -9.5e-169) {
tmp = x;
} else if (x <= 1.25e-169) {
tmp = -y / -1.1283791670955126;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-9.5d-169)) then
tmp = x
else if (x <= 1.25d-169) then
tmp = -y / (-1.1283791670955126d0)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -9.5e-169) {
tmp = x;
} else if (x <= 1.25e-169) {
tmp = -y / -1.1283791670955126;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -9.5e-169: tmp = x elif x <= 1.25e-169: tmp = -y / -1.1283791670955126 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -9.5e-169) tmp = x; elseif (x <= 1.25e-169) tmp = Float64(Float64(-y) / -1.1283791670955126); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -9.5e-169) tmp = x; elseif (x <= 1.25e-169) tmp = -y / -1.1283791670955126; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -9.5e-169], x, If[LessEqual[x, 1.25e-169], N[((-y) / -1.1283791670955126), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{-169}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{-169}:\\
\;\;\;\;\frac{-y}{-1.1283791670955126}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -9.5000000000000001e-169 or 1.2500000000000001e-169 < x Initial program 95.8%
*-lft-identity95.8%
metadata-eval95.8%
times-frac95.8%
neg-mul-195.8%
sub0-neg95.8%
associate-+l-95.8%
neg-sub095.8%
+-commutative95.8%
sub-neg95.8%
associate-/l*95.9%
div-sub95.8%
associate-*r/100.0%
*-inverses100.0%
*-rgt-identity100.0%
associate-*l/100.0%
cancel-sign-sub-inv100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
associate-*l/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around inf 84.2%
if -9.5000000000000001e-169 < x < 1.2500000000000001e-169Initial program 89.0%
*-lft-identity89.0%
metadata-eval89.0%
times-frac89.0%
neg-mul-189.0%
sub0-neg89.1%
associate-+l-89.1%
neg-sub089.5%
+-commutative89.5%
sub-neg89.5%
associate-/l*89.4%
div-sub89.3%
associate-*r/99.7%
*-inverses99.7%
*-rgt-identity99.7%
associate-*l/99.7%
cancel-sign-sub-inv99.7%
distribute-lft-neg-in99.7%
distribute-rgt-neg-in99.7%
associate-*l/99.7%
distribute-rgt-neg-in99.7%
Simplified99.7%
Taylor expanded in z around 0 68.6%
associate-*r/68.6%
metadata-eval68.6%
Simplified68.6%
Taylor expanded in x around 0 56.4%
*-commutative56.4%
Simplified56.4%
Taylor expanded in x around 0 49.0%
*-commutative49.0%
Simplified49.0%
metadata-eval49.0%
metadata-eval48.9%
distribute-rgt-neg-in48.9%
div-inv49.1%
distribute-neg-frac49.1%
Applied egg-rr49.1%
Final simplification75.6%
(FPCore (x y z) :precision binary64 (if (<= x -1.55e-169) x (if (<= x 2.7e-169) (* y 0.8862269254527579) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.55e-169) {
tmp = x;
} else if (x <= 2.7e-169) {
tmp = y * 0.8862269254527579;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.55d-169)) then
tmp = x
else if (x <= 2.7d-169) then
tmp = y * 0.8862269254527579d0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.55e-169) {
tmp = x;
} else if (x <= 2.7e-169) {
tmp = y * 0.8862269254527579;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.55e-169: tmp = x elif x <= 2.7e-169: tmp = y * 0.8862269254527579 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.55e-169) tmp = x; elseif (x <= 2.7e-169) tmp = Float64(y * 0.8862269254527579); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.55e-169) tmp = x; elseif (x <= 2.7e-169) tmp = y * 0.8862269254527579; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.55e-169], x, If[LessEqual[x, 2.7e-169], N[(y * 0.8862269254527579), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{-169}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-169}:\\
\;\;\;\;y \cdot 0.8862269254527579\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.5500000000000001e-169 or 2.7000000000000002e-169 < x Initial program 95.8%
*-lft-identity95.8%
metadata-eval95.8%
times-frac95.8%
neg-mul-195.8%
sub0-neg95.8%
associate-+l-95.8%
neg-sub095.8%
+-commutative95.8%
sub-neg95.8%
associate-/l*95.9%
div-sub95.8%
associate-*r/100.0%
*-inverses100.0%
*-rgt-identity100.0%
associate-*l/100.0%
cancel-sign-sub-inv100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
associate-*l/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around inf 84.2%
if -1.5500000000000001e-169 < x < 2.7000000000000002e-169Initial program 89.0%
*-lft-identity89.0%
metadata-eval89.0%
times-frac89.0%
neg-mul-189.0%
sub0-neg89.1%
associate-+l-89.1%
neg-sub089.5%
+-commutative89.5%
sub-neg89.5%
associate-/l*89.4%
div-sub89.3%
associate-*r/99.7%
*-inverses99.7%
*-rgt-identity99.7%
associate-*l/99.7%
cancel-sign-sub-inv99.7%
distribute-lft-neg-in99.7%
distribute-rgt-neg-in99.7%
associate-*l/99.7%
distribute-rgt-neg-in99.7%
Simplified99.7%
Taylor expanded in z around 0 68.6%
associate-*r/68.6%
metadata-eval68.6%
Simplified68.6%
Taylor expanded in x around 0 56.4%
*-commutative56.4%
Simplified56.4%
Taylor expanded in x around 0 49.0%
*-commutative49.0%
Simplified49.0%
Final simplification75.6%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 94.1%
*-lft-identity94.1%
metadata-eval94.1%
times-frac94.1%
neg-mul-194.1%
sub0-neg94.2%
associate-+l-94.2%
neg-sub094.3%
+-commutative94.3%
sub-neg94.3%
associate-/l*94.3%
div-sub94.2%
associate-*r/99.9%
*-inverses99.9%
*-rgt-identity99.9%
associate-*l/99.9%
cancel-sign-sub-inv99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
associate-*l/99.9%
distribute-rgt-neg-in99.9%
Simplified99.9%
Taylor expanded in x around inf 68.3%
Final simplification68.3%
(FPCore (x y z) :precision binary64 (+ x (/ 1.0 (- (* (/ 1.1283791670955126 y) (exp z)) x))))
double code(double x, double y, double z) {
return x + (1.0 / (((1.1283791670955126 / y) * exp(z)) - x));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (1.0d0 / (((1.1283791670955126d0 / y) * exp(z)) - x))
end function
public static double code(double x, double y, double z) {
return x + (1.0 / (((1.1283791670955126 / y) * Math.exp(z)) - x));
}
def code(x, y, z): return x + (1.0 / (((1.1283791670955126 / y) * math.exp(z)) - x))
function code(x, y, z) return Float64(x + Float64(1.0 / Float64(Float64(Float64(1.1283791670955126 / y) * exp(z)) - x))) end
function tmp = code(x, y, z) tmp = x + (1.0 / (((1.1283791670955126 / y) * exp(z)) - x)); end
code[x_, y_, z_] := N[(x + N[(1.0 / N[(N[(N[(1.1283791670955126 / y), $MachinePrecision] * N[Exp[z], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{1}{\frac{1.1283791670955126}{y} \cdot e^{z} - x}
\end{array}
herbie shell --seed 2023200
(FPCore (x y z)
:name "Numeric.SpecFunctions:invErfc from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(+ x (/ 1.0 (- (* (/ 1.1283791670955126 y) (exp z)) x)))
(+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))