
(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 10 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
(if (<= (exp z) 0.0)
(+ x (/ -1.0 x))
(if (<= (exp z) 2.0)
(+
x
(/
y
(-
(*
1.1283791670955126
(+ 1.0 (* z (+ 1.0 (* z (+ 0.5 (* z 0.16666666666666666)))))))
(* x y))))
x)))
double code(double x, double y, double z) {
double tmp;
if (exp(z) <= 0.0) {
tmp = x + (-1.0 / x);
} else if (exp(z) <= 2.0) {
tmp = x + (y / ((1.1283791670955126 * (1.0 + (z * (1.0 + (z * (0.5 + (z * 0.16666666666666666))))))) - (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) <= 0.0d0) then
tmp = x + ((-1.0d0) / x)
else if (exp(z) <= 2.0d0) then
tmp = x + (y / ((1.1283791670955126d0 * (1.0d0 + (z * (1.0d0 + (z * (0.5d0 + (z * 0.16666666666666666d0))))))) - (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) <= 0.0) {
tmp = x + (-1.0 / x);
} else if (Math.exp(z) <= 2.0) {
tmp = x + (y / ((1.1283791670955126 * (1.0 + (z * (1.0 + (z * (0.5 + (z * 0.16666666666666666))))))) - (x * y)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if math.exp(z) <= 0.0: tmp = x + (-1.0 / x) elif math.exp(z) <= 2.0: tmp = x + (y / ((1.1283791670955126 * (1.0 + (z * (1.0 + (z * (0.5 + (z * 0.16666666666666666))))))) - (x * y))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (exp(z) <= 0.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (exp(z) <= 2.0) tmp = Float64(x + Float64(y / Float64(Float64(1.1283791670955126 * Float64(1.0 + Float64(z * Float64(1.0 + Float64(z * Float64(0.5 + Float64(z * 0.16666666666666666))))))) - Float64(x * y)))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (exp(z) <= 0.0) tmp = x + (-1.0 / x); elseif (exp(z) <= 2.0) tmp = x + (y / ((1.1283791670955126 * (1.0 + (z * (1.0 + (z * (0.5 + (z * 0.16666666666666666))))))) - (x * y))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[Exp[z], $MachinePrecision], 0.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Exp[z], $MachinePrecision], 2.0], N[(x + N[(y / N[(N[(1.1283791670955126 * N[(1.0 + N[(z * N[(1.0 + N[(z * N[(0.5 + N[(z * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{z} \leq 0:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;e^{z} \leq 2:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 \cdot \left(1 + z \cdot \left(1 + z \cdot \left(0.5 + z \cdot 0.16666666666666666\right)\right)\right) - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (exp.f64 z) < 0.0Initial program 93.4%
Taylor expanded in y around inf 0
Simplified0
if 0.0 < (exp.f64 z) < 2Initial program 99.7%
Taylor expanded in z around 0 0
Simplified0
if 2 < (exp.f64 z) Initial program 95.6%
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))) (if (<= t_0 1e+217) t_0 (+ x (/ -1.0 x)))))
double code(double x, double y, double z) {
double t_0 = x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
double tmp;
if (t_0 <= 1e+217) {
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 / ((1.1283791670955126d0 * exp(z)) - (x * y)))
if (t_0 <= 1d+217) 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 / ((1.1283791670955126 * Math.exp(z)) - (x * y)));
double tmp;
if (t_0 <= 1e+217) {
tmp = t_0;
} else {
tmp = x + (-1.0 / x);
}
return tmp;
}
def code(x, y, z): t_0 = x + (y / ((1.1283791670955126 * math.exp(z)) - (x * y))) tmp = 0 if t_0 <= 1e+217: tmp = t_0 else: tmp = x + (-1.0 / x) return tmp
function code(x, y, z) t_0 = Float64(x + Float64(y / Float64(Float64(1.1283791670955126 * exp(z)) - Float64(x * y)))) tmp = 0.0 if (t_0 <= 1e+217) 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 / ((1.1283791670955126 * exp(z)) - (x * y))); tmp = 0.0; if (t_0 <= 1e+217) 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[(1.1283791670955126 * N[Exp[z], $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e+217], t$95$0, N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\\
\mathbf{if}\;t\_0 \leq 10^{+217}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-1}{x}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y)))) < 9.9999999999999996e216Initial program 99.0%
if 9.9999999999999996e216 < (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y)))) Initial program 83.2%
Taylor expanded in y around inf 0
Simplified0
(FPCore (x y z) :precision binary64 (+ x (/ y (* y (- (/ (* (exp z) 1.1283791670955126) y) x)))))
double code(double x, double y, double z) {
return x + (y / (y * (((exp(z) * 1.1283791670955126) / y) - 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 + (y / (y * (((exp(z) * 1.1283791670955126d0) / y) - x)))
end function
public static double code(double x, double y, double z) {
return x + (y / (y * (((Math.exp(z) * 1.1283791670955126) / y) - x)));
}
def code(x, y, z): return x + (y / (y * (((math.exp(z) * 1.1283791670955126) / y) - x)))
function code(x, y, z) return Float64(x + Float64(y / Float64(y * Float64(Float64(Float64(exp(z) * 1.1283791670955126) / y) - x)))) end
function tmp = code(x, y, z) tmp = x + (y / (y * (((exp(z) * 1.1283791670955126) / y) - x))); end
code[x_, y_, z_] := N[(x + N[(y / N[(y * N[(N[(N[(N[Exp[z], $MachinePrecision] * 1.1283791670955126), $MachinePrecision] / y), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{y \cdot \left(\frac{e^{z} \cdot 1.1283791670955126}{y} - x\right)}
\end{array}
Initial program 97.2%
Taylor expanded in y around inf 0
Simplified0
(FPCore (x y z) :precision binary64 (+ x (/ y (* x (- (* 1.1283791670955126 (/ (exp z) x)) y)))))
double code(double x, double y, double z) {
return x + (y / (x * ((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 / (x * ((1.1283791670955126d0 * (exp(z) / x)) - y)))
end function
public static double code(double x, double y, double z) {
return x + (y / (x * ((1.1283791670955126 * (Math.exp(z) / x)) - y)));
}
def code(x, y, z): return x + (y / (x * ((1.1283791670955126 * (math.exp(z) / x)) - y)))
function code(x, y, z) return Float64(x + Float64(y / Float64(x * Float64(Float64(1.1283791670955126 * Float64(exp(z) / x)) - y)))) end
function tmp = code(x, y, z) tmp = x + (y / (x * ((1.1283791670955126 * (exp(z) / x)) - y))); end
code[x_, y_, z_] := N[(x + N[(y / N[(x * N[(N[(1.1283791670955126 * N[(N[Exp[z], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{x \cdot \left(1.1283791670955126 \cdot \frac{e^{z}}{x} - y\right)}
\end{array}
Initial program 97.2%
Taylor expanded in y around inf 0
Simplified0
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z)
:precision binary64
(if (<= z -95.0)
(+ x (/ -1.0 x))
(if (<= z 220.0)
(+
x
(/
y
(-
(+
1.1283791670955126
(*
z
(+
1.1283791670955126
(* z (+ 0.5641895835477563 (* z 0.18806319451591877))))))
(* x y))))
x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -95.0) {
tmp = x + (-1.0 / x);
} else if (z <= 220.0) {
tmp = x + (y / ((1.1283791670955126 + (z * (1.1283791670955126 + (z * (0.5641895835477563 + (z * 0.18806319451591877)))))) - (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 (z <= (-95.0d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 220.0d0) then
tmp = x + (y / ((1.1283791670955126d0 + (z * (1.1283791670955126d0 + (z * (0.5641895835477563d0 + (z * 0.18806319451591877d0)))))) - (x * y)))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -95.0) {
tmp = x + (-1.0 / x);
} else if (z <= 220.0) {
tmp = x + (y / ((1.1283791670955126 + (z * (1.1283791670955126 + (z * (0.5641895835477563 + (z * 0.18806319451591877)))))) - (x * y)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -95.0: tmp = x + (-1.0 / x) elif z <= 220.0: tmp = x + (y / ((1.1283791670955126 + (z * (1.1283791670955126 + (z * (0.5641895835477563 + (z * 0.18806319451591877)))))) - (x * y))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -95.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 220.0) tmp = Float64(x + Float64(y / Float64(Float64(1.1283791670955126 + Float64(z * Float64(1.1283791670955126 + Float64(z * Float64(0.5641895835477563 + Float64(z * 0.18806319451591877)))))) - Float64(x * y)))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -95.0) tmp = x + (-1.0 / x); elseif (z <= 220.0) tmp = x + (y / ((1.1283791670955126 + (z * (1.1283791670955126 + (z * (0.5641895835477563 + (z * 0.18806319451591877)))))) - (x * y))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -95.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 220.0], N[(x + N[(y / N[(N[(1.1283791670955126 + N[(z * N[(1.1283791670955126 + N[(z * N[(0.5641895835477563 + N[(z * 0.18806319451591877), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -95:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 220:\\
\;\;\;\;x + \frac{y}{\left(1.1283791670955126 + z \cdot \left(1.1283791670955126 + z \cdot \left(0.5641895835477563 + z \cdot 0.18806319451591877\right)\right)\right) - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -95Initial program 93.4%
Taylor expanded in y around inf 0
Simplified0
if -95 < z < 220Initial program 99.7%
Taylor expanded in z around 0 0
Simplified0
if 220 < z Initial program 95.6%
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z)
:precision binary64
(if (<= z -125.0)
(+ x (/ -1.0 x))
(if (<= z 200.0)
(+
x
(/
y
(-
(+
1.1283791670955126
(* z (+ 1.1283791670955126 (* z 0.5641895835477563))))
(* x y))))
x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -125.0) {
tmp = x + (-1.0 / x);
} else if (z <= 200.0) {
tmp = x + (y / ((1.1283791670955126 + (z * (1.1283791670955126 + (z * 0.5641895835477563)))) - (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 (z <= (-125.0d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 200.0d0) then
tmp = x + (y / ((1.1283791670955126d0 + (z * (1.1283791670955126d0 + (z * 0.5641895835477563d0)))) - (x * y)))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -125.0) {
tmp = x + (-1.0 / x);
} else if (z <= 200.0) {
tmp = x + (y / ((1.1283791670955126 + (z * (1.1283791670955126 + (z * 0.5641895835477563)))) - (x * y)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -125.0: tmp = x + (-1.0 / x) elif z <= 200.0: tmp = x + (y / ((1.1283791670955126 + (z * (1.1283791670955126 + (z * 0.5641895835477563)))) - (x * y))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -125.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 200.0) tmp = Float64(x + Float64(y / Float64(Float64(1.1283791670955126 + Float64(z * Float64(1.1283791670955126 + Float64(z * 0.5641895835477563)))) - Float64(x * y)))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -125.0) tmp = x + (-1.0 / x); elseif (z <= 200.0) tmp = x + (y / ((1.1283791670955126 + (z * (1.1283791670955126 + (z * 0.5641895835477563)))) - (x * y))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -125.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 200.0], N[(x + N[(y / N[(N[(1.1283791670955126 + N[(z * N[(1.1283791670955126 + N[(z * 0.5641895835477563), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -125:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 200:\\
\;\;\;\;x + \frac{y}{\left(1.1283791670955126 + z \cdot \left(1.1283791670955126 + z \cdot 0.5641895835477563\right)\right) - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -125Initial program 93.4%
Taylor expanded in y around inf 0
Simplified0
if -125 < z < 200Initial program 99.7%
Taylor expanded in z around 0 0
Simplified0
if 200 < z Initial program 95.6%
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= z -270.0) (+ x (/ -1.0 x)) (if (<= z 190.0) (+ x (/ 1.0 (- (/ 1.1283791670955126 y) x))) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -270.0) {
tmp = x + (-1.0 / x);
} else if (z <= 190.0) {
tmp = x + (1.0 / ((1.1283791670955126 / y) - x));
} 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 <= (-270.0d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 190.0d0) then
tmp = x + (1.0d0 / ((1.1283791670955126d0 / y) - x))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -270.0) {
tmp = x + (-1.0 / x);
} else if (z <= 190.0) {
tmp = x + (1.0 / ((1.1283791670955126 / y) - x));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -270.0: tmp = x + (-1.0 / x) elif z <= 190.0: tmp = x + (1.0 / ((1.1283791670955126 / y) - x)) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -270.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 190.0) tmp = Float64(x + Float64(1.0 / Float64(Float64(1.1283791670955126 / y) - x))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -270.0) tmp = x + (-1.0 / x); elseif (z <= 190.0) tmp = x + (1.0 / ((1.1283791670955126 / y) - x)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -270.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 190.0], N[(x + N[(1.0 / N[(N[(1.1283791670955126 / y), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -270:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 190:\\
\;\;\;\;x + \frac{1}{\frac{1.1283791670955126}{y} - x}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -270Initial program 93.4%
Taylor expanded in y around inf 0
Simplified0
if -270 < z < 190Initial program 99.7%
Taylor expanded in y around inf 0
Simplified0
Taylor expanded in z around 0 0
Simplified0
if 190 < z Initial program 95.6%
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= z -4.1e-24) (+ x (/ -1.0 x)) (if (<= z 6.5e-24) (+ x (/ y 1.1283791670955126)) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -4.1e-24) {
tmp = x + (-1.0 / x);
} else if (z <= 6.5e-24) {
tmp = x + (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 (z <= (-4.1d-24)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 6.5d-24) then
tmp = x + (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 (z <= -4.1e-24) {
tmp = x + (-1.0 / x);
} else if (z <= 6.5e-24) {
tmp = x + (y / 1.1283791670955126);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -4.1e-24: tmp = x + (-1.0 / x) elif z <= 6.5e-24: tmp = x + (y / 1.1283791670955126) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -4.1e-24) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 6.5e-24) tmp = Float64(x + Float64(y / 1.1283791670955126)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -4.1e-24) tmp = x + (-1.0 / x); elseif (z <= 6.5e-24) tmp = x + (y / 1.1283791670955126); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -4.1e-24], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e-24], N[(x + N[(y / 1.1283791670955126), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{-24}:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-24}:\\
\;\;\;\;x + \frac{y}{1.1283791670955126}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.10000000000000015e-24Initial program 94.0%
Taylor expanded in y around inf 0
Simplified0
if -4.10000000000000015e-24 < z < 6.5e-24Initial program 99.7%
Taylor expanded in z around 0 0
Simplified0
Taylor expanded in y around 0 0
Simplified0
if 6.5e-24 < z Initial program 95.9%
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= z -2.65e-17) (+ x (/ -1.0 x)) x))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.65e-17) {
tmp = x + (-1.0 / x);
} 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 <= (-2.65d-17)) then
tmp = x + ((-1.0d0) / x)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.65e-17) {
tmp = x + (-1.0 / x);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.65e-17: tmp = x + (-1.0 / x) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.65e-17) tmp = Float64(x + Float64(-1.0 / x)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.65e-17) tmp = x + (-1.0 / x); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.65e-17], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.65 \cdot 10^{-17}:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.6499999999999999e-17Initial program 93.8%
Taylor expanded in y around inf 0
Simplified0
if -2.6499999999999999e-17 < z Initial program 98.3%
Taylor expanded in x around inf 0
Simplified0
(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 97.2%
Taylor expanded in x around inf 0
Simplified0
(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 2024110
(FPCore (x y z)
:name "Numeric.SpecFunctions:invErfc from math-functions-0.1.5.2, A"
:precision binary64
:alt
(+ x (/ 1.0 (- (* (/ 1.1283791670955126 y) (exp z)) x)))
(+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))