
(FPCore (x y z) :precision binary64 (+ (+ x (sin y)) (* z (cos y))))
double code(double x, double y, double z) {
return (x + sin(y)) + (z * cos(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 + sin(y)) + (z * cos(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.sin(y)) + (z * Math.cos(y));
}
def code(x, y, z): return (x + math.sin(y)) + (z * math.cos(y))
function code(x, y, z) return Float64(Float64(x + sin(y)) + Float64(z * cos(y))) end
function tmp = code(x, y, z) tmp = (x + sin(y)) + (z * cos(y)); end
code[x_, y_, z_] := N[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \sin y\right) + z \cdot \cos y
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ (+ x (sin y)) (* z (cos y))))
double code(double x, double y, double z) {
return (x + sin(y)) + (z * cos(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 + sin(y)) + (z * cos(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.sin(y)) + (z * Math.cos(y));
}
def code(x, y, z): return (x + math.sin(y)) + (z * math.cos(y))
function code(x, y, z) return Float64(Float64(x + sin(y)) + Float64(z * cos(y))) end
function tmp = code(x, y, z) tmp = (x + sin(y)) + (z * cos(y)); end
code[x_, y_, z_] := N[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \sin y\right) + z \cdot \cos y
\end{array}
(FPCore (x y z) :precision binary64 (+ (* z (cos y)) (+ x (sin y))))
double code(double x, double y, double z) {
return (z * cos(y)) + (x + sin(y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (z * cos(y)) + (x + sin(y))
end function
public static double code(double x, double y, double z) {
return (z * Math.cos(y)) + (x + Math.sin(y));
}
def code(x, y, z): return (z * math.cos(y)) + (x + math.sin(y))
function code(x, y, z) return Float64(Float64(z * cos(y)) + Float64(x + sin(y))) end
function tmp = code(x, y, z) tmp = (z * cos(y)) + (x + sin(y)); end
code[x_, y_, z_] := N[(N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision] + N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \cos y + \left(x + \sin y\right)
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.42e+32) (not (<= z 2.8e-23))) (+ x (* z (cos y))) (* x (+ (+ 1.0 (* (sin y) (/ 1.0 x))) (/ z x)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.42e+32) || !(z <= 2.8e-23)) {
tmp = x + (z * cos(y));
} else {
tmp = x * ((1.0 + (sin(y) * (1.0 / x))) + (z / 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 <= (-1.42d+32)) .or. (.not. (z <= 2.8d-23))) then
tmp = x + (z * cos(y))
else
tmp = x * ((1.0d0 + (sin(y) * (1.0d0 / x))) + (z / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.42e+32) || !(z <= 2.8e-23)) {
tmp = x + (z * Math.cos(y));
} else {
tmp = x * ((1.0 + (Math.sin(y) * (1.0 / x))) + (z / x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.42e+32) or not (z <= 2.8e-23): tmp = x + (z * math.cos(y)) else: tmp = x * ((1.0 + (math.sin(y) * (1.0 / x))) + (z / x)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.42e+32) || !(z <= 2.8e-23)) tmp = Float64(x + Float64(z * cos(y))); else tmp = Float64(x * Float64(Float64(1.0 + Float64(sin(y) * Float64(1.0 / x))) + Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.42e+32) || ~((z <= 2.8e-23))) tmp = x + (z * cos(y)); else tmp = x * ((1.0 + (sin(y) * (1.0 / x))) + (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.42e+32], N[Not[LessEqual[z, 2.8e-23]], $MachinePrecision]], N[(x + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(1.0 + N[(N[Sin[y], $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.42 \cdot 10^{+32} \lor \neg \left(z \leq 2.8 \cdot 10^{-23}\right):\\
\;\;\;\;x + z \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\left(1 + \sin y \cdot \frac{1}{x}\right) + \frac{z}{x}\right)\\
\end{array}
\end{array}
if z < -1.41999999999999992e32 or 2.7999999999999997e-23 < z Initial program 99.9%
Taylor expanded in x around inf 99.5%
if -1.41999999999999992e32 < z < 2.7999999999999997e-23Initial program 100.0%
Taylor expanded in x around inf 99.9%
associate-+r+99.9%
associate-/l*99.9%
Simplified99.9%
clear-num99.8%
associate-/r/99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 99.2%
Final simplification99.4%
(FPCore (x y z) :precision binary64 (if (<= z -2.3e+107) (* z (cos y)) (if (or (<= z -2.15e-44) (not (<= z 3.4e-66))) (+ x z) (+ x (sin y)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.3e+107) {
tmp = z * cos(y);
} else if ((z <= -2.15e-44) || !(z <= 3.4e-66)) {
tmp = x + z;
} else {
tmp = x + sin(y);
}
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.3d+107)) then
tmp = z * cos(y)
else if ((z <= (-2.15d-44)) .or. (.not. (z <= 3.4d-66))) then
tmp = x + z
else
tmp = x + sin(y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.3e+107) {
tmp = z * Math.cos(y);
} else if ((z <= -2.15e-44) || !(z <= 3.4e-66)) {
tmp = x + z;
} else {
tmp = x + Math.sin(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.3e+107: tmp = z * math.cos(y) elif (z <= -2.15e-44) or not (z <= 3.4e-66): tmp = x + z else: tmp = x + math.sin(y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.3e+107) tmp = Float64(z * cos(y)); elseif ((z <= -2.15e-44) || !(z <= 3.4e-66)) tmp = Float64(x + z); else tmp = Float64(x + sin(y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.3e+107) tmp = z * cos(y); elseif ((z <= -2.15e-44) || ~((z <= 3.4e-66))) tmp = x + z; else tmp = x + sin(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.3e+107], N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -2.15e-44], N[Not[LessEqual[z, 3.4e-66]], $MachinePrecision]], N[(x + z), $MachinePrecision], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+107}:\\
\;\;\;\;z \cdot \cos y\\
\mathbf{elif}\;z \leq -2.15 \cdot 10^{-44} \lor \neg \left(z \leq 3.4 \cdot 10^{-66}\right):\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;x + \sin y\\
\end{array}
\end{array}
if z < -2.3e107Initial program 99.9%
Taylor expanded in z around inf 74.2%
if -2.3e107 < z < -2.15000000000000007e-44 or 3.39999999999999997e-66 < z Initial program 99.9%
Taylor expanded in y around 0 83.5%
+-commutative83.5%
Simplified83.5%
if -2.15000000000000007e-44 < z < 3.39999999999999997e-66Initial program 100.0%
Taylor expanded in z around 0 97.1%
+-commutative97.1%
Simplified97.1%
Final simplification87.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.1e-44) (not (<= z 7e-57))) (+ x (* z (cos y))) (+ x (sin y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.1e-44) || !(z <= 7e-57)) {
tmp = x + (z * cos(y));
} else {
tmp = x + sin(y);
}
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 <= (-1.1d-44)) .or. (.not. (z <= 7d-57))) then
tmp = x + (z * cos(y))
else
tmp = x + sin(y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.1e-44) || !(z <= 7e-57)) {
tmp = x + (z * Math.cos(y));
} else {
tmp = x + Math.sin(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.1e-44) or not (z <= 7e-57): tmp = x + (z * math.cos(y)) else: tmp = x + math.sin(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.1e-44) || !(z <= 7e-57)) tmp = Float64(x + Float64(z * cos(y))); else tmp = Float64(x + sin(y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.1e-44) || ~((z <= 7e-57))) tmp = x + (z * cos(y)); else tmp = x + sin(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.1e-44], N[Not[LessEqual[z, 7e-57]], $MachinePrecision]], N[(x + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{-44} \lor \neg \left(z \leq 7 \cdot 10^{-57}\right):\\
\;\;\;\;x + z \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;x + \sin y\\
\end{array}
\end{array}
if z < -1.10000000000000006e-44 or 6.99999999999999983e-57 < z Initial program 99.9%
Taylor expanded in x around inf 98.3%
if -1.10000000000000006e-44 < z < 6.99999999999999983e-57Initial program 100.0%
Taylor expanded in z around 0 97.1%
+-commutative97.1%
Simplified97.1%
Final simplification97.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.1e+19) (not (<= y 0.195))) (+ x z) (+ x (+ z (* y (+ 1.0 (* y (+ (* z -0.5) (* y -0.16666666666666666)))))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.1e+19) || !(y <= 0.195)) {
tmp = x + z;
} else {
tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666))))));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-1.1d+19)) .or. (.not. (y <= 0.195d0))) then
tmp = x + z
else
tmp = x + (z + (y * (1.0d0 + (y * ((z * (-0.5d0)) + (y * (-0.16666666666666666d0)))))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.1e+19) || !(y <= 0.195)) {
tmp = x + z;
} else {
tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666))))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.1e+19) or not (y <= 0.195): tmp = x + z else: tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666)))))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.1e+19) || !(y <= 0.195)) tmp = Float64(x + z); else tmp = Float64(x + Float64(z + Float64(y * Float64(1.0 + Float64(y * Float64(Float64(z * -0.5) + Float64(y * -0.16666666666666666))))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.1e+19) || ~((y <= 0.195))) tmp = x + z; else tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666)))))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.1e+19], N[Not[LessEqual[y, 0.195]], $MachinePrecision]], N[(x + z), $MachinePrecision], N[(x + N[(z + N[(y * N[(1.0 + N[(y * N[(N[(z * -0.5), $MachinePrecision] + N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+19} \lor \neg \left(y \leq 0.195\right):\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;x + \left(z + y \cdot \left(1 + y \cdot \left(z \cdot -0.5 + y \cdot -0.16666666666666666\right)\right)\right)\\
\end{array}
\end{array}
if y < -1.1e19 or 0.19500000000000001 < y Initial program 99.9%
Taylor expanded in y around 0 48.7%
+-commutative48.7%
Simplified48.7%
if -1.1e19 < y < 0.19500000000000001Initial program 100.0%
Taylor expanded in y around 0 97.9%
Final simplification74.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -9000000.0) (not (<= y 0.195))) (+ x z) (+ x (+ z (* y (+ 1.0 (* y (* y -0.16666666666666666))))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -9000000.0) || !(y <= 0.195)) {
tmp = x + z;
} else {
tmp = x + (z + (y * (1.0 + (y * (y * -0.16666666666666666)))));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-9000000.0d0)) .or. (.not. (y <= 0.195d0))) then
tmp = x + z
else
tmp = x + (z + (y * (1.0d0 + (y * (y * (-0.16666666666666666d0))))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -9000000.0) || !(y <= 0.195)) {
tmp = x + z;
} else {
tmp = x + (z + (y * (1.0 + (y * (y * -0.16666666666666666)))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -9000000.0) or not (y <= 0.195): tmp = x + z else: tmp = x + (z + (y * (1.0 + (y * (y * -0.16666666666666666))))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -9000000.0) || !(y <= 0.195)) tmp = Float64(x + z); else tmp = Float64(x + Float64(z + Float64(y * Float64(1.0 + Float64(y * Float64(y * -0.16666666666666666)))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -9000000.0) || ~((y <= 0.195))) tmp = x + z; else tmp = x + (z + (y * (1.0 + (y * (y * -0.16666666666666666))))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -9000000.0], N[Not[LessEqual[y, 0.195]], $MachinePrecision]], N[(x + z), $MachinePrecision], N[(x + N[(z + N[(y * N[(1.0 + N[(y * N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9000000 \lor \neg \left(y \leq 0.195\right):\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;x + \left(z + y \cdot \left(1 + y \cdot \left(y \cdot -0.16666666666666666\right)\right)\right)\\
\end{array}
\end{array}
if y < -9e6 or 0.19500000000000001 < y Initial program 99.9%
Taylor expanded in y around 0 49.5%
+-commutative49.5%
Simplified49.5%
if -9e6 < y < 0.19500000000000001Initial program 100.0%
Taylor expanded in y around 0 99.3%
Taylor expanded in z around 0 99.3%
Final simplification74.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.6e+63) (not (<= y 0.195))) (+ x z) (+ z (+ x y))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.6e+63) || !(y <= 0.195)) {
tmp = x + z;
} else {
tmp = z + (x + y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-1.6d+63)) .or. (.not. (y <= 0.195d0))) then
tmp = x + z
else
tmp = z + (x + y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.6e+63) || !(y <= 0.195)) {
tmp = x + z;
} else {
tmp = z + (x + y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.6e+63) or not (y <= 0.195): tmp = x + z else: tmp = z + (x + y) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.6e+63) || !(y <= 0.195)) tmp = Float64(x + z); else tmp = Float64(z + Float64(x + y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.6e+63) || ~((y <= 0.195))) tmp = x + z; else tmp = z + (x + y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.6e+63], N[Not[LessEqual[y, 0.195]], $MachinePrecision]], N[(x + z), $MachinePrecision], N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+63} \lor \neg \left(y \leq 0.195\right):\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;z + \left(x + y\right)\\
\end{array}
\end{array}
if y < -1.60000000000000006e63 or 0.19500000000000001 < y Initial program 99.9%
Taylor expanded in y around 0 47.3%
+-commutative47.3%
Simplified47.3%
if -1.60000000000000006e63 < y < 0.19500000000000001Initial program 100.0%
Taylor expanded in y around 0 95.8%
+-commutative95.8%
+-commutative95.8%
associate-+l+95.8%
Simplified95.8%
Final simplification74.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -8.5e-192) (not (<= z 5.2e-89))) (+ x z) (+ x y)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -8.5e-192) || !(z <= 5.2e-89)) {
tmp = x + z;
} else {
tmp = x + y;
}
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 <= (-8.5d-192)) .or. (.not. (z <= 5.2d-89))) then
tmp = x + z
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -8.5e-192) || !(z <= 5.2e-89)) {
tmp = x + z;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -8.5e-192) or not (z <= 5.2e-89): tmp = x + z else: tmp = x + y return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -8.5e-192) || !(z <= 5.2e-89)) tmp = Float64(x + z); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -8.5e-192) || ~((z <= 5.2e-89))) tmp = x + z; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -8.5e-192], N[Not[LessEqual[z, 5.2e-89]], $MachinePrecision]], N[(x + z), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{-192} \lor \neg \left(z \leq 5.2 \cdot 10^{-89}\right):\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -8.49999999999999985e-192 or 5.1999999999999997e-89 < z Initial program 99.9%
Taylor expanded in y around 0 74.3%
+-commutative74.3%
Simplified74.3%
if -8.49999999999999985e-192 < z < 5.1999999999999997e-89Initial program 100.0%
Taylor expanded in z around 0 99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in y around 0 66.7%
+-commutative66.7%
Simplified66.7%
Final simplification72.1%
(FPCore (x y z) :precision binary64 (if (<= x -1.2e+14) x (if (<= x 7.5e-18) z x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.2e+14) {
tmp = x;
} else if (x <= 7.5e-18) {
tmp = z;
} 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.2d+14)) then
tmp = x
else if (x <= 7.5d-18) then
tmp = z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.2e+14) {
tmp = x;
} else if (x <= 7.5e-18) {
tmp = z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.2e+14: tmp = x elif x <= 7.5e-18: tmp = z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.2e+14) tmp = x; elseif (x <= 7.5e-18) tmp = z; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.2e+14) tmp = x; elseif (x <= 7.5e-18) tmp = z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.2e+14], x, If[LessEqual[x, 7.5e-18], z, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{+14}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-18}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.2e14 or 7.50000000000000015e-18 < x Initial program 100.0%
+-commutative100.0%
*-commutative100.0%
add-cube-cbrt99.8%
associate-*l*99.8%
fma-define99.8%
pow299.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 84.2%
if -1.2e14 < x < 7.50000000000000015e-18Initial program 99.9%
Taylor expanded in x around inf 82.5%
associate-+r+82.5%
associate-/l*82.4%
Simplified82.4%
Taylor expanded in y around 0 31.7%
Taylor expanded in x around 0 37.2%
(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 100.0%
+-commutative100.0%
*-commutative100.0%
add-cube-cbrt99.7%
associate-*l*99.7%
fma-define99.7%
pow299.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 49.4%
herbie shell --seed 2024100
(FPCore (x y z)
:name "Graphics.Rasterific.Svg.PathConverter:segmentToBezier from rasterific-svg-0.2.3.1, C"
:precision binary64
(+ (+ x (sin y)) (* z (cos y))))