
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
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) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
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) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
(FPCore (x y z) :precision binary64 (fma (- y x) (fma z -6.0 4.0) x))
double code(double x, double y, double z) {
return fma((y - x), fma(z, -6.0, 4.0), x);
}
function code(x, y, z) return fma(Float64(y - x), fma(z, -6.0, 4.0), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(z * -6.0 + 4.0), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, \mathsf{fma}\left(z, -6, 4\right), x\right)
\end{array}
Initial program 99.2%
+-commutative99.2%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.7%
*-commutative99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
fma-define99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* x z))) (t_1 (* -6.0 (* y z))))
(if (<= z -2.9e+151)
t_0
(if (<= z -1350000.0)
t_1
(if (<= z -4e-153)
(* x -3.0)
(if (<= z 2.45e-256)
(* y 4.0)
(if (<= z 4.4e-128)
(* x -3.0)
(if (<= z 6600000000000.0)
(* y 4.0)
(if (<= z 3.4e+61) t_0 t_1)))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double t_1 = -6.0 * (y * z);
double tmp;
if (z <= -2.9e+151) {
tmp = t_0;
} else if (z <= -1350000.0) {
tmp = t_1;
} else if (z <= -4e-153) {
tmp = x * -3.0;
} else if (z <= 2.45e-256) {
tmp = y * 4.0;
} else if (z <= 4.4e-128) {
tmp = x * -3.0;
} else if (z <= 6600000000000.0) {
tmp = y * 4.0;
} else if (z <= 3.4e+61) {
tmp = t_0;
} 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 = 6.0d0 * (x * z)
t_1 = (-6.0d0) * (y * z)
if (z <= (-2.9d+151)) then
tmp = t_0
else if (z <= (-1350000.0d0)) then
tmp = t_1
else if (z <= (-4d-153)) then
tmp = x * (-3.0d0)
else if (z <= 2.45d-256) then
tmp = y * 4.0d0
else if (z <= 4.4d-128) then
tmp = x * (-3.0d0)
else if (z <= 6600000000000.0d0) then
tmp = y * 4.0d0
else if (z <= 3.4d+61) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double t_1 = -6.0 * (y * z);
double tmp;
if (z <= -2.9e+151) {
tmp = t_0;
} else if (z <= -1350000.0) {
tmp = t_1;
} else if (z <= -4e-153) {
tmp = x * -3.0;
} else if (z <= 2.45e-256) {
tmp = y * 4.0;
} else if (z <= 4.4e-128) {
tmp = x * -3.0;
} else if (z <= 6600000000000.0) {
tmp = y * 4.0;
} else if (z <= 3.4e+61) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (x * z) t_1 = -6.0 * (y * z) tmp = 0 if z <= -2.9e+151: tmp = t_0 elif z <= -1350000.0: tmp = t_1 elif z <= -4e-153: tmp = x * -3.0 elif z <= 2.45e-256: tmp = y * 4.0 elif z <= 4.4e-128: tmp = x * -3.0 elif z <= 6600000000000.0: tmp = y * 4.0 elif z <= 3.4e+61: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(x * z)) t_1 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -2.9e+151) tmp = t_0; elseif (z <= -1350000.0) tmp = t_1; elseif (z <= -4e-153) tmp = Float64(x * -3.0); elseif (z <= 2.45e-256) tmp = Float64(y * 4.0); elseif (z <= 4.4e-128) tmp = Float64(x * -3.0); elseif (z <= 6600000000000.0) tmp = Float64(y * 4.0); elseif (z <= 3.4e+61) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (x * z); t_1 = -6.0 * (y * z); tmp = 0.0; if (z <= -2.9e+151) tmp = t_0; elseif (z <= -1350000.0) tmp = t_1; elseif (z <= -4e-153) tmp = x * -3.0; elseif (z <= 2.45e-256) tmp = y * 4.0; elseif (z <= 4.4e-128) tmp = x * -3.0; elseif (z <= 6600000000000.0) tmp = y * 4.0; elseif (z <= 3.4e+61) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e+151], t$95$0, If[LessEqual[z, -1350000.0], t$95$1, If[LessEqual[z, -4e-153], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.45e-256], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 4.4e-128], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6600000000000.0], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.4e+61], t$95$0, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(x \cdot z\right)\\
t_1 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{+151}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1350000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-153}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{-256}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-128}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 6600000000000:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+61}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.90000000000000018e151 or 6.6e12 < z < 3.40000000000000026e61Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 67.7%
sub-neg67.7%
distribute-rgt-in67.7%
metadata-eval67.7%
distribute-lft-neg-in67.7%
associate-+r+67.7%
metadata-eval67.7%
distribute-rgt-neg-in67.7%
metadata-eval67.7%
Simplified67.7%
Taylor expanded in z around inf 67.7%
associate-*r/67.7%
metadata-eval67.7%
Simplified67.7%
Taylor expanded in z around inf 67.6%
if -2.90000000000000018e151 < z < -1.35e6 or 3.40000000000000026e61 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 90.6%
Taylor expanded in z around inf 90.4%
Taylor expanded in y around inf 61.2%
if -1.35e6 < z < -4.00000000000000016e-153 or 2.44999999999999998e-256 < z < 4.40000000000000019e-128Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 65.1%
sub-neg65.1%
distribute-rgt-in65.1%
metadata-eval65.1%
distribute-lft-neg-in65.1%
associate-+r+65.1%
metadata-eval65.1%
distribute-rgt-neg-in65.1%
metadata-eval65.1%
Simplified65.1%
Taylor expanded in z around 0 58.5%
*-commutative58.5%
Simplified58.5%
if -4.00000000000000016e-153 < z < 2.44999999999999998e-256 or 4.40000000000000019e-128 < z < 6.6e12Initial program 98.1%
metadata-eval98.1%
Simplified98.1%
Taylor expanded in y around inf 58.4%
Taylor expanded in x around 0 59.1%
Taylor expanded in z around 0 58.5%
*-commutative58.5%
Simplified58.5%
Final simplification60.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -5.8e+154)
(* x (* z 6.0))
(if (<= z -1350000.0)
t_0
(if (<= z -1.5e-153)
(* x -3.0)
(if (<= z 4.3e-256)
(* y 4.0)
(if (<= z 1.2e-113)
(* x -3.0)
(if (<= z 6600000000000.0)
(* y 4.0)
(if (<= z 8e+63) (* 6.0 (* x z)) t_0)))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -5.8e+154) {
tmp = x * (z * 6.0);
} else if (z <= -1350000.0) {
tmp = t_0;
} else if (z <= -1.5e-153) {
tmp = x * -3.0;
} else if (z <= 4.3e-256) {
tmp = y * 4.0;
} else if (z <= 1.2e-113) {
tmp = x * -3.0;
} else if (z <= 6600000000000.0) {
tmp = y * 4.0;
} else if (z <= 8e+63) {
tmp = 6.0 * (x * z);
} else {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-5.8d+154)) then
tmp = x * (z * 6.0d0)
else if (z <= (-1350000.0d0)) then
tmp = t_0
else if (z <= (-1.5d-153)) then
tmp = x * (-3.0d0)
else if (z <= 4.3d-256) then
tmp = y * 4.0d0
else if (z <= 1.2d-113) then
tmp = x * (-3.0d0)
else if (z <= 6600000000000.0d0) then
tmp = y * 4.0d0
else if (z <= 8d+63) then
tmp = 6.0d0 * (x * z)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -5.8e+154) {
tmp = x * (z * 6.0);
} else if (z <= -1350000.0) {
tmp = t_0;
} else if (z <= -1.5e-153) {
tmp = x * -3.0;
} else if (z <= 4.3e-256) {
tmp = y * 4.0;
} else if (z <= 1.2e-113) {
tmp = x * -3.0;
} else if (z <= 6600000000000.0) {
tmp = y * 4.0;
} else if (z <= 8e+63) {
tmp = 6.0 * (x * z);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -5.8e+154: tmp = x * (z * 6.0) elif z <= -1350000.0: tmp = t_0 elif z <= -1.5e-153: tmp = x * -3.0 elif z <= 4.3e-256: tmp = y * 4.0 elif z <= 1.2e-113: tmp = x * -3.0 elif z <= 6600000000000.0: tmp = y * 4.0 elif z <= 8e+63: tmp = 6.0 * (x * z) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -5.8e+154) tmp = Float64(x * Float64(z * 6.0)); elseif (z <= -1350000.0) tmp = t_0; elseif (z <= -1.5e-153) tmp = Float64(x * -3.0); elseif (z <= 4.3e-256) tmp = Float64(y * 4.0); elseif (z <= 1.2e-113) tmp = Float64(x * -3.0); elseif (z <= 6600000000000.0) tmp = Float64(y * 4.0); elseif (z <= 8e+63) tmp = Float64(6.0 * Float64(x * z)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -5.8e+154) tmp = x * (z * 6.0); elseif (z <= -1350000.0) tmp = t_0; elseif (z <= -1.5e-153) tmp = x * -3.0; elseif (z <= 4.3e-256) tmp = y * 4.0; elseif (z <= 1.2e-113) tmp = x * -3.0; elseif (z <= 6600000000000.0) tmp = y * 4.0; elseif (z <= 8e+63) tmp = 6.0 * (x * z); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.8e+154], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1350000.0], t$95$0, If[LessEqual[z, -1.5e-153], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4.3e-256], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.2e-113], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6600000000000.0], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 8e+63], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -5.8 \cdot 10^{+154}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;z \leq -1350000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-153}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{-256}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-113}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 6600000000000:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+63}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -5.79999999999999959e154Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 65.5%
sub-neg65.5%
distribute-rgt-in65.5%
metadata-eval65.5%
distribute-lft-neg-in65.5%
associate-+r+65.5%
metadata-eval65.5%
distribute-rgt-neg-in65.5%
metadata-eval65.5%
Simplified65.5%
Taylor expanded in z around inf 65.5%
if -5.79999999999999959e154 < z < -1.35e6 or 8.00000000000000046e63 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 90.6%
Taylor expanded in z around inf 90.4%
Taylor expanded in y around inf 61.2%
if -1.35e6 < z < -1.5e-153 or 4.3000000000000001e-256 < z < 1.20000000000000006e-113Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 65.1%
sub-neg65.1%
distribute-rgt-in65.1%
metadata-eval65.1%
distribute-lft-neg-in65.1%
associate-+r+65.1%
metadata-eval65.1%
distribute-rgt-neg-in65.1%
metadata-eval65.1%
Simplified65.1%
Taylor expanded in z around 0 58.5%
*-commutative58.5%
Simplified58.5%
if -1.5e-153 < z < 4.3000000000000001e-256 or 1.20000000000000006e-113 < z < 6.6e12Initial program 98.1%
metadata-eval98.1%
Simplified98.1%
Taylor expanded in y around inf 58.4%
Taylor expanded in x around 0 59.1%
Taylor expanded in z around 0 58.5%
*-commutative58.5%
Simplified58.5%
if 6.6e12 < z < 8.00000000000000046e63Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 72.3%
sub-neg72.3%
distribute-rgt-in72.3%
metadata-eval72.3%
distribute-lft-neg-in72.3%
associate-+r+72.3%
metadata-eval72.3%
distribute-rgt-neg-in72.3%
metadata-eval72.3%
Simplified72.3%
Taylor expanded in z around inf 72.3%
associate-*r/72.3%
metadata-eval72.3%
Simplified72.3%
Taylor expanded in z around inf 72.0%
Final simplification60.9%
(FPCore (x y z)
:precision binary64
(if (<= z -7.6e+151)
(* x (* z 6.0))
(if (<= z -1350000.0)
(* -6.0 (* y z))
(if (<= z -3e-155)
(* x -3.0)
(if (<= z 7.5e-256)
(* y 4.0)
(if (<= z 3.5e-123)
(* x -3.0)
(if (<= z 6600000000000.0)
(* y 4.0)
(if (<= z 3.55e+61) (* 6.0 (* x z)) (* y (* z -6.0))))))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -7.6e+151) {
tmp = x * (z * 6.0);
} else if (z <= -1350000.0) {
tmp = -6.0 * (y * z);
} else if (z <= -3e-155) {
tmp = x * -3.0;
} else if (z <= 7.5e-256) {
tmp = y * 4.0;
} else if (z <= 3.5e-123) {
tmp = x * -3.0;
} else if (z <= 6600000000000.0) {
tmp = y * 4.0;
} else if (z <= 3.55e+61) {
tmp = 6.0 * (x * z);
} else {
tmp = y * (z * -6.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 <= (-7.6d+151)) then
tmp = x * (z * 6.0d0)
else if (z <= (-1350000.0d0)) then
tmp = (-6.0d0) * (y * z)
else if (z <= (-3d-155)) then
tmp = x * (-3.0d0)
else if (z <= 7.5d-256) then
tmp = y * 4.0d0
else if (z <= 3.5d-123) then
tmp = x * (-3.0d0)
else if (z <= 6600000000000.0d0) then
tmp = y * 4.0d0
else if (z <= 3.55d+61) then
tmp = 6.0d0 * (x * z)
else
tmp = y * (z * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -7.6e+151) {
tmp = x * (z * 6.0);
} else if (z <= -1350000.0) {
tmp = -6.0 * (y * z);
} else if (z <= -3e-155) {
tmp = x * -3.0;
} else if (z <= 7.5e-256) {
tmp = y * 4.0;
} else if (z <= 3.5e-123) {
tmp = x * -3.0;
} else if (z <= 6600000000000.0) {
tmp = y * 4.0;
} else if (z <= 3.55e+61) {
tmp = 6.0 * (x * z);
} else {
tmp = y * (z * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -7.6e+151: tmp = x * (z * 6.0) elif z <= -1350000.0: tmp = -6.0 * (y * z) elif z <= -3e-155: tmp = x * -3.0 elif z <= 7.5e-256: tmp = y * 4.0 elif z <= 3.5e-123: tmp = x * -3.0 elif z <= 6600000000000.0: tmp = y * 4.0 elif z <= 3.55e+61: tmp = 6.0 * (x * z) else: tmp = y * (z * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -7.6e+151) tmp = Float64(x * Float64(z * 6.0)); elseif (z <= -1350000.0) tmp = Float64(-6.0 * Float64(y * z)); elseif (z <= -3e-155) tmp = Float64(x * -3.0); elseif (z <= 7.5e-256) tmp = Float64(y * 4.0); elseif (z <= 3.5e-123) tmp = Float64(x * -3.0); elseif (z <= 6600000000000.0) tmp = Float64(y * 4.0); elseif (z <= 3.55e+61) tmp = Float64(6.0 * Float64(x * z)); else tmp = Float64(y * Float64(z * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -7.6e+151) tmp = x * (z * 6.0); elseif (z <= -1350000.0) tmp = -6.0 * (y * z); elseif (z <= -3e-155) tmp = x * -3.0; elseif (z <= 7.5e-256) tmp = y * 4.0; elseif (z <= 3.5e-123) tmp = x * -3.0; elseif (z <= 6600000000000.0) tmp = y * 4.0; elseif (z <= 3.55e+61) tmp = 6.0 * (x * z); else tmp = y * (z * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -7.6e+151], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1350000.0], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3e-155], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 7.5e-256], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.5e-123], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6600000000000.0], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.55e+61], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.6 \cdot 10^{+151}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;z \leq -1350000:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-155}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-256}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-123}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 6600000000000:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.55 \cdot 10^{+61}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\end{array}
\end{array}
if z < -7.6000000000000001e151Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 65.5%
sub-neg65.5%
distribute-rgt-in65.5%
metadata-eval65.5%
distribute-lft-neg-in65.5%
associate-+r+65.5%
metadata-eval65.5%
distribute-rgt-neg-in65.5%
metadata-eval65.5%
Simplified65.5%
Taylor expanded in z around inf 65.5%
if -7.6000000000000001e151 < z < -1.35e6Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 94.4%
Taylor expanded in z around inf 91.3%
Taylor expanded in y around inf 58.1%
if -1.35e6 < z < -2.99999999999999984e-155 or 7.50000000000000005e-256 < z < 3.4999999999999999e-123Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 65.1%
sub-neg65.1%
distribute-rgt-in65.1%
metadata-eval65.1%
distribute-lft-neg-in65.1%
associate-+r+65.1%
metadata-eval65.1%
distribute-rgt-neg-in65.1%
metadata-eval65.1%
Simplified65.1%
Taylor expanded in z around 0 58.5%
*-commutative58.5%
Simplified58.5%
if -2.99999999999999984e-155 < z < 7.50000000000000005e-256 or 3.4999999999999999e-123 < z < 6.6e12Initial program 98.1%
metadata-eval98.1%
Simplified98.1%
Taylor expanded in y around inf 58.4%
Taylor expanded in x around 0 59.1%
Taylor expanded in z around 0 58.5%
*-commutative58.5%
Simplified58.5%
if 6.6e12 < z < 3.55e61Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 72.3%
sub-neg72.3%
distribute-rgt-in72.3%
metadata-eval72.3%
distribute-lft-neg-in72.3%
associate-+r+72.3%
metadata-eval72.3%
distribute-rgt-neg-in72.3%
metadata-eval72.3%
Simplified72.3%
Taylor expanded in z around inf 72.3%
associate-*r/72.3%
metadata-eval72.3%
Simplified72.3%
Taylor expanded in z around inf 72.0%
if 3.55e61 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 87.5%
Taylor expanded in z around inf 89.7%
Taylor expanded in y around inf 63.7%
*-commutative63.7%
associate-*l*63.8%
*-commutative63.8%
Simplified63.8%
Final simplification60.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ -3.0 (* z 6.0)))) (t_1 (* -6.0 (* (- y x) z))))
(if (<= z -1800000.0)
t_1
(if (<= z -2.8e-156)
t_0
(if (<= z 2.8e-256)
(* y 4.0)
(if (<= z 1.26e-116)
(* x -3.0)
(if (<= z 1.25e-12)
(* 6.0 (* y (- 0.6666666666666666 z)))
(if (<= z 460000.0) t_0 t_1))))))))
double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double t_1 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -1800000.0) {
tmp = t_1;
} else if (z <= -2.8e-156) {
tmp = t_0;
} else if (z <= 2.8e-256) {
tmp = y * 4.0;
} else if (z <= 1.26e-116) {
tmp = x * -3.0;
} else if (z <= 1.25e-12) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else if (z <= 460000.0) {
tmp = t_0;
} 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 = x * ((-3.0d0) + (z * 6.0d0))
t_1 = (-6.0d0) * ((y - x) * z)
if (z <= (-1800000.0d0)) then
tmp = t_1
else if (z <= (-2.8d-156)) then
tmp = t_0
else if (z <= 2.8d-256) then
tmp = y * 4.0d0
else if (z <= 1.26d-116) then
tmp = x * (-3.0d0)
else if (z <= 1.25d-12) then
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
else if (z <= 460000.0d0) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double t_1 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -1800000.0) {
tmp = t_1;
} else if (z <= -2.8e-156) {
tmp = t_0;
} else if (z <= 2.8e-256) {
tmp = y * 4.0;
} else if (z <= 1.26e-116) {
tmp = x * -3.0;
} else if (z <= 1.25e-12) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else if (z <= 460000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = x * (-3.0 + (z * 6.0)) t_1 = -6.0 * ((y - x) * z) tmp = 0 if z <= -1800000.0: tmp = t_1 elif z <= -2.8e-156: tmp = t_0 elif z <= 2.8e-256: tmp = y * 4.0 elif z <= 1.26e-116: tmp = x * -3.0 elif z <= 1.25e-12: tmp = 6.0 * (y * (0.6666666666666666 - z)) elif z <= 460000.0: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(-3.0 + Float64(z * 6.0))) t_1 = Float64(-6.0 * Float64(Float64(y - x) * z)) tmp = 0.0 if (z <= -1800000.0) tmp = t_1; elseif (z <= -2.8e-156) tmp = t_0; elseif (z <= 2.8e-256) tmp = Float64(y * 4.0); elseif (z <= 1.26e-116) tmp = Float64(x * -3.0); elseif (z <= 1.25e-12) tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); elseif (z <= 460000.0) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (-3.0 + (z * 6.0)); t_1 = -6.0 * ((y - x) * z); tmp = 0.0; if (z <= -1800000.0) tmp = t_1; elseif (z <= -2.8e-156) tmp = t_0; elseif (z <= 2.8e-256) tmp = y * 4.0; elseif (z <= 1.26e-116) tmp = x * -3.0; elseif (z <= 1.25e-12) tmp = 6.0 * (y * (0.6666666666666666 - z)); elseif (z <= 460000.0) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1800000.0], t$95$1, If[LessEqual[z, -2.8e-156], t$95$0, If[LessEqual[z, 2.8e-256], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.26e-116], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.25e-12], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 460000.0], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(-3 + z \cdot 6\right)\\
t_1 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -1800000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-156}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-256}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.26 \cdot 10^{-116}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-12}:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{elif}\;z \leq 460000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.8e6 or 4.6e5 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 98.6%
if -1.8e6 < z < -2.8000000000000002e-156 or 1.24999999999999992e-12 < z < 4.6e5Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 67.7%
sub-neg67.7%
distribute-rgt-in67.7%
metadata-eval67.7%
distribute-lft-neg-in67.7%
associate-+r+67.7%
metadata-eval67.7%
distribute-rgt-neg-in67.7%
metadata-eval67.7%
Simplified67.7%
if -2.8000000000000002e-156 < z < 2.80000000000000023e-256Initial program 97.4%
metadata-eval97.4%
Simplified97.4%
Taylor expanded in y around inf 61.4%
Taylor expanded in x around 0 62.1%
Taylor expanded in z around 0 62.3%
*-commutative62.3%
Simplified62.3%
if 2.80000000000000023e-256 < z < 1.2599999999999999e-116Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 67.2%
sub-neg67.2%
distribute-rgt-in67.2%
metadata-eval67.2%
distribute-lft-neg-in67.2%
associate-+r+67.2%
metadata-eval67.2%
distribute-rgt-neg-in67.2%
metadata-eval67.2%
Simplified67.2%
Taylor expanded in z around 0 67.2%
*-commutative67.2%
Simplified67.2%
if 1.2599999999999999e-116 < z < 1.24999999999999992e-12Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in y around inf 68.9%
Taylor expanded in x around 0 69.1%
Final simplification82.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ -3.0 (* z 6.0))))
(t_1 (* -6.0 (* (- y x) z)))
(t_2 (* y (+ 4.0 (* z -6.0)))))
(if (<= z -1600000.0)
t_1
(if (<= z -4.5e-155)
t_0
(if (<= z 3.4e-256)
t_2
(if (<= z 6.6e-133)
(* x -3.0)
(if (<= z 2.95e-12) t_2 (if (<= z 102000.0) t_0 t_1))))))))
double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double t_1 = -6.0 * ((y - x) * z);
double t_2 = y * (4.0 + (z * -6.0));
double tmp;
if (z <= -1600000.0) {
tmp = t_1;
} else if (z <= -4.5e-155) {
tmp = t_0;
} else if (z <= 3.4e-256) {
tmp = t_2;
} else if (z <= 6.6e-133) {
tmp = x * -3.0;
} else if (z <= 2.95e-12) {
tmp = t_2;
} else if (z <= 102000.0) {
tmp = t_0;
} 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) :: t_2
real(8) :: tmp
t_0 = x * ((-3.0d0) + (z * 6.0d0))
t_1 = (-6.0d0) * ((y - x) * z)
t_2 = y * (4.0d0 + (z * (-6.0d0)))
if (z <= (-1600000.0d0)) then
tmp = t_1
else if (z <= (-4.5d-155)) then
tmp = t_0
else if (z <= 3.4d-256) then
tmp = t_2
else if (z <= 6.6d-133) then
tmp = x * (-3.0d0)
else if (z <= 2.95d-12) then
tmp = t_2
else if (z <= 102000.0d0) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double t_1 = -6.0 * ((y - x) * z);
double t_2 = y * (4.0 + (z * -6.0));
double tmp;
if (z <= -1600000.0) {
tmp = t_1;
} else if (z <= -4.5e-155) {
tmp = t_0;
} else if (z <= 3.4e-256) {
tmp = t_2;
} else if (z <= 6.6e-133) {
tmp = x * -3.0;
} else if (z <= 2.95e-12) {
tmp = t_2;
} else if (z <= 102000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = x * (-3.0 + (z * 6.0)) t_1 = -6.0 * ((y - x) * z) t_2 = y * (4.0 + (z * -6.0)) tmp = 0 if z <= -1600000.0: tmp = t_1 elif z <= -4.5e-155: tmp = t_0 elif z <= 3.4e-256: tmp = t_2 elif z <= 6.6e-133: tmp = x * -3.0 elif z <= 2.95e-12: tmp = t_2 elif z <= 102000.0: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(-3.0 + Float64(z * 6.0))) t_1 = Float64(-6.0 * Float64(Float64(y - x) * z)) t_2 = Float64(y * Float64(4.0 + Float64(z * -6.0))) tmp = 0.0 if (z <= -1600000.0) tmp = t_1; elseif (z <= -4.5e-155) tmp = t_0; elseif (z <= 3.4e-256) tmp = t_2; elseif (z <= 6.6e-133) tmp = Float64(x * -3.0); elseif (z <= 2.95e-12) tmp = t_2; elseif (z <= 102000.0) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (-3.0 + (z * 6.0)); t_1 = -6.0 * ((y - x) * z); t_2 = y * (4.0 + (z * -6.0)); tmp = 0.0; if (z <= -1600000.0) tmp = t_1; elseif (z <= -4.5e-155) tmp = t_0; elseif (z <= 3.4e-256) tmp = t_2; elseif (z <= 6.6e-133) tmp = x * -3.0; elseif (z <= 2.95e-12) tmp = t_2; elseif (z <= 102000.0) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1600000.0], t$95$1, If[LessEqual[z, -4.5e-155], t$95$0, If[LessEqual[z, 3.4e-256], t$95$2, If[LessEqual[z, 6.6e-133], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.95e-12], t$95$2, If[LessEqual[z, 102000.0], t$95$0, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(-3 + z \cdot 6\right)\\
t_1 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
t_2 := y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{if}\;z \leq -1600000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-155}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-256}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-133}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.95 \cdot 10^{-12}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 102000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.6e6 or 102000 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 98.6%
if -1.6e6 < z < -4.5000000000000004e-155 or 2.95e-12 < z < 102000Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 67.7%
sub-neg67.7%
distribute-rgt-in67.7%
metadata-eval67.7%
distribute-lft-neg-in67.7%
associate-+r+67.7%
metadata-eval67.7%
distribute-rgt-neg-in67.7%
metadata-eval67.7%
Simplified67.7%
if -4.5000000000000004e-155 < z < 3.4000000000000001e-256 or 6.60000000000000019e-133 < z < 2.95e-12Initial program 98.0%
+-commutative98.0%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 64.6%
if 3.4000000000000001e-256 < z < 6.60000000000000019e-133Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 67.2%
sub-neg67.2%
distribute-rgt-in67.2%
metadata-eval67.2%
distribute-lft-neg-in67.2%
associate-+r+67.2%
metadata-eval67.2%
distribute-rgt-neg-in67.2%
metadata-eval67.2%
Simplified67.2%
Taylor expanded in z around 0 67.2%
*-commutative67.2%
Simplified67.2%
Final simplification82.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ -3.0 (* z 6.0)))) (t_1 (* y (+ 4.0 (* z -6.0)))))
(if (<= z -1500000.0)
(* -6.0 (* (- y x) z))
(if (<= z -5.5e-151)
t_0
(if (<= z 2.9e-256)
t_1
(if (<= z 2.7e-113)
(* x -3.0)
(if (<= z 3.5e-12)
t_1
(if (<= z 1200000.0) t_0 (* z (* (- y x) -6.0))))))))))
double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double t_1 = y * (4.0 + (z * -6.0));
double tmp;
if (z <= -1500000.0) {
tmp = -6.0 * ((y - x) * z);
} else if (z <= -5.5e-151) {
tmp = t_0;
} else if (z <= 2.9e-256) {
tmp = t_1;
} else if (z <= 2.7e-113) {
tmp = x * -3.0;
} else if (z <= 3.5e-12) {
tmp = t_1;
} else if (z <= 1200000.0) {
tmp = t_0;
} else {
tmp = z * ((y - x) * -6.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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x * ((-3.0d0) + (z * 6.0d0))
t_1 = y * (4.0d0 + (z * (-6.0d0)))
if (z <= (-1500000.0d0)) then
tmp = (-6.0d0) * ((y - x) * z)
else if (z <= (-5.5d-151)) then
tmp = t_0
else if (z <= 2.9d-256) then
tmp = t_1
else if (z <= 2.7d-113) then
tmp = x * (-3.0d0)
else if (z <= 3.5d-12) then
tmp = t_1
else if (z <= 1200000.0d0) then
tmp = t_0
else
tmp = z * ((y - x) * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double t_1 = y * (4.0 + (z * -6.0));
double tmp;
if (z <= -1500000.0) {
tmp = -6.0 * ((y - x) * z);
} else if (z <= -5.5e-151) {
tmp = t_0;
} else if (z <= 2.9e-256) {
tmp = t_1;
} else if (z <= 2.7e-113) {
tmp = x * -3.0;
} else if (z <= 3.5e-12) {
tmp = t_1;
} else if (z <= 1200000.0) {
tmp = t_0;
} else {
tmp = z * ((y - x) * -6.0);
}
return tmp;
}
def code(x, y, z): t_0 = x * (-3.0 + (z * 6.0)) t_1 = y * (4.0 + (z * -6.0)) tmp = 0 if z <= -1500000.0: tmp = -6.0 * ((y - x) * z) elif z <= -5.5e-151: tmp = t_0 elif z <= 2.9e-256: tmp = t_1 elif z <= 2.7e-113: tmp = x * -3.0 elif z <= 3.5e-12: tmp = t_1 elif z <= 1200000.0: tmp = t_0 else: tmp = z * ((y - x) * -6.0) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(-3.0 + Float64(z * 6.0))) t_1 = Float64(y * Float64(4.0 + Float64(z * -6.0))) tmp = 0.0 if (z <= -1500000.0) tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); elseif (z <= -5.5e-151) tmp = t_0; elseif (z <= 2.9e-256) tmp = t_1; elseif (z <= 2.7e-113) tmp = Float64(x * -3.0); elseif (z <= 3.5e-12) tmp = t_1; elseif (z <= 1200000.0) tmp = t_0; else tmp = Float64(z * Float64(Float64(y - x) * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (-3.0 + (z * 6.0)); t_1 = y * (4.0 + (z * -6.0)); tmp = 0.0; if (z <= -1500000.0) tmp = -6.0 * ((y - x) * z); elseif (z <= -5.5e-151) tmp = t_0; elseif (z <= 2.9e-256) tmp = t_1; elseif (z <= 2.7e-113) tmp = x * -3.0; elseif (z <= 3.5e-12) tmp = t_1; elseif (z <= 1200000.0) tmp = t_0; else tmp = z * ((y - x) * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1500000.0], N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.5e-151], t$95$0, If[LessEqual[z, 2.9e-256], t$95$1, If[LessEqual[z, 2.7e-113], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.5e-12], t$95$1, If[LessEqual[z, 1200000.0], t$95$0, N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(-3 + z \cdot 6\right)\\
t_1 := y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{if}\;z \leq -1500000:\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-151}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-256}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-113}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1200000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\end{array}
\end{array}
if z < -1.5e6Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 97.9%
if -1.5e6 < z < -5.4999999999999998e-151 or 3.5e-12 < z < 1.2e6Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 67.7%
sub-neg67.7%
distribute-rgt-in67.7%
metadata-eval67.7%
distribute-lft-neg-in67.7%
associate-+r+67.7%
metadata-eval67.7%
distribute-rgt-neg-in67.7%
metadata-eval67.7%
Simplified67.7%
if -5.4999999999999998e-151 < z < 2.89999999999999971e-256 or 2.69999999999999996e-113 < z < 3.5e-12Initial program 98.0%
+-commutative98.0%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 64.6%
if 2.89999999999999971e-256 < z < 2.69999999999999996e-113Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 67.2%
sub-neg67.2%
distribute-rgt-in67.2%
metadata-eval67.2%
distribute-lft-neg-in67.2%
associate-+r+67.2%
metadata-eval67.2%
distribute-rgt-neg-in67.2%
metadata-eval67.2%
Simplified67.2%
Taylor expanded in z around 0 67.2%
*-commutative67.2%
Simplified67.2%
if 1.2e6 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 99.4%
associate-*r*99.4%
*-commutative99.4%
associate-*r*99.5%
Simplified99.5%
Final simplification82.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -0.017)
t_0
(if (<= z -5.4e-151)
(* x -3.0)
(if (<= z 2.8e-256)
(* y 4.0)
(if (<= z 7.9e-131) (* x -3.0) (if (<= z 0.66) (* y 4.0) t_0)))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -0.017) {
tmp = t_0;
} else if (z <= -5.4e-151) {
tmp = x * -3.0;
} else if (z <= 2.8e-256) {
tmp = y * 4.0;
} else if (z <= 7.9e-131) {
tmp = x * -3.0;
} else if (z <= 0.66) {
tmp = y * 4.0;
} else {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * ((y - x) * z)
if (z <= (-0.017d0)) then
tmp = t_0
else if (z <= (-5.4d-151)) then
tmp = x * (-3.0d0)
else if (z <= 2.8d-256) then
tmp = y * 4.0d0
else if (z <= 7.9d-131) then
tmp = x * (-3.0d0)
else if (z <= 0.66d0) then
tmp = y * 4.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -0.017) {
tmp = t_0;
} else if (z <= -5.4e-151) {
tmp = x * -3.0;
} else if (z <= 2.8e-256) {
tmp = y * 4.0;
} else if (z <= 7.9e-131) {
tmp = x * -3.0;
} else if (z <= 0.66) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * ((y - x) * z) tmp = 0 if z <= -0.017: tmp = t_0 elif z <= -5.4e-151: tmp = x * -3.0 elif z <= 2.8e-256: tmp = y * 4.0 elif z <= 7.9e-131: tmp = x * -3.0 elif z <= 0.66: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(Float64(y - x) * z)) tmp = 0.0 if (z <= -0.017) tmp = t_0; elseif (z <= -5.4e-151) tmp = Float64(x * -3.0); elseif (z <= 2.8e-256) tmp = Float64(y * 4.0); elseif (z <= 7.9e-131) tmp = Float64(x * -3.0); elseif (z <= 0.66) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * ((y - x) * z); tmp = 0.0; if (z <= -0.017) tmp = t_0; elseif (z <= -5.4e-151) tmp = x * -3.0; elseif (z <= 2.8e-256) tmp = y * 4.0; elseif (z <= 7.9e-131) tmp = x * -3.0; elseif (z <= 0.66) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.017], t$95$0, If[LessEqual[z, -5.4e-151], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.8e-256], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 7.9e-131], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.66], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -0.017:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -5.4 \cdot 10^{-151}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-256}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 7.9 \cdot 10^{-131}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.017000000000000001 or 0.660000000000000031 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 97.3%
if -0.017000000000000001 < z < -5.40000000000000014e-151 or 2.80000000000000023e-256 < z < 7.8999999999999996e-131Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 63.4%
sub-neg63.4%
distribute-rgt-in63.4%
metadata-eval63.4%
distribute-lft-neg-in63.4%
associate-+r+63.5%
metadata-eval63.5%
distribute-rgt-neg-in63.5%
metadata-eval63.5%
Simplified63.5%
Taylor expanded in z around 0 60.7%
*-commutative60.7%
Simplified60.7%
if -5.40000000000000014e-151 < z < 2.80000000000000023e-256 or 7.8999999999999996e-131 < z < 0.660000000000000031Initial program 98.0%
metadata-eval98.0%
Simplified98.0%
Taylor expanded in y around inf 58.9%
Taylor expanded in x around 0 59.6%
Taylor expanded in z around 0 59.4%
*-commutative59.4%
Simplified59.4%
Final simplification79.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -0.014)
t_0
(if (<= z -2.25e-154)
(* x -3.0)
(if (<= z 1.5e-256)
(* y 4.0)
(if (<= z 7.6e-132)
(* x -3.0)
(if (<= z 59000.0) (* 6.0 (* y (- 0.6666666666666666 z))) t_0)))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -0.014) {
tmp = t_0;
} else if (z <= -2.25e-154) {
tmp = x * -3.0;
} else if (z <= 1.5e-256) {
tmp = y * 4.0;
} else if (z <= 7.6e-132) {
tmp = x * -3.0;
} else if (z <= 59000.0) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * ((y - x) * z)
if (z <= (-0.014d0)) then
tmp = t_0
else if (z <= (-2.25d-154)) then
tmp = x * (-3.0d0)
else if (z <= 1.5d-256) then
tmp = y * 4.0d0
else if (z <= 7.6d-132) then
tmp = x * (-3.0d0)
else if (z <= 59000.0d0) then
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -0.014) {
tmp = t_0;
} else if (z <= -2.25e-154) {
tmp = x * -3.0;
} else if (z <= 1.5e-256) {
tmp = y * 4.0;
} else if (z <= 7.6e-132) {
tmp = x * -3.0;
} else if (z <= 59000.0) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * ((y - x) * z) tmp = 0 if z <= -0.014: tmp = t_0 elif z <= -2.25e-154: tmp = x * -3.0 elif z <= 1.5e-256: tmp = y * 4.0 elif z <= 7.6e-132: tmp = x * -3.0 elif z <= 59000.0: tmp = 6.0 * (y * (0.6666666666666666 - z)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(Float64(y - x) * z)) tmp = 0.0 if (z <= -0.014) tmp = t_0; elseif (z <= -2.25e-154) tmp = Float64(x * -3.0); elseif (z <= 1.5e-256) tmp = Float64(y * 4.0); elseif (z <= 7.6e-132) tmp = Float64(x * -3.0); elseif (z <= 59000.0) tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * ((y - x) * z); tmp = 0.0; if (z <= -0.014) tmp = t_0; elseif (z <= -2.25e-154) tmp = x * -3.0; elseif (z <= 1.5e-256) tmp = y * 4.0; elseif (z <= 7.6e-132) tmp = x * -3.0; elseif (z <= 59000.0) tmp = 6.0 * (y * (0.6666666666666666 - z)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.014], t$95$0, If[LessEqual[z, -2.25e-154], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.5e-256], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 7.6e-132], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 59000.0], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -0.014:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -2.25 \cdot 10^{-154}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-256}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{-132}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 59000:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.0140000000000000003 or 59000 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 97.3%
if -0.0140000000000000003 < z < -2.2499999999999999e-154 or 1.4999999999999999e-256 < z < 7.5999999999999994e-132Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 63.4%
sub-neg63.4%
distribute-rgt-in63.4%
metadata-eval63.4%
distribute-lft-neg-in63.4%
associate-+r+63.5%
metadata-eval63.5%
distribute-rgt-neg-in63.5%
metadata-eval63.5%
Simplified63.5%
Taylor expanded in z around 0 60.7%
*-commutative60.7%
Simplified60.7%
if -2.2499999999999999e-154 < z < 1.4999999999999999e-256Initial program 97.4%
metadata-eval97.4%
Simplified97.4%
Taylor expanded in y around inf 61.4%
Taylor expanded in x around 0 62.1%
Taylor expanded in z around 0 62.3%
*-commutative62.3%
Simplified62.3%
if 7.5999999999999994e-132 < z < 59000Initial program 99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in y around inf 54.8%
Taylor expanded in x around 0 55.4%
Final simplification79.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -1350000.0)
t_0
(if (<= z -1.45e-151)
(* x -3.0)
(if (<= z 6.5e-256)
(* y 4.0)
(if (<= z 1.12e-119)
(* x -3.0)
(if (<= z 2.2e-10) (* y 4.0) t_0)))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -1350000.0) {
tmp = t_0;
} else if (z <= -1.45e-151) {
tmp = x * -3.0;
} else if (z <= 6.5e-256) {
tmp = y * 4.0;
} else if (z <= 1.12e-119) {
tmp = x * -3.0;
} else if (z <= 2.2e-10) {
tmp = y * 4.0;
} else {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-1350000.0d0)) then
tmp = t_0
else if (z <= (-1.45d-151)) then
tmp = x * (-3.0d0)
else if (z <= 6.5d-256) then
tmp = y * 4.0d0
else if (z <= 1.12d-119) then
tmp = x * (-3.0d0)
else if (z <= 2.2d-10) then
tmp = y * 4.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -1350000.0) {
tmp = t_0;
} else if (z <= -1.45e-151) {
tmp = x * -3.0;
} else if (z <= 6.5e-256) {
tmp = y * 4.0;
} else if (z <= 1.12e-119) {
tmp = x * -3.0;
} else if (z <= 2.2e-10) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -1350000.0: tmp = t_0 elif z <= -1.45e-151: tmp = x * -3.0 elif z <= 6.5e-256: tmp = y * 4.0 elif z <= 1.12e-119: tmp = x * -3.0 elif z <= 2.2e-10: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -1350000.0) tmp = t_0; elseif (z <= -1.45e-151) tmp = Float64(x * -3.0); elseif (z <= 6.5e-256) tmp = Float64(y * 4.0); elseif (z <= 1.12e-119) tmp = Float64(x * -3.0); elseif (z <= 2.2e-10) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -1350000.0) tmp = t_0; elseif (z <= -1.45e-151) tmp = x * -3.0; elseif (z <= 6.5e-256) tmp = y * 4.0; elseif (z <= 1.12e-119) tmp = x * -3.0; elseif (z <= 2.2e-10) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1350000.0], t$95$0, If[LessEqual[z, -1.45e-151], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.5e-256], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.12e-119], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.2e-10], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -1350000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{-151}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-256}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-119}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-10}:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.35e6 or 2.1999999999999999e-10 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 83.7%
Taylor expanded in z around inf 82.9%
Taylor expanded in y around inf 52.8%
if -1.35e6 < z < -1.45000000000000006e-151 or 6.50000000000000052e-256 < z < 1.11999999999999998e-119Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 65.1%
sub-neg65.1%
distribute-rgt-in65.1%
metadata-eval65.1%
distribute-lft-neg-in65.1%
associate-+r+65.1%
metadata-eval65.1%
distribute-rgt-neg-in65.1%
metadata-eval65.1%
Simplified65.1%
Taylor expanded in z around 0 58.5%
*-commutative58.5%
Simplified58.5%
if -1.45000000000000006e-151 < z < 6.50000000000000052e-256 or 1.11999999999999998e-119 < z < 2.1999999999999999e-10Initial program 98.0%
metadata-eval98.0%
Simplified98.0%
Taylor expanded in y around inf 62.8%
Taylor expanded in x around 0 63.4%
Taylor expanded in z around 0 63.2%
*-commutative63.2%
Simplified63.2%
Final simplification56.6%
(FPCore (x y z) :precision binary64 (if (<= z -0.56) (* -6.0 (* (- y x) z)) (if (<= z 0.52) (+ x (* (- y x) 4.0)) (* z (* (- y x) -6.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.56) {
tmp = -6.0 * ((y - x) * z);
} else if (z <= 0.52) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = z * ((y - x) * -6.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 <= (-0.56d0)) then
tmp = (-6.0d0) * ((y - x) * z)
else if (z <= 0.52d0) then
tmp = x + ((y - x) * 4.0d0)
else
tmp = z * ((y - x) * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.56) {
tmp = -6.0 * ((y - x) * z);
} else if (z <= 0.52) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = z * ((y - x) * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.56: tmp = -6.0 * ((y - x) * z) elif z <= 0.52: tmp = x + ((y - x) * 4.0) else: tmp = z * ((y - x) * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.56) tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); elseif (z <= 0.52) tmp = Float64(x + Float64(Float64(y - x) * 4.0)); else tmp = Float64(z * Float64(Float64(y - x) * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.56) tmp = -6.0 * ((y - x) * z); elseif (z <= 0.52) tmp = x + ((y - x) * 4.0); else tmp = z * ((y - x) * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.56], N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.52], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.56:\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{elif}\;z \leq 0.52:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.56000000000000005Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 95.5%
if -0.56000000000000005 < z < 0.52000000000000002Initial program 98.6%
metadata-eval98.6%
Simplified98.6%
Taylor expanded in z around 0 95.6%
if 0.52000000000000002 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 99.4%
associate-*r*99.4%
*-commutative99.4%
associate-*r*99.5%
Simplified99.5%
Final simplification96.5%
(FPCore (x y z) :precision binary64 (if (<= z -0.56) (* -6.0 (* (- y x) z)) (if (<= z 0.5) (+ (* x -3.0) (* y 4.0)) (* z (* (- y x) -6.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.56) {
tmp = -6.0 * ((y - x) * z);
} else if (z <= 0.5) {
tmp = (x * -3.0) + (y * 4.0);
} else {
tmp = z * ((y - x) * -6.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 <= (-0.56d0)) then
tmp = (-6.0d0) * ((y - x) * z)
else if (z <= 0.5d0) then
tmp = (x * (-3.0d0)) + (y * 4.0d0)
else
tmp = z * ((y - x) * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.56) {
tmp = -6.0 * ((y - x) * z);
} else if (z <= 0.5) {
tmp = (x * -3.0) + (y * 4.0);
} else {
tmp = z * ((y - x) * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.56: tmp = -6.0 * ((y - x) * z) elif z <= 0.5: tmp = (x * -3.0) + (y * 4.0) else: tmp = z * ((y - x) * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.56) tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); elseif (z <= 0.5) tmp = Float64(Float64(x * -3.0) + Float64(y * 4.0)); else tmp = Float64(z * Float64(Float64(y - x) * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.56) tmp = -6.0 * ((y - x) * z); elseif (z <= 0.5) tmp = (x * -3.0) + (y * 4.0); else tmp = z * ((y - x) * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.56], N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.5], N[(N[(x * -3.0), $MachinePrecision] + N[(y * 4.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.56:\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3 + y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.56000000000000005Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 95.5%
if -0.56000000000000005 < z < 0.5Initial program 98.6%
metadata-eval98.6%
Simplified98.6%
Taylor expanded in x around 0 99.6%
Taylor expanded in z around 0 95.6%
if 0.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 99.4%
associate-*r*99.4%
*-commutative99.4%
associate-*r*99.5%
Simplified99.5%
Final simplification96.5%
(FPCore (x y z) :precision binary64 (+ x (+ (* -6.0 (* (- y x) z)) (* (- y x) 4.0))))
double code(double x, double y, double z) {
return x + ((-6.0 * ((y - x) * z)) + ((y - x) * 4.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 + (((-6.0d0) * ((y - x) * z)) + ((y - x) * 4.0d0))
end function
public static double code(double x, double y, double z) {
return x + ((-6.0 * ((y - x) * z)) + ((y - x) * 4.0));
}
def code(x, y, z): return x + ((-6.0 * ((y - x) * z)) + ((y - x) * 4.0))
function code(x, y, z) return Float64(x + Float64(Float64(-6.0 * Float64(Float64(y - x) * z)) + Float64(Float64(y - x) * 4.0))) end
function tmp = code(x, y, z) tmp = x + ((-6.0 * ((y - x) * z)) + ((y - x) * 4.0)); end
code[x_, y_, z_] := N[(x + N[(N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(-6 \cdot \left(\left(y - x\right) \cdot z\right) + \left(y - x\right) \cdot 4\right)
\end{array}
Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in z around 0 99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (or (<= x -3.8e+69) (not (<= x 2.8e+14))) (* x -3.0) (* y 4.0)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -3.8e+69) || !(x <= 2.8e+14)) {
tmp = x * -3.0;
} else {
tmp = y * 4.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 ((x <= (-3.8d+69)) .or. (.not. (x <= 2.8d+14))) then
tmp = x * (-3.0d0)
else
tmp = y * 4.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -3.8e+69) || !(x <= 2.8e+14)) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -3.8e+69) or not (x <= 2.8e+14): tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -3.8e+69) || !(x <= 2.8e+14)) tmp = Float64(x * -3.0); else tmp = Float64(y * 4.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -3.8e+69) || ~((x <= 2.8e+14))) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -3.8e+69], N[Not[LessEqual[x, 2.8e+14]], $MachinePrecision]], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{+69} \lor \neg \left(x \leq 2.8 \cdot 10^{+14}\right):\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if x < -3.80000000000000028e69 or 2.8e14 < x Initial program 98.7%
metadata-eval98.7%
Simplified98.7%
Taylor expanded in x around inf 83.1%
sub-neg83.1%
distribute-rgt-in83.1%
metadata-eval83.1%
distribute-lft-neg-in83.1%
associate-+r+83.1%
metadata-eval83.1%
distribute-rgt-neg-in83.1%
metadata-eval83.1%
Simplified83.1%
Taylor expanded in z around 0 43.8%
*-commutative43.8%
Simplified43.8%
if -3.80000000000000028e69 < x < 2.8e14Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 71.8%
Taylor expanded in x around 0 71.9%
Taylor expanded in z around 0 36.0%
*-commutative36.0%
Simplified36.0%
Final simplification39.4%
(FPCore (x y z) :precision binary64 (+ x (* (+ (* x -6.0) (* y 6.0)) (- 0.6666666666666666 z))))
double code(double x, double y, double z) {
return x + (((x * -6.0) + (y * 6.0)) * (0.6666666666666666 - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((x * (-6.0d0)) + (y * 6.0d0)) * (0.6666666666666666d0 - z))
end function
public static double code(double x, double y, double z) {
return x + (((x * -6.0) + (y * 6.0)) * (0.6666666666666666 - z));
}
def code(x, y, z): return x + (((x * -6.0) + (y * 6.0)) * (0.6666666666666666 - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(x * -6.0) + Float64(y * 6.0)) * Float64(0.6666666666666666 - z))) end
function tmp = code(x, y, z) tmp = x + (((x * -6.0) + (y * 6.0)) * (0.6666666666666666 - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(x * -6.0), $MachinePrecision] + N[(y * 6.0), $MachinePrecision]), $MachinePrecision] * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(x \cdot -6 + y \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)
\end{array}
Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in y around 0 99.2%
Final simplification99.2%
(FPCore (x y z) :precision binary64 (+ x (* (- 0.6666666666666666 z) (* (- y x) 6.0))))
double code(double x, double y, double z) {
return x + ((0.6666666666666666 - z) * ((y - x) * 6.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 + ((0.6666666666666666d0 - z) * ((y - x) * 6.0d0))
end function
public static double code(double x, double y, double z) {
return x + ((0.6666666666666666 - z) * ((y - x) * 6.0));
}
def code(x, y, z): return x + ((0.6666666666666666 - z) * ((y - x) * 6.0))
function code(x, y, z) return Float64(x + Float64(Float64(0.6666666666666666 - z) * Float64(Float64(y - x) * 6.0))) end
function tmp = code(x, y, z) tmp = x + ((0.6666666666666666 - z) * ((y - x) * 6.0)); end
code[x_, y_, z_] := N[(x + N[(N[(0.6666666666666666 - z), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(0.6666666666666666 - z\right) \cdot \left(\left(y - x\right) \cdot 6\right)
\end{array}
Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z) :precision binary64 (* x -3.0))
double code(double x, double y, double z) {
return x * -3.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 * (-3.0d0)
end function
public static double code(double x, double y, double z) {
return x * -3.0;
}
def code(x, y, z): return x * -3.0
function code(x, y, z) return Float64(x * -3.0) end
function tmp = code(x, y, z) tmp = x * -3.0; end
code[x_, y_, z_] := N[(x * -3.0), $MachinePrecision]
\begin{array}{l}
\\
x \cdot -3
\end{array}
Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 52.4%
sub-neg52.4%
distribute-rgt-in52.4%
metadata-eval52.4%
distribute-lft-neg-in52.4%
associate-+r+52.4%
metadata-eval52.4%
distribute-rgt-neg-in52.4%
metadata-eval52.4%
Simplified52.4%
Taylor expanded in z around 0 25.7%
*-commutative25.7%
Simplified25.7%
Final simplification25.7%
(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.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in y around inf 50.5%
Taylor expanded in x around inf 2.6%
Final simplification2.6%
herbie shell --seed 2024095
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, D"
:precision binary64
(+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))