
(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 16 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.6%
+-commutative99.6%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
distribute-rgt-neg-out99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (fma (- y x) (+ 4.0 (* z -6.0)) x))
double code(double x, double y, double z) {
return fma((y - x), (4.0 + (z * -6.0)), x);
}
function code(x, y, z) return fma(Float64(y - x), Float64(4.0 + Float64(z * -6.0)), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, 4 + z \cdot -6, x\right)
\end{array}
Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))) (t_1 (* 6.0 (* x z))))
(if (<= z -3.2e+128)
t_0
(if (<= z -1.65e+98)
t_1
(if (<= z -47000.0)
t_0
(if (<= z 5.2e-303)
(* x -3.0)
(if (<= z 9e-187)
(* y 4.0)
(if (<= z 1.16e-119)
(* x -3.0)
(if (<= z 0.62) (* y 4.0) t_1)))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double t_1 = 6.0 * (x * z);
double tmp;
if (z <= -3.2e+128) {
tmp = t_0;
} else if (z <= -1.65e+98) {
tmp = t_1;
} else if (z <= -47000.0) {
tmp = t_0;
} else if (z <= 5.2e-303) {
tmp = x * -3.0;
} else if (z <= 9e-187) {
tmp = y * 4.0;
} else if (z <= 1.16e-119) {
tmp = x * -3.0;
} else if (z <= 0.62) {
tmp = y * 4.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) * (y * z)
t_1 = 6.0d0 * (x * z)
if (z <= (-3.2d+128)) then
tmp = t_0
else if (z <= (-1.65d+98)) then
tmp = t_1
else if (z <= (-47000.0d0)) then
tmp = t_0
else if (z <= 5.2d-303) then
tmp = x * (-3.0d0)
else if (z <= 9d-187) then
tmp = y * 4.0d0
else if (z <= 1.16d-119) then
tmp = x * (-3.0d0)
else if (z <= 0.62d0) then
tmp = y * 4.0d0
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 * (y * z);
double t_1 = 6.0 * (x * z);
double tmp;
if (z <= -3.2e+128) {
tmp = t_0;
} else if (z <= -1.65e+98) {
tmp = t_1;
} else if (z <= -47000.0) {
tmp = t_0;
} else if (z <= 5.2e-303) {
tmp = x * -3.0;
} else if (z <= 9e-187) {
tmp = y * 4.0;
} else if (z <= 1.16e-119) {
tmp = x * -3.0;
} else if (z <= 0.62) {
tmp = y * 4.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) t_1 = 6.0 * (x * z) tmp = 0 if z <= -3.2e+128: tmp = t_0 elif z <= -1.65e+98: tmp = t_1 elif z <= -47000.0: tmp = t_0 elif z <= 5.2e-303: tmp = x * -3.0 elif z <= 9e-187: tmp = y * 4.0 elif z <= 1.16e-119: tmp = x * -3.0 elif z <= 0.62: tmp = y * 4.0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) t_1 = Float64(6.0 * Float64(x * z)) tmp = 0.0 if (z <= -3.2e+128) tmp = t_0; elseif (z <= -1.65e+98) tmp = t_1; elseif (z <= -47000.0) tmp = t_0; elseif (z <= 5.2e-303) tmp = Float64(x * -3.0); elseif (z <= 9e-187) tmp = Float64(y * 4.0); elseif (z <= 1.16e-119) tmp = Float64(x * -3.0); elseif (z <= 0.62) tmp = Float64(y * 4.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); t_1 = 6.0 * (x * z); tmp = 0.0; if (z <= -3.2e+128) tmp = t_0; elseif (z <= -1.65e+98) tmp = t_1; elseif (z <= -47000.0) tmp = t_0; elseif (z <= 5.2e-303) tmp = x * -3.0; elseif (z <= 9e-187) tmp = y * 4.0; elseif (z <= 1.16e-119) tmp = x * -3.0; elseif (z <= 0.62) tmp = y * 4.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e+128], t$95$0, If[LessEqual[z, -1.65e+98], t$95$1, If[LessEqual[z, -47000.0], t$95$0, If[LessEqual[z, 5.2e-303], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 9e-187], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.16e-119], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.62], N[(y * 4.0), $MachinePrecision], t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
t_1 := 6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+128}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{+98}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -47000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-303}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-187}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.16 \cdot 10^{-119}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.62:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -3.19999999999999986e128 or -1.65000000000000014e98 < z < -47000Initial program 99.8%
+-commutative99.8%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 56.7%
Taylor expanded in z around inf 55.3%
*-commutative55.3%
Simplified55.3%
if -3.19999999999999986e128 < z < -1.65000000000000014e98 or 0.619999999999999996 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 67.7%
sub-neg67.7%
distribute-rgt-in67.7%
metadata-eval67.7%
metadata-eval67.7%
distribute-lft-neg-in67.7%
associate-+r+67.7%
metadata-eval67.7%
metadata-eval67.7%
distribute-rgt-neg-in67.7%
metadata-eval67.7%
Simplified67.7%
Taylor expanded in z around inf 66.1%
if -47000 < z < 5.20000000000000009e-303 or 8.9999999999999996e-187 < z < 1.16e-119Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 68.5%
sub-neg68.5%
distribute-rgt-in68.5%
metadata-eval68.5%
metadata-eval68.5%
distribute-lft-neg-in68.5%
associate-+r+68.5%
metadata-eval68.5%
metadata-eval68.5%
distribute-rgt-neg-in68.5%
metadata-eval68.5%
Simplified68.5%
Taylor expanded in z around 0 65.7%
*-commutative65.7%
Simplified65.7%
if 5.20000000000000009e-303 < z < 8.9999999999999996e-187 or 1.16e-119 < z < 0.619999999999999996Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 99.6%
Taylor expanded in z around 0 98.0%
Taylor expanded in x around 0 64.1%
*-commutative64.1%
Simplified64.1%
Final simplification63.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -1.95e+129)
t_0
(if (<= z -1.65e+98)
(* x (* z 6.0))
(if (<= z -47000.0)
t_0
(if (<= z 3.5e-302)
(* x -3.0)
(if (<= z 1.35e-186)
(* y 4.0)
(if (<= z 3.2e-120)
(* x -3.0)
(if (<= z 0.5) (* y 4.0) (* 6.0 (* x z)))))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -1.95e+129) {
tmp = t_0;
} else if (z <= -1.65e+98) {
tmp = x * (z * 6.0);
} else if (z <= -47000.0) {
tmp = t_0;
} else if (z <= 3.5e-302) {
tmp = x * -3.0;
} else if (z <= 1.35e-186) {
tmp = y * 4.0;
} else if (z <= 3.2e-120) {
tmp = x * -3.0;
} else if (z <= 0.5) {
tmp = y * 4.0;
} else {
tmp = 6.0 * (x * 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) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-1.95d+129)) then
tmp = t_0
else if (z <= (-1.65d+98)) then
tmp = x * (z * 6.0d0)
else if (z <= (-47000.0d0)) then
tmp = t_0
else if (z <= 3.5d-302) then
tmp = x * (-3.0d0)
else if (z <= 1.35d-186) then
tmp = y * 4.0d0
else if (z <= 3.2d-120) then
tmp = x * (-3.0d0)
else if (z <= 0.5d0) then
tmp = y * 4.0d0
else
tmp = 6.0d0 * (x * z)
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 <= -1.95e+129) {
tmp = t_0;
} else if (z <= -1.65e+98) {
tmp = x * (z * 6.0);
} else if (z <= -47000.0) {
tmp = t_0;
} else if (z <= 3.5e-302) {
tmp = x * -3.0;
} else if (z <= 1.35e-186) {
tmp = y * 4.0;
} else if (z <= 3.2e-120) {
tmp = x * -3.0;
} else if (z <= 0.5) {
tmp = y * 4.0;
} else {
tmp = 6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -1.95e+129: tmp = t_0 elif z <= -1.65e+98: tmp = x * (z * 6.0) elif z <= -47000.0: tmp = t_0 elif z <= 3.5e-302: tmp = x * -3.0 elif z <= 1.35e-186: tmp = y * 4.0 elif z <= 3.2e-120: tmp = x * -3.0 elif z <= 0.5: tmp = y * 4.0 else: tmp = 6.0 * (x * z) return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -1.95e+129) tmp = t_0; elseif (z <= -1.65e+98) tmp = Float64(x * Float64(z * 6.0)); elseif (z <= -47000.0) tmp = t_0; elseif (z <= 3.5e-302) tmp = Float64(x * -3.0); elseif (z <= 1.35e-186) tmp = Float64(y * 4.0); elseif (z <= 3.2e-120) tmp = Float64(x * -3.0); elseif (z <= 0.5) tmp = Float64(y * 4.0); else tmp = Float64(6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -1.95e+129) tmp = t_0; elseif (z <= -1.65e+98) tmp = x * (z * 6.0); elseif (z <= -47000.0) tmp = t_0; elseif (z <= 3.5e-302) tmp = x * -3.0; elseif (z <= 1.35e-186) tmp = y * 4.0; elseif (z <= 3.2e-120) tmp = x * -3.0; elseif (z <= 0.5) tmp = y * 4.0; else tmp = 6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.95e+129], t$95$0, If[LessEqual[z, -1.65e+98], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -47000.0], t$95$0, If[LessEqual[z, 3.5e-302], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.35e-186], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.2e-120], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(y * 4.0), $MachinePrecision], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -1.95 \cdot 10^{+129}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{+98}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;z \leq -47000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-302}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-186}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-120}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -1.9499999999999999e129 or -1.65000000000000014e98 < z < -47000Initial program 99.8%
+-commutative99.8%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 56.7%
Taylor expanded in z around inf 55.3%
*-commutative55.3%
Simplified55.3%
if -1.9499999999999999e129 < z < -1.65000000000000014e98Initial program 100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 86.4%
sub-neg86.4%
distribute-rgt-in86.4%
metadata-eval86.4%
metadata-eval86.4%
distribute-lft-neg-in86.4%
associate-+r+86.4%
metadata-eval86.4%
metadata-eval86.4%
distribute-rgt-neg-in86.4%
metadata-eval86.4%
Simplified86.4%
Taylor expanded in z around inf 86.2%
associate-*r*86.6%
*-commutative86.6%
associate-*r*86.4%
*-commutative86.4%
Simplified86.4%
if -47000 < z < 3.5000000000000001e-302 or 1.3499999999999999e-186 < z < 3.1999999999999999e-120Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 68.5%
sub-neg68.5%
distribute-rgt-in68.5%
metadata-eval68.5%
metadata-eval68.5%
distribute-lft-neg-in68.5%
associate-+r+68.5%
metadata-eval68.5%
metadata-eval68.5%
distribute-rgt-neg-in68.5%
metadata-eval68.5%
Simplified68.5%
Taylor expanded in z around 0 65.7%
*-commutative65.7%
Simplified65.7%
if 3.5000000000000001e-302 < z < 1.3499999999999999e-186 or 3.1999999999999999e-120 < z < 0.5Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 99.6%
Taylor expanded in z around 0 98.0%
Taylor expanded in x around 0 64.1%
*-commutative64.1%
Simplified64.1%
if 0.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 65.2%
sub-neg65.2%
distribute-rgt-in65.2%
metadata-eval65.2%
metadata-eval65.2%
distribute-lft-neg-in65.2%
associate-+r+65.2%
metadata-eval65.2%
metadata-eval65.2%
distribute-rgt-neg-in65.2%
metadata-eval65.2%
Simplified65.2%
Taylor expanded in z around inf 63.6%
Final simplification63.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (* z -6.0))))
(if (<= z -2.45e+126)
t_0
(if (<= z -1.8e+98)
(* x (* z 6.0))
(if (<= z -47000.0)
t_0
(if (<= z 3.9e-302)
(* x -3.0)
(if (<= z 1.12e-186)
(* y 4.0)
(if (<= z 8.5e-120)
(* x -3.0)
(if (<= z 0.5) (* y 4.0) (* 6.0 (* x z)))))))))))
double code(double x, double y, double z) {
double t_0 = y * (z * -6.0);
double tmp;
if (z <= -2.45e+126) {
tmp = t_0;
} else if (z <= -1.8e+98) {
tmp = x * (z * 6.0);
} else if (z <= -47000.0) {
tmp = t_0;
} else if (z <= 3.9e-302) {
tmp = x * -3.0;
} else if (z <= 1.12e-186) {
tmp = y * 4.0;
} else if (z <= 8.5e-120) {
tmp = x * -3.0;
} else if (z <= 0.5) {
tmp = y * 4.0;
} else {
tmp = 6.0 * (x * 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) :: t_0
real(8) :: tmp
t_0 = y * (z * (-6.0d0))
if (z <= (-2.45d+126)) then
tmp = t_0
else if (z <= (-1.8d+98)) then
tmp = x * (z * 6.0d0)
else if (z <= (-47000.0d0)) then
tmp = t_0
else if (z <= 3.9d-302) then
tmp = x * (-3.0d0)
else if (z <= 1.12d-186) then
tmp = y * 4.0d0
else if (z <= 8.5d-120) then
tmp = x * (-3.0d0)
else if (z <= 0.5d0) then
tmp = y * 4.0d0
else
tmp = 6.0d0 * (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (z * -6.0);
double tmp;
if (z <= -2.45e+126) {
tmp = t_0;
} else if (z <= -1.8e+98) {
tmp = x * (z * 6.0);
} else if (z <= -47000.0) {
tmp = t_0;
} else if (z <= 3.9e-302) {
tmp = x * -3.0;
} else if (z <= 1.12e-186) {
tmp = y * 4.0;
} else if (z <= 8.5e-120) {
tmp = x * -3.0;
} else if (z <= 0.5) {
tmp = y * 4.0;
} else {
tmp = 6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): t_0 = y * (z * -6.0) tmp = 0 if z <= -2.45e+126: tmp = t_0 elif z <= -1.8e+98: tmp = x * (z * 6.0) elif z <= -47000.0: tmp = t_0 elif z <= 3.9e-302: tmp = x * -3.0 elif z <= 1.12e-186: tmp = y * 4.0 elif z <= 8.5e-120: tmp = x * -3.0 elif z <= 0.5: tmp = y * 4.0 else: tmp = 6.0 * (x * z) return tmp
function code(x, y, z) t_0 = Float64(y * Float64(z * -6.0)) tmp = 0.0 if (z <= -2.45e+126) tmp = t_0; elseif (z <= -1.8e+98) tmp = Float64(x * Float64(z * 6.0)); elseif (z <= -47000.0) tmp = t_0; elseif (z <= 3.9e-302) tmp = Float64(x * -3.0); elseif (z <= 1.12e-186) tmp = Float64(y * 4.0); elseif (z <= 8.5e-120) tmp = Float64(x * -3.0); elseif (z <= 0.5) tmp = Float64(y * 4.0); else tmp = Float64(6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (z * -6.0); tmp = 0.0; if (z <= -2.45e+126) tmp = t_0; elseif (z <= -1.8e+98) tmp = x * (z * 6.0); elseif (z <= -47000.0) tmp = t_0; elseif (z <= 3.9e-302) tmp = x * -3.0; elseif (z <= 1.12e-186) tmp = y * 4.0; elseif (z <= 8.5e-120) tmp = x * -3.0; elseif (z <= 0.5) tmp = y * 4.0; else tmp = 6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.45e+126], t$95$0, If[LessEqual[z, -1.8e+98], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -47000.0], t$95$0, If[LessEqual[z, 3.9e-302], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.12e-186], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 8.5e-120], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(y * 4.0), $MachinePrecision], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(z \cdot -6\right)\\
\mathbf{if}\;z \leq -2.45 \cdot 10^{+126}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{+98}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;z \leq -47000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-302}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-186}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-120}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -2.45e126 or -1.7999999999999999e98 < z < -47000Initial program 99.8%
+-commutative99.8%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 56.7%
Taylor expanded in z around inf 55.4%
if -2.45e126 < z < -1.7999999999999999e98Initial program 100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 86.4%
sub-neg86.4%
distribute-rgt-in86.4%
metadata-eval86.4%
metadata-eval86.4%
distribute-lft-neg-in86.4%
associate-+r+86.4%
metadata-eval86.4%
metadata-eval86.4%
distribute-rgt-neg-in86.4%
metadata-eval86.4%
Simplified86.4%
Taylor expanded in z around inf 86.2%
associate-*r*86.6%
*-commutative86.6%
associate-*r*86.4%
*-commutative86.4%
Simplified86.4%
if -47000 < z < 3.8999999999999999e-302 or 1.12e-186 < z < 8.50000000000000059e-120Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 68.5%
sub-neg68.5%
distribute-rgt-in68.5%
metadata-eval68.5%
metadata-eval68.5%
distribute-lft-neg-in68.5%
associate-+r+68.5%
metadata-eval68.5%
metadata-eval68.5%
distribute-rgt-neg-in68.5%
metadata-eval68.5%
Simplified68.5%
Taylor expanded in z around 0 65.7%
*-commutative65.7%
Simplified65.7%
if 3.8999999999999999e-302 < z < 1.12e-186 or 8.50000000000000059e-120 < z < 0.5Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 99.6%
Taylor expanded in z around 0 98.0%
Taylor expanded in x around 0 64.1%
*-commutative64.1%
Simplified64.1%
if 0.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 65.2%
sub-neg65.2%
distribute-rgt-in65.2%
metadata-eval65.2%
metadata-eval65.2%
distribute-lft-neg-in65.2%
associate-+r+65.2%
metadata-eval65.2%
metadata-eval65.2%
distribute-rgt-neg-in65.2%
metadata-eval65.2%
Simplified65.2%
Taylor expanded in z around inf 63.6%
Final simplification63.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (* z -6.0))))
(if (<= z -8.5e+125)
t_0
(if (<= z -1.9e+98)
(* z (* x 6.0))
(if (<= z -47000.0)
t_0
(if (<= z 9.8e-303)
(* x -3.0)
(if (<= z 8.5e-187)
(* y 4.0)
(if (<= z 1.8e-119)
(* x -3.0)
(if (<= z 0.6) (* y 4.0) (* 6.0 (* x z)))))))))))
double code(double x, double y, double z) {
double t_0 = y * (z * -6.0);
double tmp;
if (z <= -8.5e+125) {
tmp = t_0;
} else if (z <= -1.9e+98) {
tmp = z * (x * 6.0);
} else if (z <= -47000.0) {
tmp = t_0;
} else if (z <= 9.8e-303) {
tmp = x * -3.0;
} else if (z <= 8.5e-187) {
tmp = y * 4.0;
} else if (z <= 1.8e-119) {
tmp = x * -3.0;
} else if (z <= 0.6) {
tmp = y * 4.0;
} else {
tmp = 6.0 * (x * 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) :: t_0
real(8) :: tmp
t_0 = y * (z * (-6.0d0))
if (z <= (-8.5d+125)) then
tmp = t_0
else if (z <= (-1.9d+98)) then
tmp = z * (x * 6.0d0)
else if (z <= (-47000.0d0)) then
tmp = t_0
else if (z <= 9.8d-303) then
tmp = x * (-3.0d0)
else if (z <= 8.5d-187) then
tmp = y * 4.0d0
else if (z <= 1.8d-119) then
tmp = x * (-3.0d0)
else if (z <= 0.6d0) then
tmp = y * 4.0d0
else
tmp = 6.0d0 * (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (z * -6.0);
double tmp;
if (z <= -8.5e+125) {
tmp = t_0;
} else if (z <= -1.9e+98) {
tmp = z * (x * 6.0);
} else if (z <= -47000.0) {
tmp = t_0;
} else if (z <= 9.8e-303) {
tmp = x * -3.0;
} else if (z <= 8.5e-187) {
tmp = y * 4.0;
} else if (z <= 1.8e-119) {
tmp = x * -3.0;
} else if (z <= 0.6) {
tmp = y * 4.0;
} else {
tmp = 6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): t_0 = y * (z * -6.0) tmp = 0 if z <= -8.5e+125: tmp = t_0 elif z <= -1.9e+98: tmp = z * (x * 6.0) elif z <= -47000.0: tmp = t_0 elif z <= 9.8e-303: tmp = x * -3.0 elif z <= 8.5e-187: tmp = y * 4.0 elif z <= 1.8e-119: tmp = x * -3.0 elif z <= 0.6: tmp = y * 4.0 else: tmp = 6.0 * (x * z) return tmp
function code(x, y, z) t_0 = Float64(y * Float64(z * -6.0)) tmp = 0.0 if (z <= -8.5e+125) tmp = t_0; elseif (z <= -1.9e+98) tmp = Float64(z * Float64(x * 6.0)); elseif (z <= -47000.0) tmp = t_0; elseif (z <= 9.8e-303) tmp = Float64(x * -3.0); elseif (z <= 8.5e-187) tmp = Float64(y * 4.0); elseif (z <= 1.8e-119) tmp = Float64(x * -3.0); elseif (z <= 0.6) tmp = Float64(y * 4.0); else tmp = Float64(6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (z * -6.0); tmp = 0.0; if (z <= -8.5e+125) tmp = t_0; elseif (z <= -1.9e+98) tmp = z * (x * 6.0); elseif (z <= -47000.0) tmp = t_0; elseif (z <= 9.8e-303) tmp = x * -3.0; elseif (z <= 8.5e-187) tmp = y * 4.0; elseif (z <= 1.8e-119) tmp = x * -3.0; elseif (z <= 0.6) tmp = y * 4.0; else tmp = 6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.5e+125], t$95$0, If[LessEqual[z, -1.9e+98], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -47000.0], t$95$0, If[LessEqual[z, 9.8e-303], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 8.5e-187], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.8e-119], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.6], N[(y * 4.0), $MachinePrecision], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(z \cdot -6\right)\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{+125}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{+98}:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\mathbf{elif}\;z \leq -47000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{-303}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-187}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-119}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -8.49999999999999974e125 or -1.89999999999999995e98 < z < -47000Initial program 99.8%
+-commutative99.8%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 56.7%
Taylor expanded in z around inf 55.4%
if -8.49999999999999974e125 < z < -1.89999999999999995e98Initial program 100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 99.8%
Taylor expanded in z around inf 100.0%
Taylor expanded in y around 0 86.6%
*-commutative86.6%
Simplified86.6%
if -47000 < z < 9.8e-303 or 8.4999999999999999e-187 < z < 1.8e-119Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 68.5%
sub-neg68.5%
distribute-rgt-in68.5%
metadata-eval68.5%
metadata-eval68.5%
distribute-lft-neg-in68.5%
associate-+r+68.5%
metadata-eval68.5%
metadata-eval68.5%
distribute-rgt-neg-in68.5%
metadata-eval68.5%
Simplified68.5%
Taylor expanded in z around 0 65.7%
*-commutative65.7%
Simplified65.7%
if 9.8e-303 < z < 8.4999999999999999e-187 or 1.8e-119 < z < 0.599999999999999978Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 99.6%
Taylor expanded in z around 0 98.0%
Taylor expanded in x around 0 64.1%
*-commutative64.1%
Simplified64.1%
if 0.599999999999999978 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 65.2%
sub-neg65.2%
distribute-rgt-in65.2%
metadata-eval65.2%
metadata-eval65.2%
distribute-lft-neg-in65.2%
associate-+r+65.2%
metadata-eval65.2%
metadata-eval65.2%
distribute-rgt-neg-in65.2%
metadata-eval65.2%
Simplified65.2%
Taylor expanded in z around inf 63.6%
Final simplification63.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -59000.0)
t_0
(if (<= z 1.35e-302)
(* x -3.0)
(if (<= z 1.2e-186)
(* y 4.0)
(if (<= z 1.3e-119) (* x -3.0) (if (<= z 3.5e+28) (* y 4.0) t_0)))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -59000.0) {
tmp = t_0;
} else if (z <= 1.35e-302) {
tmp = x * -3.0;
} else if (z <= 1.2e-186) {
tmp = y * 4.0;
} else if (z <= 1.3e-119) {
tmp = x * -3.0;
} else if (z <= 3.5e+28) {
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 <= (-59000.0d0)) then
tmp = t_0
else if (z <= 1.35d-302) then
tmp = x * (-3.0d0)
else if (z <= 1.2d-186) then
tmp = y * 4.0d0
else if (z <= 1.3d-119) then
tmp = x * (-3.0d0)
else if (z <= 3.5d+28) 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 <= -59000.0) {
tmp = t_0;
} else if (z <= 1.35e-302) {
tmp = x * -3.0;
} else if (z <= 1.2e-186) {
tmp = y * 4.0;
} else if (z <= 1.3e-119) {
tmp = x * -3.0;
} else if (z <= 3.5e+28) {
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 <= -59000.0: tmp = t_0 elif z <= 1.35e-302: tmp = x * -3.0 elif z <= 1.2e-186: tmp = y * 4.0 elif z <= 1.3e-119: tmp = x * -3.0 elif z <= 3.5e+28: 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 <= -59000.0) tmp = t_0; elseif (z <= 1.35e-302) tmp = Float64(x * -3.0); elseif (z <= 1.2e-186) tmp = Float64(y * 4.0); elseif (z <= 1.3e-119) tmp = Float64(x * -3.0); elseif (z <= 3.5e+28) 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 <= -59000.0) tmp = t_0; elseif (z <= 1.35e-302) tmp = x * -3.0; elseif (z <= 1.2e-186) tmp = y * 4.0; elseif (z <= 1.3e-119) tmp = x * -3.0; elseif (z <= 3.5e+28) 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, -59000.0], t$95$0, If[LessEqual[z, 1.35e-302], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.2e-186], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.3e-119], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.5e+28], 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 -59000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-302}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-186}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-119}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+28}:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -59000 or 3.5e28 < z Initial program 99.8%
+-commutative99.8%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 50.7%
Taylor expanded in z around inf 50.0%
*-commutative50.0%
Simplified50.0%
if -59000 < z < 1.35000000000000003e-302 or 1.20000000000000002e-186 < z < 1.30000000000000006e-119Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 68.5%
sub-neg68.5%
distribute-rgt-in68.5%
metadata-eval68.5%
metadata-eval68.5%
distribute-lft-neg-in68.5%
associate-+r+68.5%
metadata-eval68.5%
metadata-eval68.5%
distribute-rgt-neg-in68.5%
metadata-eval68.5%
Simplified68.5%
Taylor expanded in z around 0 65.7%
*-commutative65.7%
Simplified65.7%
if 1.35000000000000003e-302 < z < 1.20000000000000002e-186 or 1.30000000000000006e-119 < z < 3.5e28Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 99.6%
Taylor expanded in z around 0 92.4%
Taylor expanded in x around 0 60.6%
*-commutative60.6%
Simplified60.6%
Final simplification57.3%
(FPCore (x y z) :precision binary64 (if (<= z -0.46) (* z (* (- y x) -6.0)) (if (<= z 0.5) (+ (* y 4.0) (* x -3.0)) (+ x (* -6.0 (* (- y x) z))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.46) {
tmp = z * ((y - x) * -6.0);
} else if (z <= 0.5) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = x + (-6.0 * ((y - x) * 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 <= (-0.46d0)) then
tmp = z * ((y - x) * (-6.0d0))
else if (z <= 0.5d0) then
tmp = (y * 4.0d0) + (x * (-3.0d0))
else
tmp = x + ((-6.0d0) * ((y - x) * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.46) {
tmp = z * ((y - x) * -6.0);
} else if (z <= 0.5) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = x + (-6.0 * ((y - x) * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.46: tmp = z * ((y - x) * -6.0) elif z <= 0.5: tmp = (y * 4.0) + (x * -3.0) else: tmp = x + (-6.0 * ((y - x) * z)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.46) tmp = Float64(z * Float64(Float64(y - x) * -6.0)); elseif (z <= 0.5) tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); else tmp = Float64(x + Float64(-6.0 * Float64(Float64(y - x) * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.46) tmp = z * ((y - x) * -6.0); elseif (z <= 0.5) tmp = (y * 4.0) + (x * -3.0); else tmp = x + (-6.0 * ((y - x) * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.46], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.5], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.46:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;x + -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\end{array}
\end{array}
if z < -0.46000000000000002Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 98.3%
Taylor expanded in z around inf 95.5%
add-sqr-sqrt48.9%
sqrt-unprod68.3%
swap-sqr68.2%
metadata-eval68.2%
metadata-eval68.2%
swap-sqr68.3%
sqrt-unprod23.3%
add-sqr-sqrt48.7%
metadata-eval48.7%
cancel-sign-sub-inv48.7%
add-sqr-sqrt25.4%
sqrt-unprod68.9%
swap-sqr68.9%
metadata-eval68.9%
metadata-eval68.9%
swap-sqr68.9%
sqrt-unprod46.4%
add-sqr-sqrt95.5%
Applied egg-rr95.5%
distribute-lft-out--95.5%
Simplified95.5%
if -0.46000000000000002 < z < 0.5Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 99.6%
Taylor expanded in z around 0 98.2%
if 0.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 98.1%
Final simplification97.4%
(FPCore (x y z) :precision binary64 (if (or (<= y -2.6e+19) (not (<= y 4.3e-57))) (* y (+ 4.0 (* z -6.0))) (* x (+ -3.0 (* z 6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.6e+19) || !(y <= 4.3e-57)) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = x * (-3.0 + (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 ((y <= (-2.6d+19)) .or. (.not. (y <= 4.3d-57))) then
tmp = y * (4.0d0 + (z * (-6.0d0)))
else
tmp = x * ((-3.0d0) + (z * 6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -2.6e+19) || !(y <= 4.3e-57)) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = x * (-3.0 + (z * 6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.6e+19) or not (y <= 4.3e-57): tmp = y * (4.0 + (z * -6.0)) else: tmp = x * (-3.0 + (z * 6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.6e+19) || !(y <= 4.3e-57)) tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); else tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -2.6e+19) || ~((y <= 4.3e-57))) tmp = y * (4.0 + (z * -6.0)); else tmp = x * (-3.0 + (z * 6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.6e+19], N[Not[LessEqual[y, 4.3e-57]], $MachinePrecision]], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+19} \lor \neg \left(y \leq 4.3 \cdot 10^{-57}\right):\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\end{array}
\end{array}
if y < -2.6e19 or 4.30000000000000022e-57 < y Initial program 99.7%
+-commutative99.7%
associate-*l*99.9%
fma-def99.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 77.7%
if -2.6e19 < y < 4.30000000000000022e-57Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 85.6%
sub-neg85.6%
distribute-rgt-in85.6%
metadata-eval85.6%
metadata-eval85.6%
distribute-lft-neg-in85.6%
associate-+r+85.6%
metadata-eval85.6%
metadata-eval85.6%
distribute-rgt-neg-in85.6%
metadata-eval85.6%
Simplified85.6%
Final simplification81.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.56) (not (<= z 0.58))) (* z (* (- y x) -6.0)) (+ x (* (- y x) 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.56) || !(z <= 0.58)) {
tmp = z * ((y - x) * -6.0);
} else {
tmp = x + ((y - x) * 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 ((z <= (-0.56d0)) .or. (.not. (z <= 0.58d0))) then
tmp = z * ((y - x) * (-6.0d0))
else
tmp = x + ((y - x) * 4.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.56) || !(z <= 0.58)) {
tmp = z * ((y - x) * -6.0);
} else {
tmp = x + ((y - x) * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.56) or not (z <= 0.58): tmp = z * ((y - x) * -6.0) else: tmp = x + ((y - x) * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.56) || !(z <= 0.58)) tmp = Float64(z * Float64(Float64(y - x) * -6.0)); else tmp = Float64(x + Float64(Float64(y - x) * 4.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.56) || ~((z <= 0.58))) tmp = z * ((y - x) * -6.0); else tmp = x + ((y - x) * 4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.56], N[Not[LessEqual[z, 0.58]], $MachinePrecision]], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.56 \lor \neg \left(z \leq 0.58\right):\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\end{array}
\end{array}
if z < -0.56000000000000005 or 0.57999999999999996 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 97.4%
Taylor expanded in z around inf 96.6%
add-sqr-sqrt50.6%
sqrt-unprod65.2%
swap-sqr65.2%
metadata-eval65.2%
metadata-eval65.2%
swap-sqr65.2%
sqrt-unprod19.7%
add-sqr-sqrt42.7%
metadata-eval42.7%
cancel-sign-sub-inv42.7%
add-sqr-sqrt23.1%
sqrt-unprod64.8%
swap-sqr64.8%
metadata-eval64.8%
metadata-eval64.8%
swap-sqr64.8%
sqrt-unprod45.8%
add-sqr-sqrt96.6%
Applied egg-rr96.6%
distribute-lft-out--96.6%
Simplified96.6%
if -0.56000000000000005 < z < 0.57999999999999996Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 98.2%
Final simplification97.4%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.6) (not (<= z 0.58))) (* z (* (- y x) -6.0)) (+ (* y 4.0) (* x -3.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.6) || !(z <= 0.58)) {
tmp = z * ((y - x) * -6.0);
} else {
tmp = (y * 4.0) + (x * -3.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.6d0)) .or. (.not. (z <= 0.58d0))) then
tmp = z * ((y - x) * (-6.0d0))
else
tmp = (y * 4.0d0) + (x * (-3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.6) || !(z <= 0.58)) {
tmp = z * ((y - x) * -6.0);
} else {
tmp = (y * 4.0) + (x * -3.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.6) or not (z <= 0.58): tmp = z * ((y - x) * -6.0) else: tmp = (y * 4.0) + (x * -3.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.6) || !(z <= 0.58)) tmp = Float64(z * Float64(Float64(y - x) * -6.0)); else tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.6) || ~((z <= 0.58))) tmp = z * ((y - x) * -6.0); else tmp = (y * 4.0) + (x * -3.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.6], N[Not[LessEqual[z, 0.58]], $MachinePrecision]], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.6 \lor \neg \left(z \leq 0.58\right):\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\end{array}
\end{array}
if z < -0.599999999999999978 or 0.57999999999999996 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 97.4%
Taylor expanded in z around inf 96.6%
add-sqr-sqrt50.6%
sqrt-unprod65.2%
swap-sqr65.2%
metadata-eval65.2%
metadata-eval65.2%
swap-sqr65.2%
sqrt-unprod19.7%
add-sqr-sqrt42.7%
metadata-eval42.7%
cancel-sign-sub-inv42.7%
add-sqr-sqrt23.1%
sqrt-unprod64.8%
swap-sqr64.8%
metadata-eval64.8%
metadata-eval64.8%
swap-sqr64.8%
sqrt-unprod45.8%
add-sqr-sqrt96.6%
Applied egg-rr96.6%
distribute-lft-out--96.6%
Simplified96.6%
if -0.599999999999999978 < z < 0.57999999999999996Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 99.6%
Taylor expanded in z around 0 98.2%
Final simplification97.4%
(FPCore (x y z) :precision binary64 (if (<= y -7.6e+146) (* y 4.0) (if (<= y 1.52e+183) (* x (+ -3.0 (* z 6.0))) (* -6.0 (* y z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -7.6e+146) {
tmp = y * 4.0;
} else if (y <= 1.52e+183) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = -6.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 (y <= (-7.6d+146)) then
tmp = y * 4.0d0
else if (y <= 1.52d+183) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else
tmp = (-6.0d0) * (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -7.6e+146) {
tmp = y * 4.0;
} else if (y <= 1.52e+183) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = -6.0 * (y * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -7.6e+146: tmp = y * 4.0 elif y <= 1.52e+183: tmp = x * (-3.0 + (z * 6.0)) else: tmp = -6.0 * (y * z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -7.6e+146) tmp = Float64(y * 4.0); elseif (y <= 1.52e+183) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); else tmp = Float64(-6.0 * Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -7.6e+146) tmp = y * 4.0; elseif (y <= 1.52e+183) tmp = x * (-3.0 + (z * 6.0)); else tmp = -6.0 * (y * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -7.6e+146], N[(y * 4.0), $MachinePrecision], If[LessEqual[y, 1.52e+183], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.6 \cdot 10^{+146}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;y \leq 1.52 \cdot 10^{+183}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\end{array}
\end{array}
if y < -7.59999999999999958e146Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 96.8%
Taylor expanded in z around 0 62.5%
Taylor expanded in x around 0 56.9%
*-commutative56.9%
Simplified56.9%
if -7.59999999999999958e146 < y < 1.52000000000000005e183Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 70.7%
sub-neg70.7%
distribute-rgt-in70.7%
metadata-eval70.7%
metadata-eval70.7%
distribute-lft-neg-in70.7%
associate-+r+70.7%
metadata-eval70.7%
metadata-eval70.7%
distribute-rgt-neg-in70.7%
metadata-eval70.7%
Simplified70.7%
if 1.52000000000000005e183 < y Initial program 99.7%
+-commutative99.7%
associate-*l*100.0%
fma-def100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
metadata-eval100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
Taylor expanded in z around inf 61.1%
*-commutative61.1%
Simplified61.1%
Final simplification67.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.8e+19) (not (<= y 7.7e-59))) (* y 4.0) (* x -3.0)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.8e+19) || !(y <= 7.7e-59)) {
tmp = y * 4.0;
} else {
tmp = x * -3.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 ((y <= (-1.8d+19)) .or. (.not. (y <= 7.7d-59))) then
tmp = y * 4.0d0
else
tmp = x * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.8e+19) || !(y <= 7.7e-59)) {
tmp = y * 4.0;
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.8e+19) or not (y <= 7.7e-59): tmp = y * 4.0 else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.8e+19) || !(y <= 7.7e-59)) tmp = Float64(y * 4.0); else tmp = Float64(x * -3.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.8e+19) || ~((y <= 7.7e-59))) tmp = y * 4.0; else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.8e+19], N[Not[LessEqual[y, 7.7e-59]], $MachinePrecision]], N[(y * 4.0), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{+19} \lor \neg \left(y \leq 7.7 \cdot 10^{-59}\right):\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if y < -1.8e19 or 7.7e-59 < y Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 97.5%
Taylor expanded in z around 0 50.6%
Taylor expanded in x around 0 39.4%
*-commutative39.4%
Simplified39.4%
if -1.8e19 < y < 7.7e-59Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 86.0%
sub-neg86.0%
distribute-rgt-in86.0%
metadata-eval86.0%
metadata-eval86.0%
distribute-lft-neg-in86.0%
associate-+r+86.0%
metadata-eval86.0%
metadata-eval86.0%
distribute-rgt-neg-in86.0%
metadata-eval86.0%
Simplified86.0%
Taylor expanded in z around 0 49.0%
*-commutative49.0%
Simplified49.0%
Final simplification44.0%
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- 0.6666666666666666 z))))
double code(double x, double y, double z) {
return x + (((y - x) * 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 + (((y - x) * 6.0d0) * (0.6666666666666666d0 - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * (0.6666666666666666 - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * (0.6666666666666666 - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(0.6666666666666666 - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * (0.6666666666666666 - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(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.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 56.6%
sub-neg56.6%
distribute-rgt-in56.6%
metadata-eval56.6%
metadata-eval56.6%
distribute-lft-neg-in56.6%
associate-+r+56.6%
metadata-eval56.6%
metadata-eval56.6%
distribute-rgt-neg-in56.6%
metadata-eval56.6%
Simplified56.6%
Taylor expanded in z around 0 30.4%
*-commutative30.4%
Simplified30.4%
Final simplification30.4%
(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.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around inf 48.1%
Taylor expanded in z around 0 2.5%
Final simplification2.5%
herbie shell --seed 2024021
(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))))