
(FPCore (x y z) :precision binary64 (- (+ x (cos y)) (* z (sin y))))
double code(double x, double y, double z) {
return (x + cos(y)) - (z * 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 = (x + cos(y)) - (z * sin(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.cos(y)) - (z * Math.sin(y));
}
def code(x, y, z): return (x + math.cos(y)) - (z * math.sin(y))
function code(x, y, z) return Float64(Float64(x + cos(y)) - Float64(z * sin(y))) end
function tmp = code(x, y, z) tmp = (x + cos(y)) - (z * sin(y)); end
code[x_, y_, z_] := N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \cos y\right) - z \cdot \sin y
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (- (+ x (cos y)) (* z (sin y))))
double code(double x, double y, double z) {
return (x + cos(y)) - (z * 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 = (x + cos(y)) - (z * sin(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.cos(y)) - (z * Math.sin(y));
}
def code(x, y, z): return (x + math.cos(y)) - (z * math.sin(y))
function code(x, y, z) return Float64(Float64(x + cos(y)) - Float64(z * sin(y))) end
function tmp = code(x, y, z) tmp = (x + cos(y)) - (z * sin(y)); end
code[x_, y_, z_] := N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \cos y\right) - z \cdot \sin y
\end{array}
(FPCore (x y z) :precision binary64 (- (+ x (cos y)) (* z (sin y))))
double code(double x, double y, double z) {
return (x + cos(y)) - (z * 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 = (x + cos(y)) - (z * sin(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.cos(y)) - (z * Math.sin(y));
}
def code(x, y, z): return (x + math.cos(y)) - (z * math.sin(y))
function code(x, y, z) return Float64(Float64(x + cos(y)) - Float64(z * sin(y))) end
function tmp = code(x, y, z) tmp = (x + cos(y)) - (z * sin(y)); end
code[x_, y_, z_] := N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \cos y\right) - z \cdot \sin y
\end{array}
Initial program 99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (sin y))) (t_1 (- x t_0)))
(if (<= x -1.0)
t_1
(if (<= x 1.3e-51)
(- (cos y) t_0)
(if (<= x 6400000.0) (+ x (cos y)) t_1)))))
double code(double x, double y, double z) {
double t_0 = z * sin(y);
double t_1 = x - t_0;
double tmp;
if (x <= -1.0) {
tmp = t_1;
} else if (x <= 1.3e-51) {
tmp = cos(y) - t_0;
} else if (x <= 6400000.0) {
tmp = x + cos(y);
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = z * sin(y)
t_1 = x - t_0
if (x <= (-1.0d0)) then
tmp = t_1
else if (x <= 1.3d-51) then
tmp = cos(y) - t_0
else if (x <= 6400000.0d0) then
tmp = x + cos(y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * Math.sin(y);
double t_1 = x - t_0;
double tmp;
if (x <= -1.0) {
tmp = t_1;
} else if (x <= 1.3e-51) {
tmp = Math.cos(y) - t_0;
} else if (x <= 6400000.0) {
tmp = x + Math.cos(y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.sin(y) t_1 = x - t_0 tmp = 0 if x <= -1.0: tmp = t_1 elif x <= 1.3e-51: tmp = math.cos(y) - t_0 elif x <= 6400000.0: tmp = x + math.cos(y) else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(z * sin(y)) t_1 = Float64(x - t_0) tmp = 0.0 if (x <= -1.0) tmp = t_1; elseif (x <= 1.3e-51) tmp = Float64(cos(y) - t_0); elseif (x <= 6400000.0) tmp = Float64(x + cos(y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * sin(y); t_1 = x - t_0; tmp = 0.0; if (x <= -1.0) tmp = t_1; elseif (x <= 1.3e-51) tmp = cos(y) - t_0; elseif (x <= 6400000.0) tmp = x + cos(y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x - t$95$0), $MachinePrecision]}, If[LessEqual[x, -1.0], t$95$1, If[LessEqual[x, 1.3e-51], N[(N[Cos[y], $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[x, 6400000.0], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \sin y\\
t_1 := x - t\_0\\
\mathbf{if}\;x \leq -1:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-51}:\\
\;\;\;\;\cos y - t\_0\\
\mathbf{elif}\;x \leq 6400000:\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1 or 6.4e6 < x Initial program 100.0%
Taylor expanded in x around inf 99.2%
if -1 < x < 1.3e-51Initial program 99.9%
Taylor expanded in x around 0 99.2%
if 1.3e-51 < x < 6.4e6Initial program 100.0%
Taylor expanded in z around 0 100.0%
+-commutative100.0%
Simplified100.0%
Final simplification99.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -4.4e+21) (not (<= z 4.2e+77))) (- x (* z (sin y))) (+ x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -4.4e+21) || !(z <= 4.2e+77)) {
tmp = x - (z * sin(y));
} else {
tmp = x + cos(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 <= (-4.4d+21)) .or. (.not. (z <= 4.2d+77))) then
tmp = x - (z * sin(y))
else
tmp = x + cos(y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -4.4e+21) || !(z <= 4.2e+77)) {
tmp = x - (z * Math.sin(y));
} else {
tmp = x + Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -4.4e+21) or not (z <= 4.2e+77): tmp = x - (z * math.sin(y)) else: tmp = x + math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -4.4e+21) || !(z <= 4.2e+77)) tmp = Float64(x - Float64(z * sin(y))); else tmp = Float64(x + cos(y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -4.4e+21) || ~((z <= 4.2e+77))) tmp = x - (z * sin(y)); else tmp = x + cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -4.4e+21], N[Not[LessEqual[z, 4.2e+77]], $MachinePrecision]], N[(x - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+21} \lor \neg \left(z \leq 4.2 \cdot 10^{+77}\right):\\
\;\;\;\;x - z \cdot \sin y\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -4.4e21 or 4.1999999999999997e77 < z Initial program 99.9%
Taylor expanded in x around inf 82.8%
if -4.4e21 < z < 4.1999999999999997e77Initial program 100.0%
Taylor expanded in z around 0 99.3%
+-commutative99.3%
Simplified99.3%
Final simplification92.0%
(FPCore (x y z) :precision binary64 (if (or (<= y -0.013) (not (<= y 2.9e-22))) (+ x (cos y)) (+ 1.0 (+ x (* y (- (* y (- (* 0.16666666666666666 (* y z)) 0.5)) z))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -0.013) || !(y <= 2.9e-22)) {
tmp = x + cos(y);
} else {
tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z)));
}
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 <= (-0.013d0)) .or. (.not. (y <= 2.9d-22))) then
tmp = x + cos(y)
else
tmp = 1.0d0 + (x + (y * ((y * ((0.16666666666666666d0 * (y * z)) - 0.5d0)) - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -0.013) || !(y <= 2.9e-22)) {
tmp = x + Math.cos(y);
} else {
tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -0.013) or not (y <= 2.9e-22): tmp = x + math.cos(y) else: tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -0.013) || !(y <= 2.9e-22)) tmp = Float64(x + cos(y)); else tmp = Float64(1.0 + Float64(x + Float64(y * Float64(Float64(y * Float64(Float64(0.16666666666666666 * Float64(y * z)) - 0.5)) - z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -0.013) || ~((y <= 2.9e-22))) tmp = x + cos(y); else tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -0.013], N[Not[LessEqual[y, 2.9e-22]], $MachinePrecision]], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x + N[(y * N[(N[(y * N[(N[(0.16666666666666666 * N[(y * z), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.013 \lor \neg \left(y \leq 2.9 \cdot 10^{-22}\right):\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x + y \cdot \left(y \cdot \left(0.16666666666666666 \cdot \left(y \cdot z\right) - 0.5\right) - z\right)\right)\\
\end{array}
\end{array}
if y < -0.0129999999999999994 or 2.9000000000000002e-22 < y Initial program 99.9%
Taylor expanded in z around 0 67.5%
+-commutative67.5%
Simplified67.5%
if -0.0129999999999999994 < y < 2.9000000000000002e-22Initial program 100.0%
Taylor expanded in y around 0 100.0%
Final simplification84.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -5.2e+20) (not (<= y 1.02e+45))) (+ x 1.0) (+ 1.0 (+ x (* y (- (* y (- (* 0.16666666666666666 (* y z)) 0.5)) z))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -5.2e+20) || !(y <= 1.02e+45)) {
tmp = x + 1.0;
} else {
tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z)));
}
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 <= (-5.2d+20)) .or. (.not. (y <= 1.02d+45))) then
tmp = x + 1.0d0
else
tmp = 1.0d0 + (x + (y * ((y * ((0.16666666666666666d0 * (y * z)) - 0.5d0)) - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -5.2e+20) || !(y <= 1.02e+45)) {
tmp = x + 1.0;
} else {
tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -5.2e+20) or not (y <= 1.02e+45): tmp = x + 1.0 else: tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -5.2e+20) || !(y <= 1.02e+45)) tmp = Float64(x + 1.0); else tmp = Float64(1.0 + Float64(x + Float64(y * Float64(Float64(y * Float64(Float64(0.16666666666666666 * Float64(y * z)) - 0.5)) - z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -5.2e+20) || ~((y <= 1.02e+45))) tmp = x + 1.0; else tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -5.2e+20], N[Not[LessEqual[y, 1.02e+45]], $MachinePrecision]], N[(x + 1.0), $MachinePrecision], N[(1.0 + N[(x + N[(y * N[(N[(y * N[(N[(0.16666666666666666 * N[(y * z), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{+20} \lor \neg \left(y \leq 1.02 \cdot 10^{+45}\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x + y \cdot \left(y \cdot \left(0.16666666666666666 \cdot \left(y \cdot z\right) - 0.5\right) - z\right)\right)\\
\end{array}
\end{array}
if y < -5.2e20 or 1.02e45 < y Initial program 99.9%
add-cube-cbrt98.0%
pow398.0%
associate--l+98.0%
Applied egg-rr98.0%
Taylor expanded in y around 0 44.0%
+-commutative44.0%
Simplified44.0%
if -5.2e20 < y < 1.02e45Initial program 100.0%
Taylor expanded in y around 0 97.8%
Final simplification74.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -2.3e+28) (not (<= y 1.22e+33))) (+ x 1.0) (+ 1.0 (+ x (* y (- (* y -0.5) z))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.3e+28) || !(y <= 1.22e+33)) {
tmp = x + 1.0;
} else {
tmp = 1.0 + (x + (y * ((y * -0.5) - z)));
}
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 <= (-2.3d+28)) .or. (.not. (y <= 1.22d+33))) then
tmp = x + 1.0d0
else
tmp = 1.0d0 + (x + (y * ((y * (-0.5d0)) - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -2.3e+28) || !(y <= 1.22e+33)) {
tmp = x + 1.0;
} else {
tmp = 1.0 + (x + (y * ((y * -0.5) - z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.3e+28) or not (y <= 1.22e+33): tmp = x + 1.0 else: tmp = 1.0 + (x + (y * ((y * -0.5) - z))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.3e+28) || !(y <= 1.22e+33)) tmp = Float64(x + 1.0); else tmp = Float64(1.0 + Float64(x + Float64(y * Float64(Float64(y * -0.5) - z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -2.3e+28) || ~((y <= 1.22e+33))) tmp = x + 1.0; else tmp = 1.0 + (x + (y * ((y * -0.5) - z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.3e+28], N[Not[LessEqual[y, 1.22e+33]], $MachinePrecision]], N[(x + 1.0), $MachinePrecision], N[(1.0 + N[(x + N[(y * N[(N[(y * -0.5), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+28} \lor \neg \left(y \leq 1.22 \cdot 10^{+33}\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x + y \cdot \left(y \cdot -0.5 - z\right)\right)\\
\end{array}
\end{array}
if y < -2.29999999999999984e28 or 1.22000000000000005e33 < y Initial program 99.9%
add-cube-cbrt98.0%
pow398.0%
associate--l+98.0%
Applied egg-rr98.0%
Taylor expanded in y around 0 44.0%
+-commutative44.0%
Simplified44.0%
if -2.29999999999999984e28 < y < 1.22000000000000005e33Initial program 100.0%
Taylor expanded in y around 0 97.8%
Final simplification74.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -3.25e+31) (not (<= y 2.9e-22))) (+ x 1.0) (+ 1.0 (- x (* y z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3.25e+31) || !(y <= 2.9e-22)) {
tmp = x + 1.0;
} else {
tmp = 1.0 + (x - (y * z));
}
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 <= (-3.25d+31)) .or. (.not. (y <= 2.9d-22))) then
tmp = x + 1.0d0
else
tmp = 1.0d0 + (x - (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -3.25e+31) || !(y <= 2.9e-22)) {
tmp = x + 1.0;
} else {
tmp = 1.0 + (x - (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -3.25e+31) or not (y <= 2.9e-22): tmp = x + 1.0 else: tmp = 1.0 + (x - (y * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -3.25e+31) || !(y <= 2.9e-22)) tmp = Float64(x + 1.0); else tmp = Float64(1.0 + Float64(x - Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -3.25e+31) || ~((y <= 2.9e-22))) tmp = x + 1.0; else tmp = 1.0 + (x - (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -3.25e+31], N[Not[LessEqual[y, 2.9e-22]], $MachinePrecision]], N[(x + 1.0), $MachinePrecision], N[(1.0 + N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.25 \cdot 10^{+31} \lor \neg \left(y \leq 2.9 \cdot 10^{-22}\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x - y \cdot z\right)\\
\end{array}
\end{array}
if y < -3.2500000000000002e31 or 2.9000000000000002e-22 < y Initial program 99.9%
add-cube-cbrt98.1%
pow398.1%
associate--l+98.1%
Applied egg-rr98.1%
Taylor expanded in y around 0 45.1%
+-commutative45.1%
Simplified45.1%
if -3.2500000000000002e31 < y < 2.9000000000000002e-22Initial program 100.0%
Taylor expanded in y around 0 98.1%
mul-1-neg98.1%
unsub-neg98.1%
Simplified98.1%
Final simplification74.1%
(FPCore (x y z) :precision binary64 (if (or (<= x -2.5e-86) (not (<= x 2.3e-44))) (+ x 1.0) (- 1.0 (* y z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -2.5e-86) || !(x <= 2.3e-44)) {
tmp = x + 1.0;
} else {
tmp = 1.0 - (y * z);
}
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.5d-86)) .or. (.not. (x <= 2.3d-44))) then
tmp = x + 1.0d0
else
tmp = 1.0d0 - (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -2.5e-86) || !(x <= 2.3e-44)) {
tmp = x + 1.0;
} else {
tmp = 1.0 - (y * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -2.5e-86) or not (x <= 2.3e-44): tmp = x + 1.0 else: tmp = 1.0 - (y * z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -2.5e-86) || !(x <= 2.3e-44)) tmp = Float64(x + 1.0); else tmp = Float64(1.0 - Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -2.5e-86) || ~((x <= 2.3e-44))) tmp = x + 1.0; else tmp = 1.0 - (y * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -2.5e-86], N[Not[LessEqual[x, 2.3e-44]], $MachinePrecision]], N[(x + 1.0), $MachinePrecision], N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{-86} \lor \neg \left(x \leq 2.3 \cdot 10^{-44}\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;1 - y \cdot z\\
\end{array}
\end{array}
if x < -2.4999999999999999e-86 or 2.29999999999999998e-44 < x Initial program 100.0%
add-cube-cbrt98.2%
pow398.2%
associate--l+98.2%
Applied egg-rr98.2%
Taylor expanded in y around 0 80.7%
+-commutative80.7%
Simplified80.7%
if -2.4999999999999999e-86 < x < 2.29999999999999998e-44Initial program 99.9%
Taylor expanded in y around 0 58.3%
mul-1-neg58.3%
unsub-neg58.3%
Simplified58.3%
Taylor expanded in x around 0 58.3%
associate-*r*58.3%
neg-mul-158.3%
Simplified58.3%
Final simplification72.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -4e+235) (not (<= z 9.6e+224))) (- x (* y z)) (+ x 1.0)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -4e+235) || !(z <= 9.6e+224)) {
tmp = x - (y * z);
} else {
tmp = x + 1.0;
}
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 <= (-4d+235)) .or. (.not. (z <= 9.6d+224))) then
tmp = x - (y * z)
else
tmp = x + 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -4e+235) || !(z <= 9.6e+224)) {
tmp = x - (y * z);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -4e+235) or not (z <= 9.6e+224): tmp = x - (y * z) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -4e+235) || !(z <= 9.6e+224)) tmp = Float64(x - Float64(y * z)); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -4e+235) || ~((z <= 9.6e+224))) tmp = x - (y * z); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -4e+235], N[Not[LessEqual[z, 9.6e+224]], $MachinePrecision]], N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+235} \lor \neg \left(z \leq 9.6 \cdot 10^{+224}\right):\\
\;\;\;\;x - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if z < -4.0000000000000002e235 or 9.60000000000000004e224 < z Initial program 100.0%
Taylor expanded in x around inf 97.1%
Taylor expanded in y around 0 58.6%
mul-1-neg58.6%
sub-neg58.6%
*-commutative58.6%
Simplified58.6%
if -4.0000000000000002e235 < z < 9.60000000000000004e224Initial program 99.9%
add-cube-cbrt98.5%
pow398.4%
associate--l+98.4%
Applied egg-rr98.4%
Taylor expanded in y around 0 72.1%
+-commutative72.1%
Simplified72.1%
Final simplification70.4%
(FPCore (x y z) :precision binary64 (if (<= z 1.36e+247) (+ x 1.0) (* y (- z))))
double code(double x, double y, double z) {
double tmp;
if (z <= 1.36e+247) {
tmp = x + 1.0;
} else {
tmp = y * -z;
}
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.36d+247) then
tmp = x + 1.0d0
else
tmp = y * -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= 1.36e+247) {
tmp = x + 1.0;
} else {
tmp = y * -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 1.36e+247: tmp = x + 1.0 else: tmp = y * -z return tmp
function code(x, y, z) tmp = 0.0 if (z <= 1.36e+247) tmp = Float64(x + 1.0); else tmp = Float64(y * Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 1.36e+247) tmp = x + 1.0; else tmp = y * -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 1.36e+247], N[(x + 1.0), $MachinePrecision], N[(y * (-z)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.36 \cdot 10^{+247}:\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-z\right)\\
\end{array}
\end{array}
if z < 1.35999999999999995e247Initial program 99.9%
add-cube-cbrt98.4%
pow398.4%
associate--l+98.4%
Applied egg-rr98.4%
Taylor expanded in y around 0 69.1%
+-commutative69.1%
Simplified69.1%
if 1.35999999999999995e247 < z Initial program 100.0%
Taylor expanded in x around inf 100.0%
Taylor expanded in y around 0 56.4%
mul-1-neg56.4%
sub-neg56.4%
*-commutative56.4%
Simplified56.4%
Taylor expanded in x around 0 56.4%
mul-1-neg56.4%
distribute-rgt-neg-in56.4%
Simplified56.4%
(FPCore (x y z) :precision binary64 (+ x 1.0))
double code(double x, double y, double z) {
return x + 1.0;
}
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
end function
public static double code(double x, double y, double z) {
return x + 1.0;
}
def code(x, y, z): return x + 1.0
function code(x, y, z) return Float64(x + 1.0) end
function tmp = code(x, y, z) tmp = x + 1.0; end
code[x_, y_, z_] := N[(x + 1.0), $MachinePrecision]
\begin{array}{l}
\\
x + 1
\end{array}
Initial program 99.9%
add-cube-cbrt98.4%
pow398.4%
associate--l+98.4%
Applied egg-rr98.4%
Taylor expanded in y around 0 66.3%
+-commutative66.3%
Simplified66.3%
(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 99.9%
add-cube-cbrt98.4%
pow398.4%
associate--l+98.4%
Applied egg-rr98.4%
Taylor expanded in x around inf 43.1%
herbie shell --seed 2024101
(FPCore (x y z)
:name "Graphics.Rasterific.Svg.PathConverter:segmentToBezier from rasterific-svg-0.2.3.1, B"
:precision binary64
(- (+ x (cos y)) (* z (sin y))))