
(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 15 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) (+ 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 (fma (- y x) (* 6.0 (- 0.6666666666666666 z)) x))
double code(double x, double y, double z) {
return fma((y - x), (6.0 * (0.6666666666666666 - z)), x);
}
function code(x, y, z) return fma(Float64(y - x), Float64(6.0 * Float64(0.6666666666666666 - z)), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(6.0 * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, 6 \cdot \left(0.6666666666666666 - z\right), x\right)
\end{array}
Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-def99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* y (- 0.6666666666666666 z))))
(t_1 (* -6.0 (* (- y x) z))))
(if (<= z -120000000.0)
t_1
(if (<= z 5.4e-221)
t_0
(if (<= z 1.12e-202)
(* x -3.0)
(if (<= z 6.8e-124)
(* y 4.0)
(if (<= z 3.3e-21) (* x -3.0) (if (<= z 5.5e+15) t_0 t_1))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (y * (0.6666666666666666 - z));
double t_1 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -120000000.0) {
tmp = t_1;
} else if (z <= 5.4e-221) {
tmp = t_0;
} else if (z <= 1.12e-202) {
tmp = x * -3.0;
} else if (z <= 6.8e-124) {
tmp = y * 4.0;
} else if (z <= 3.3e-21) {
tmp = x * -3.0;
} else if (z <= 5.5e+15) {
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 * (y * (0.6666666666666666d0 - z))
t_1 = (-6.0d0) * ((y - x) * z)
if (z <= (-120000000.0d0)) then
tmp = t_1
else if (z <= 5.4d-221) then
tmp = t_0
else if (z <= 1.12d-202) then
tmp = x * (-3.0d0)
else if (z <= 6.8d-124) then
tmp = y * 4.0d0
else if (z <= 3.3d-21) then
tmp = x * (-3.0d0)
else if (z <= 5.5d+15) 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 * (y * (0.6666666666666666 - z));
double t_1 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -120000000.0) {
tmp = t_1;
} else if (z <= 5.4e-221) {
tmp = t_0;
} else if (z <= 1.12e-202) {
tmp = x * -3.0;
} else if (z <= 6.8e-124) {
tmp = y * 4.0;
} else if (z <= 3.3e-21) {
tmp = x * -3.0;
} else if (z <= 5.5e+15) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (y * (0.6666666666666666 - z)) t_1 = -6.0 * ((y - x) * z) tmp = 0 if z <= -120000000.0: tmp = t_1 elif z <= 5.4e-221: tmp = t_0 elif z <= 1.12e-202: tmp = x * -3.0 elif z <= 6.8e-124: tmp = y * 4.0 elif z <= 3.3e-21: tmp = x * -3.0 elif z <= 5.5e+15: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))) t_1 = Float64(-6.0 * Float64(Float64(y - x) * z)) tmp = 0.0 if (z <= -120000000.0) tmp = t_1; elseif (z <= 5.4e-221) tmp = t_0; elseif (z <= 1.12e-202) tmp = Float64(x * -3.0); elseif (z <= 6.8e-124) tmp = Float64(y * 4.0); elseif (z <= 3.3e-21) tmp = Float64(x * -3.0); elseif (z <= 5.5e+15) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (y * (0.6666666666666666 - z)); t_1 = -6.0 * ((y - x) * z); tmp = 0.0; if (z <= -120000000.0) tmp = t_1; elseif (z <= 5.4e-221) tmp = t_0; elseif (z <= 1.12e-202) tmp = x * -3.0; elseif (z <= 6.8e-124) tmp = y * 4.0; elseif (z <= 3.3e-21) tmp = x * -3.0; elseif (z <= 5.5e+15) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -120000000.0], t$95$1, If[LessEqual[z, 5.4e-221], t$95$0, If[LessEqual[z, 1.12e-202], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.8e-124], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.3e-21], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 5.5e+15], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
t_1 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -120000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-221}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-202}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-124}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-21}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+15}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.2e8 or 5.5e15 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
+-commutative99.8%
*-commutative99.8%
fma-def99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 99.8%
*-commutative99.8%
Simplified99.8%
if -1.2e8 < z < 5.4e-221 or 3.30000000000000009e-21 < z < 5.5e15Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.3%
Applied egg-rr99.3%
Taylor expanded in y around inf 62.9%
if 5.4e-221 < z < 1.12000000000000009e-202 or 6.8000000000000001e-124 < z < 3.30000000000000009e-21Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 69.1%
sub-neg69.1%
distribute-rgt-in69.1%
metadata-eval69.1%
metadata-eval69.1%
neg-mul-169.1%
associate-*r*69.1%
*-commutative69.1%
distribute-lft-in69.1%
distribute-lft-in69.1%
metadata-eval69.1%
metadata-eval69.1%
associate-+r+69.1%
metadata-eval69.1%
metadata-eval69.1%
associate-*r*69.1%
metadata-eval69.1%
*-commutative69.1%
Simplified69.1%
Taylor expanded in z around 0 69.1%
*-commutative69.1%
Simplified69.1%
if 1.12000000000000009e-202 < z < 6.8000000000000001e-124Initial program 99.4%
+-commutative99.4%
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 74.7%
Taylor expanded in z around 0 74.7%
Final simplification81.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* x z))))
(if (<= z -3.3e+103)
t_0
(if (<= z -58.0)
(* -6.0 (* y z))
(if (<= z 1.05e-220)
(* y 4.0)
(if (<= z 1.05e-202)
(* x -3.0)
(if (<= z 2.25e-123)
(* y 4.0)
(if (<= z 5.5e+15) (* x -3.0) t_0))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -3.3e+103) {
tmp = t_0;
} else if (z <= -58.0) {
tmp = -6.0 * (y * z);
} else if (z <= 1.05e-220) {
tmp = y * 4.0;
} else if (z <= 1.05e-202) {
tmp = x * -3.0;
} else if (z <= 2.25e-123) {
tmp = y * 4.0;
} else if (z <= 5.5e+15) {
tmp = x * -3.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 * (x * z)
if (z <= (-3.3d+103)) then
tmp = t_0
else if (z <= (-58.0d0)) then
tmp = (-6.0d0) * (y * z)
else if (z <= 1.05d-220) then
tmp = y * 4.0d0
else if (z <= 1.05d-202) then
tmp = x * (-3.0d0)
else if (z <= 2.25d-123) then
tmp = y * 4.0d0
else if (z <= 5.5d+15) then
tmp = x * (-3.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 * (x * z);
double tmp;
if (z <= -3.3e+103) {
tmp = t_0;
} else if (z <= -58.0) {
tmp = -6.0 * (y * z);
} else if (z <= 1.05e-220) {
tmp = y * 4.0;
} else if (z <= 1.05e-202) {
tmp = x * -3.0;
} else if (z <= 2.25e-123) {
tmp = y * 4.0;
} else if (z <= 5.5e+15) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (x * z) tmp = 0 if z <= -3.3e+103: tmp = t_0 elif z <= -58.0: tmp = -6.0 * (y * z) elif z <= 1.05e-220: tmp = y * 4.0 elif z <= 1.05e-202: tmp = x * -3.0 elif z <= 2.25e-123: tmp = y * 4.0 elif z <= 5.5e+15: tmp = x * -3.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(x * z)) tmp = 0.0 if (z <= -3.3e+103) tmp = t_0; elseif (z <= -58.0) tmp = Float64(-6.0 * Float64(y * z)); elseif (z <= 1.05e-220) tmp = Float64(y * 4.0); elseif (z <= 1.05e-202) tmp = Float64(x * -3.0); elseif (z <= 2.25e-123) tmp = Float64(y * 4.0); elseif (z <= 5.5e+15) tmp = Float64(x * -3.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (x * z); tmp = 0.0; if (z <= -3.3e+103) tmp = t_0; elseif (z <= -58.0) tmp = -6.0 * (y * z); elseif (z <= 1.05e-220) tmp = y * 4.0; elseif (z <= 1.05e-202) tmp = x * -3.0; elseif (z <= 2.25e-123) tmp = y * 4.0; elseif (z <= 5.5e+15) tmp = x * -3.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.3e+103], t$95$0, If[LessEqual[z, -58.0], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e-220], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.05e-202], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.25e-123], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 5.5e+15], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -3.3 \cdot 10^{+103}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -58:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-220}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-202}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{-123}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+15}:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -3.30000000000000009e103 or 5.5e15 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 57.1%
sub-neg57.1%
distribute-rgt-in57.1%
metadata-eval57.1%
metadata-eval57.1%
neg-mul-157.1%
associate-*r*57.1%
*-commutative57.1%
distribute-lft-in57.1%
distribute-lft-in57.1%
metadata-eval57.1%
metadata-eval57.1%
associate-+r+57.1%
metadata-eval57.1%
metadata-eval57.1%
associate-*r*57.1%
metadata-eval57.1%
*-commutative57.1%
Simplified57.1%
Taylor expanded in z around inf 57.1%
*-commutative57.1%
Simplified57.1%
if -3.30000000000000009e103 < z < -58Initial program 99.6%
+-commutative99.6%
associate-*l*99.5%
fma-def99.5%
sub-neg99.5%
distribute-rgt-in99.5%
metadata-eval99.5%
metadata-eval99.5%
distribute-lft-neg-out99.5%
distribute-rgt-neg-in99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 65.9%
Taylor expanded in z around inf 61.0%
if -58 < z < 1.04999999999999996e-220 or 1.04999999999999993e-202 < z < 2.24999999999999997e-123Initial program 99.5%
+-commutative99.5%
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 62.0%
Taylor expanded in z around 0 59.9%
if 1.04999999999999996e-220 < z < 1.04999999999999993e-202 or 2.24999999999999997e-123 < z < 5.5e15Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 58.7%
sub-neg58.7%
distribute-rgt-in58.7%
metadata-eval58.7%
metadata-eval58.7%
neg-mul-158.7%
associate-*r*58.7%
*-commutative58.7%
distribute-lft-in58.7%
distribute-lft-in58.7%
metadata-eval58.7%
metadata-eval58.7%
associate-+r+58.7%
metadata-eval58.7%
metadata-eval58.7%
associate-*r*58.7%
metadata-eval58.7%
*-commutative58.7%
Simplified58.7%
Taylor expanded in z around 0 57.8%
*-commutative57.8%
Simplified57.8%
Final simplification58.5%
(FPCore (x y z)
:precision binary64
(if (<= z -3.35e+103)
(* 6.0 (* x z))
(if (<= z -58.0)
(* -6.0 (* y z))
(if (<= z 2.95e-220)
(* y 4.0)
(if (<= z 1.05e-202)
(* x -3.0)
(if (<= z 5.4e-124)
(* y 4.0)
(if (<= z 5.5e+15) (* x -3.0) (* x (* z 6.0)))))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.35e+103) {
tmp = 6.0 * (x * z);
} else if (z <= -58.0) {
tmp = -6.0 * (y * z);
} else if (z <= 2.95e-220) {
tmp = y * 4.0;
} else if (z <= 1.05e-202) {
tmp = x * -3.0;
} else if (z <= 5.4e-124) {
tmp = y * 4.0;
} else if (z <= 5.5e+15) {
tmp = x * -3.0;
} else {
tmp = x * (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 <= (-3.35d+103)) then
tmp = 6.0d0 * (x * z)
else if (z <= (-58.0d0)) then
tmp = (-6.0d0) * (y * z)
else if (z <= 2.95d-220) then
tmp = y * 4.0d0
else if (z <= 1.05d-202) then
tmp = x * (-3.0d0)
else if (z <= 5.4d-124) then
tmp = y * 4.0d0
else if (z <= 5.5d+15) then
tmp = x * (-3.0d0)
else
tmp = x * (z * 6.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.35e+103) {
tmp = 6.0 * (x * z);
} else if (z <= -58.0) {
tmp = -6.0 * (y * z);
} else if (z <= 2.95e-220) {
tmp = y * 4.0;
} else if (z <= 1.05e-202) {
tmp = x * -3.0;
} else if (z <= 5.4e-124) {
tmp = y * 4.0;
} else if (z <= 5.5e+15) {
tmp = x * -3.0;
} else {
tmp = x * (z * 6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.35e+103: tmp = 6.0 * (x * z) elif z <= -58.0: tmp = -6.0 * (y * z) elif z <= 2.95e-220: tmp = y * 4.0 elif z <= 1.05e-202: tmp = x * -3.0 elif z <= 5.4e-124: tmp = y * 4.0 elif z <= 5.5e+15: tmp = x * -3.0 else: tmp = x * (z * 6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.35e+103) tmp = Float64(6.0 * Float64(x * z)); elseif (z <= -58.0) tmp = Float64(-6.0 * Float64(y * z)); elseif (z <= 2.95e-220) tmp = Float64(y * 4.0); elseif (z <= 1.05e-202) tmp = Float64(x * -3.0); elseif (z <= 5.4e-124) tmp = Float64(y * 4.0); elseif (z <= 5.5e+15) tmp = Float64(x * -3.0); else tmp = Float64(x * Float64(z * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.35e+103) tmp = 6.0 * (x * z); elseif (z <= -58.0) tmp = -6.0 * (y * z); elseif (z <= 2.95e-220) tmp = y * 4.0; elseif (z <= 1.05e-202) tmp = x * -3.0; elseif (z <= 5.4e-124) tmp = y * 4.0; elseif (z <= 5.5e+15) tmp = x * -3.0; else tmp = x * (z * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.35e+103], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -58.0], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.95e-220], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.05e-202], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 5.4e-124], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 5.5e+15], N[(x * -3.0), $MachinePrecision], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.35 \cdot 10^{+103}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq -58:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq 2.95 \cdot 10^{-220}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-202}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-124}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+15}:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\end{array}
\end{array}
if z < -3.35000000000000017e103Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 62.2%
sub-neg62.2%
distribute-rgt-in62.2%
metadata-eval62.2%
metadata-eval62.2%
neg-mul-162.2%
associate-*r*62.2%
*-commutative62.2%
distribute-lft-in62.2%
distribute-lft-in62.2%
metadata-eval62.2%
metadata-eval62.2%
associate-+r+62.2%
metadata-eval62.2%
metadata-eval62.2%
associate-*r*62.2%
metadata-eval62.2%
*-commutative62.2%
Simplified62.2%
Taylor expanded in z around inf 62.2%
*-commutative62.2%
Simplified62.2%
if -3.35000000000000017e103 < z < -58Initial program 99.6%
+-commutative99.6%
associate-*l*99.5%
fma-def99.5%
sub-neg99.5%
distribute-rgt-in99.5%
metadata-eval99.5%
metadata-eval99.5%
distribute-lft-neg-out99.5%
distribute-rgt-neg-in99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 65.9%
Taylor expanded in z around inf 61.0%
if -58 < z < 2.9499999999999998e-220 or 1.04999999999999993e-202 < z < 5.40000000000000035e-124Initial program 99.5%
+-commutative99.5%
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 62.0%
Taylor expanded in z around 0 59.9%
if 2.9499999999999998e-220 < z < 1.04999999999999993e-202 or 5.40000000000000035e-124 < z < 5.5e15Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 58.7%
sub-neg58.7%
distribute-rgt-in58.7%
metadata-eval58.7%
metadata-eval58.7%
neg-mul-158.7%
associate-*r*58.7%
*-commutative58.7%
distribute-lft-in58.7%
distribute-lft-in58.7%
metadata-eval58.7%
metadata-eval58.7%
associate-+r+58.7%
metadata-eval58.7%
metadata-eval58.7%
associate-*r*58.7%
metadata-eval58.7%
*-commutative58.7%
Simplified58.7%
Taylor expanded in z around 0 57.8%
*-commutative57.8%
Simplified57.8%
if 5.5e15 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 53.3%
sub-neg53.3%
distribute-rgt-in53.3%
metadata-eval53.3%
metadata-eval53.3%
neg-mul-153.3%
associate-*r*53.3%
*-commutative53.3%
distribute-lft-in53.3%
distribute-lft-in53.3%
metadata-eval53.3%
metadata-eval53.3%
associate-+r+53.3%
metadata-eval53.3%
metadata-eval53.3%
associate-*r*53.3%
metadata-eval53.3%
*-commutative53.3%
Simplified53.3%
Taylor expanded in z around inf 53.3%
Final simplification58.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -0.036)
t_0
(if (<= z 5.2e-221)
(* y 4.0)
(if (<= z 7.5e-203)
(* x -3.0)
(if (<= z 8e-124) (* y 4.0) (if (<= z 0.5) (* x -3.0) t_0)))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -0.036) {
tmp = t_0;
} else if (z <= 5.2e-221) {
tmp = y * 4.0;
} else if (z <= 7.5e-203) {
tmp = x * -3.0;
} else if (z <= 8e-124) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.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.036d0)) then
tmp = t_0
else if (z <= 5.2d-221) then
tmp = y * 4.0d0
else if (z <= 7.5d-203) then
tmp = x * (-3.0d0)
else if (z <= 8d-124) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.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.036) {
tmp = t_0;
} else if (z <= 5.2e-221) {
tmp = y * 4.0;
} else if (z <= 7.5e-203) {
tmp = x * -3.0;
} else if (z <= 8e-124) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * ((y - x) * z) tmp = 0 if z <= -0.036: tmp = t_0 elif z <= 5.2e-221: tmp = y * 4.0 elif z <= 7.5e-203: tmp = x * -3.0 elif z <= 8e-124: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.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.036) tmp = t_0; elseif (z <= 5.2e-221) tmp = Float64(y * 4.0); elseif (z <= 7.5e-203) tmp = Float64(x * -3.0); elseif (z <= 8e-124) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.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.036) tmp = t_0; elseif (z <= 5.2e-221) tmp = y * 4.0; elseif (z <= 7.5e-203) tmp = x * -3.0; elseif (z <= 8e-124) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.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.036], t$95$0, If[LessEqual[z, 5.2e-221], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 7.5e-203], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 8e-124], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.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.036:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-221}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-203}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-124}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -0.0359999999999999973 or 0.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
+-commutative99.8%
*-commutative99.8%
fma-def99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 97.5%
*-commutative97.5%
Simplified97.5%
if -0.0359999999999999973 < z < 5.2000000000000004e-221 or 7.50000000000000027e-203 < z < 7.99999999999999947e-124Initial program 99.5%
+-commutative99.5%
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 62.6%
Taylor expanded in z around 0 60.5%
if 5.2000000000000004e-221 < z < 7.50000000000000027e-203 or 7.99999999999999947e-124 < z < 0.5Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 63.1%
sub-neg63.1%
distribute-rgt-in63.1%
metadata-eval63.1%
metadata-eval63.1%
neg-mul-163.1%
associate-*r*63.1%
*-commutative63.1%
distribute-lft-in63.1%
distribute-lft-in63.1%
metadata-eval63.1%
metadata-eval63.1%
associate-+r+63.1%
metadata-eval63.1%
metadata-eval63.1%
associate-*r*63.1%
metadata-eval63.1%
*-commutative63.1%
Simplified63.1%
Taylor expanded in z around 0 61.8%
*-commutative61.8%
Simplified61.8%
Final simplification78.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -58.0)
t_0
(if (<= z 2.6e-220)
(* y 4.0)
(if (<= z 7.5e-203)
(* x -3.0)
(if (<= z 6.4e-124) (* y 4.0) (if (<= z 0.6) (* x -3.0) t_0)))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -58.0) {
tmp = t_0;
} else if (z <= 2.6e-220) {
tmp = y * 4.0;
} else if (z <= 7.5e-203) {
tmp = x * -3.0;
} else if (z <= 6.4e-124) {
tmp = y * 4.0;
} else if (z <= 0.6) {
tmp = x * -3.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 <= (-58.0d0)) then
tmp = t_0
else if (z <= 2.6d-220) then
tmp = y * 4.0d0
else if (z <= 7.5d-203) then
tmp = x * (-3.0d0)
else if (z <= 6.4d-124) then
tmp = y * 4.0d0
else if (z <= 0.6d0) then
tmp = x * (-3.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 <= -58.0) {
tmp = t_0;
} else if (z <= 2.6e-220) {
tmp = y * 4.0;
} else if (z <= 7.5e-203) {
tmp = x * -3.0;
} else if (z <= 6.4e-124) {
tmp = y * 4.0;
} else if (z <= 0.6) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -58.0: tmp = t_0 elif z <= 2.6e-220: tmp = y * 4.0 elif z <= 7.5e-203: tmp = x * -3.0 elif z <= 6.4e-124: tmp = y * 4.0 elif z <= 0.6: tmp = x * -3.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 <= -58.0) tmp = t_0; elseif (z <= 2.6e-220) tmp = Float64(y * 4.0); elseif (z <= 7.5e-203) tmp = Float64(x * -3.0); elseif (z <= 6.4e-124) tmp = Float64(y * 4.0); elseif (z <= 0.6) tmp = Float64(x * -3.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 <= -58.0) tmp = t_0; elseif (z <= 2.6e-220) tmp = y * 4.0; elseif (z <= 7.5e-203) tmp = x * -3.0; elseif (z <= 6.4e-124) tmp = y * 4.0; elseif (z <= 0.6) tmp = x * -3.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, -58.0], t$95$0, If[LessEqual[z, 2.6e-220], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 7.5e-203], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.4e-124], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.6], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -58:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-220}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-203}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-124}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -58 or 0.599999999999999978 < 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.2%
Taylor expanded in z around inf 48.4%
if -58 < z < 2.6e-220 or 7.50000000000000027e-203 < z < 6.40000000000000008e-124Initial program 99.5%
+-commutative99.5%
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 62.0%
Taylor expanded in z around 0 59.9%
if 2.6e-220 < z < 7.50000000000000027e-203 or 6.40000000000000008e-124 < z < 0.599999999999999978Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 63.1%
sub-neg63.1%
distribute-rgt-in63.1%
metadata-eval63.1%
metadata-eval63.1%
neg-mul-163.1%
associate-*r*63.1%
*-commutative63.1%
distribute-lft-in63.1%
distribute-lft-in63.1%
metadata-eval63.1%
metadata-eval63.1%
associate-+r+63.1%
metadata-eval63.1%
metadata-eval63.1%
associate-*r*63.1%
metadata-eval63.1%
*-commutative63.1%
Simplified63.1%
Taylor expanded in z around 0 61.8%
*-commutative61.8%
Simplified61.8%
Final simplification54.6%
(FPCore (x y z) :precision binary64 (if (or (<= y -4e-13) (not (<= y 1.22e-39))) (* 6.0 (* y (- 0.6666666666666666 z))) (* x (+ -3.0 (* z 6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -4e-13) || !(y <= 1.22e-39)) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} 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 <= (-4d-13)) .or. (.not. (y <= 1.22d-39))) then
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
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 <= -4e-13) || !(y <= 1.22e-39)) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = x * (-3.0 + (z * 6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -4e-13) or not (y <= 1.22e-39): tmp = 6.0 * (y * (0.6666666666666666 - z)) else: tmp = x * (-3.0 + (z * 6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -4e-13) || !(y <= 1.22e-39)) tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); 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 <= -4e-13) || ~((y <= 1.22e-39))) tmp = 6.0 * (y * (0.6666666666666666 - z)); else tmp = x * (-3.0 + (z * 6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -4e-13], N[Not[LessEqual[y, 1.22e-39]], $MachinePrecision]], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $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 -4 \cdot 10^{-13} \lor \neg \left(y \leq 1.22 \cdot 10^{-39}\right):\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\end{array}
\end{array}
if y < -4.0000000000000001e-13 or 1.2200000000000001e-39 < y Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
+-commutative99.6%
*-commutative99.6%
fma-def99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 83.9%
if -4.0000000000000001e-13 < y < 1.2200000000000001e-39Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 77.5%
sub-neg77.5%
distribute-rgt-in77.5%
metadata-eval77.5%
metadata-eval77.5%
neg-mul-177.5%
associate-*r*77.5%
*-commutative77.5%
distribute-lft-in77.5%
distribute-lft-in77.5%
metadata-eval77.5%
metadata-eval77.5%
associate-+r+77.5%
metadata-eval77.5%
metadata-eval77.5%
associate-*r*77.5%
metadata-eval77.5%
*-commutative77.5%
Simplified77.5%
Final simplification80.6%
(FPCore (x y z) :precision binary64 (if (or (<= y -2.3e-11) (not (<= y 2.1e-39))) (* 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.3e-11) || !(y <= 2.1e-39)) {
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.3d-11)) .or. (.not. (y <= 2.1d-39))) 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.3e-11) || !(y <= 2.1e-39)) {
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.3e-11) or not (y <= 2.1e-39): 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.3e-11) || !(y <= 2.1e-39)) 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.3e-11) || ~((y <= 2.1e-39))) 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.3e-11], N[Not[LessEqual[y, 2.1e-39]], $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.3 \cdot 10^{-11} \lor \neg \left(y \leq 2.1 \cdot 10^{-39}\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.30000000000000014e-11 or 2.09999999999999993e-39 < y Initial program 99.6%
+-commutative99.6%
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 84.2%
if -2.30000000000000014e-11 < y < 2.09999999999999993e-39Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 77.5%
sub-neg77.5%
distribute-rgt-in77.5%
metadata-eval77.5%
metadata-eval77.5%
neg-mul-177.5%
associate-*r*77.5%
*-commutative77.5%
distribute-lft-in77.5%
distribute-lft-in77.5%
metadata-eval77.5%
metadata-eval77.5%
associate-+r+77.5%
metadata-eval77.5%
metadata-eval77.5%
associate-*r*77.5%
metadata-eval77.5%
*-commutative77.5%
Simplified77.5%
Final simplification80.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.6) (not (<= z 0.6))) (* -6.0 (* (- y x) z)) (+ x (* (- y x) 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.6) || !(z <= 0.6)) {
tmp = -6.0 * ((y - x) * z);
} 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.6d0)) .or. (.not. (z <= 0.6d0))) then
tmp = (-6.0d0) * ((y - x) * z)
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.6) || !(z <= 0.6)) {
tmp = -6.0 * ((y - x) * z);
} else {
tmp = x + ((y - x) * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.6) or not (z <= 0.6): tmp = -6.0 * ((y - x) * z) else: tmp = x + ((y - x) * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.6) || !(z <= 0.6)) tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); 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.6) || ~((z <= 0.6))) tmp = -6.0 * ((y - x) * z); else tmp = x + ((y - x) * 4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.6], N[Not[LessEqual[z, 0.6]], $MachinePrecision]], N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.6 \lor \neg \left(z \leq 0.6\right):\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\end{array}
\end{array}
if z < -0.599999999999999978 or 0.599999999999999978 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
+-commutative99.8%
*-commutative99.8%
fma-def99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 97.5%
*-commutative97.5%
Simplified97.5%
if -0.599999999999999978 < z < 0.599999999999999978Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 97.3%
Final simplification97.4%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.58) (not (<= z 0.5))) (* -6.0 (* (- y x) z)) (+ (* x -3.0) (* y 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.58) || !(z <= 0.5)) {
tmp = -6.0 * ((y - x) * z);
} else {
tmp = (x * -3.0) + (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 ((z <= (-0.58d0)) .or. (.not. (z <= 0.5d0))) then
tmp = (-6.0d0) * ((y - x) * z)
else
tmp = (x * (-3.0d0)) + (y * 4.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.58) || !(z <= 0.5)) {
tmp = -6.0 * ((y - x) * z);
} else {
tmp = (x * -3.0) + (y * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.58) or not (z <= 0.5): tmp = -6.0 * ((y - x) * z) else: tmp = (x * -3.0) + (y * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.58) || !(z <= 0.5)) tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); else tmp = Float64(Float64(x * -3.0) + Float64(y * 4.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.58) || ~((z <= 0.5))) tmp = -6.0 * ((y - x) * z); else tmp = (x * -3.0) + (y * 4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.58], N[Not[LessEqual[z, 0.5]], $MachinePrecision]], N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(N[(x * -3.0), $MachinePrecision] + N[(y * 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.58 \lor \neg \left(z \leq 0.5\right):\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3 + y \cdot 4\\
\end{array}
\end{array}
if z < -0.57999999999999996 or 0.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
+-commutative99.8%
*-commutative99.8%
fma-def99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 97.5%
*-commutative97.5%
Simplified97.5%
if -0.57999999999999996 < z < 0.5Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 99.6%
Taylor expanded in z around 0 97.3%
Final simplification97.4%
(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.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.8e-14) (not (<= y 0.000225))) (* y 4.0) (* x -3.0)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.8e-14) || !(y <= 0.000225)) {
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-14)) .or. (.not. (y <= 0.000225d0))) 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-14) || !(y <= 0.000225)) {
tmp = y * 4.0;
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.8e-14) or not (y <= 0.000225): tmp = y * 4.0 else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.8e-14) || !(y <= 0.000225)) 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-14) || ~((y <= 0.000225))) tmp = y * 4.0; else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.8e-14], N[Not[LessEqual[y, 0.000225]], $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^{-14} \lor \neg \left(y \leq 0.000225\right):\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if y < -1.7999999999999999e-14 or 2.2499999999999999e-4 < y Initial program 99.6%
+-commutative99.6%
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 85.6%
Taylor expanded in z around 0 47.0%
if -1.7999999999999999e-14 < y < 2.2499999999999999e-4Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 75.3%
sub-neg75.3%
distribute-rgt-in75.3%
metadata-eval75.3%
metadata-eval75.3%
neg-mul-175.3%
associate-*r*75.3%
*-commutative75.3%
distribute-lft-in75.3%
distribute-lft-in75.3%
metadata-eval75.3%
metadata-eval75.3%
associate-+r+75.3%
metadata-eval75.3%
metadata-eval75.3%
associate-*r*75.3%
metadata-eval75.3%
*-commutative75.3%
Simplified75.3%
Taylor expanded in z around 0 37.5%
*-commutative37.5%
Simplified37.5%
Final simplification41.9%
(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 49.1%
sub-neg49.1%
distribute-rgt-in49.1%
metadata-eval49.1%
metadata-eval49.1%
neg-mul-149.1%
associate-*r*49.1%
*-commutative49.1%
distribute-lft-in49.1%
distribute-lft-in49.1%
metadata-eval49.1%
metadata-eval49.1%
associate-+r+49.1%
metadata-eval49.1%
metadata-eval49.1%
associate-*r*49.1%
metadata-eval49.1%
*-commutative49.1%
Simplified49.1%
Taylor expanded in z around 0 24.5%
*-commutative24.5%
Simplified24.5%
Final simplification24.5%
(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 y around inf 52.2%
Taylor expanded in x around inf 2.6%
Final simplification2.6%
herbie shell --seed 2023322
(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))))