
(FPCore (x y z) :precision binary64 (* x (- 1.0 (* (- 1.0 y) z))))
double code(double x, double y, double z) {
return x * (1.0 - ((1.0 - y) * 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 * (1.0d0 - ((1.0d0 - y) * z))
end function
public static double code(double x, double y, double z) {
return x * (1.0 - ((1.0 - y) * z));
}
def code(x, y, z): return x * (1.0 - ((1.0 - y) * z))
function code(x, y, z) return Float64(x * Float64(1.0 - Float64(Float64(1.0 - y) * z))) end
function tmp = code(x, y, z) tmp = x * (1.0 - ((1.0 - y) * z)); end
code[x_, y_, z_] := N[(x * N[(1.0 - N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 - \left(1 - y\right) \cdot z\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (* x (- 1.0 (* (- 1.0 y) z))))
double code(double x, double y, double z) {
return x * (1.0 - ((1.0 - y) * 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 * (1.0d0 - ((1.0d0 - y) * z))
end function
public static double code(double x, double y, double z) {
return x * (1.0 - ((1.0 - y) * z));
}
def code(x, y, z): return x * (1.0 - ((1.0 - y) * z))
function code(x, y, z) return Float64(x * Float64(1.0 - Float64(Float64(1.0 - y) * z))) end
function tmp = code(x, y, z) tmp = x * (1.0 - ((1.0 - y) * z)); end
code[x_, y_, z_] := N[(x * N[(1.0 - N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 - \left(1 - y\right) \cdot z\right)
\end{array}
(FPCore (x y z) :precision binary64 (if (<= (- 1.0 y) -15000000000.0) (+ (* (* x z) (+ y -2.0)) (* x (+ 1.0 z))) (fma (* z (+ y -1.0)) x x)))
double code(double x, double y, double z) {
double tmp;
if ((1.0 - y) <= -15000000000.0) {
tmp = ((x * z) * (y + -2.0)) + (x * (1.0 + z));
} else {
tmp = fma((z * (y + -1.0)), x, x);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(1.0 - y) <= -15000000000.0) tmp = Float64(Float64(Float64(x * z) * Float64(y + -2.0)) + Float64(x * Float64(1.0 + z))); else tmp = fma(Float64(z * Float64(y + -1.0)), x, x); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(1.0 - y), $MachinePrecision], -15000000000.0], N[(N[(N[(x * z), $MachinePrecision] * N[(y + -2.0), $MachinePrecision]), $MachinePrecision] + N[(x * N[(1.0 + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(y + -1.0), $MachinePrecision]), $MachinePrecision] * x + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;1 - y \leq -15000000000:\\
\;\;\;\;\left(x \cdot z\right) \cdot \left(y + -2\right) + x \cdot \left(1 + z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot \left(y + -1\right), x, x\right)\\
\end{array}
\end{array}
if (-.f64 1 y) < -1.5e10Initial program 87.9%
*-commutative87.9%
flip--60.8%
associate-*l/60.7%
metadata-eval60.7%
pow260.7%
+-commutative60.7%
fma-define60.7%
Applied egg-rr60.7%
Taylor expanded in y around inf 72.0%
sub-neg72.0%
mul-1-neg72.0%
remove-double-neg72.0%
+-commutative72.0%
*-commutative72.0%
associate-*l*82.5%
*-commutative82.5%
distribute-lft-out98.3%
Simplified98.3%
if -1.5e10 < (-.f64 1 y) Initial program 98.9%
Taylor expanded in z around 0 98.9%
+-commutative98.9%
*-commutative98.9%
fma-define99.0%
sub-neg99.0%
metadata-eval99.0%
Applied egg-rr99.0%
Final simplification98.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (- z))))
(if (<= z -1.0)
t_0
(if (<= z 1.25e-59) x (if (<= z 3.2e+103) (* x (* y z)) t_0)))))
double code(double x, double y, double z) {
double t_0 = x * -z;
double tmp;
if (z <= -1.0) {
tmp = t_0;
} else if (z <= 1.25e-59) {
tmp = x;
} else if (z <= 3.2e+103) {
tmp = x * (y * z);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * -z
if (z <= (-1.0d0)) then
tmp = t_0
else if (z <= 1.25d-59) then
tmp = x
else if (z <= 3.2d+103) then
tmp = x * (y * z)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * -z;
double tmp;
if (z <= -1.0) {
tmp = t_0;
} else if (z <= 1.25e-59) {
tmp = x;
} else if (z <= 3.2e+103) {
tmp = x * (y * z);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * -z tmp = 0 if z <= -1.0: tmp = t_0 elif z <= 1.25e-59: tmp = x elif z <= 3.2e+103: tmp = x * (y * z) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(-z)) tmp = 0.0 if (z <= -1.0) tmp = t_0; elseif (z <= 1.25e-59) tmp = x; elseif (z <= 3.2e+103) tmp = Float64(x * Float64(y * z)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * -z; tmp = 0.0; if (z <= -1.0) tmp = t_0; elseif (z <= 1.25e-59) tmp = x; elseif (z <= 3.2e+103) tmp = x * (y * z); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * (-z)), $MachinePrecision]}, If[LessEqual[z, -1.0], t$95$0, If[LessEqual[z, 1.25e-59], x, If[LessEqual[z, 3.2e+103], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(-z\right)\\
\mathbf{if}\;z \leq -1:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-59}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+103}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1 or 3.19999999999999993e103 < z Initial program 92.3%
Taylor expanded in z around inf 90.2%
Taylor expanded in y around 0 57.6%
mul-1-neg57.6%
distribute-rgt-neg-in57.6%
Simplified57.6%
if -1 < z < 1.25e-59Initial program 100.0%
Taylor expanded in z around 0 82.8%
if 1.25e-59 < z < 3.19999999999999993e103Initial program 99.8%
Taylor expanded in y around inf 59.3%
*-commutative59.3%
Simplified59.3%
Final simplification67.8%
(FPCore (x y z) :precision binary64 (if (<= (- 1.0 y) -15000000000.0) (+ (* (* x z) (+ y -2.0)) (* x (+ 1.0 z))) (+ x (* x (* z (+ y -1.0))))))
double code(double x, double y, double z) {
double tmp;
if ((1.0 - y) <= -15000000000.0) {
tmp = ((x * z) * (y + -2.0)) + (x * (1.0 + z));
} else {
tmp = x + (x * (z * (y + -1.0)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((1.0d0 - y) <= (-15000000000.0d0)) then
tmp = ((x * z) * (y + (-2.0d0))) + (x * (1.0d0 + z))
else
tmp = x + (x * (z * (y + (-1.0d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((1.0 - y) <= -15000000000.0) {
tmp = ((x * z) * (y + -2.0)) + (x * (1.0 + z));
} else {
tmp = x + (x * (z * (y + -1.0)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (1.0 - y) <= -15000000000.0: tmp = ((x * z) * (y + -2.0)) + (x * (1.0 + z)) else: tmp = x + (x * (z * (y + -1.0))) return tmp
function code(x, y, z) tmp = 0.0 if (Float64(1.0 - y) <= -15000000000.0) tmp = Float64(Float64(Float64(x * z) * Float64(y + -2.0)) + Float64(x * Float64(1.0 + z))); else tmp = Float64(x + Float64(x * Float64(z * Float64(y + -1.0)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((1.0 - y) <= -15000000000.0) tmp = ((x * z) * (y + -2.0)) + (x * (1.0 + z)); else tmp = x + (x * (z * (y + -1.0))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[(1.0 - y), $MachinePrecision], -15000000000.0], N[(N[(N[(x * z), $MachinePrecision] * N[(y + -2.0), $MachinePrecision]), $MachinePrecision] + N[(x * N[(1.0 + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(x * N[(z * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;1 - y \leq -15000000000:\\
\;\;\;\;\left(x \cdot z\right) \cdot \left(y + -2\right) + x \cdot \left(1 + z\right)\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot \left(z \cdot \left(y + -1\right)\right)\\
\end{array}
\end{array}
if (-.f64 1 y) < -1.5e10Initial program 87.9%
*-commutative87.9%
flip--60.8%
associate-*l/60.7%
metadata-eval60.7%
pow260.7%
+-commutative60.7%
fma-define60.7%
Applied egg-rr60.7%
Taylor expanded in y around inf 72.0%
sub-neg72.0%
mul-1-neg72.0%
remove-double-neg72.0%
+-commutative72.0%
*-commutative72.0%
associate-*l*82.5%
*-commutative82.5%
distribute-lft-out98.3%
Simplified98.3%
if -1.5e10 < (-.f64 1 y) Initial program 98.9%
Taylor expanded in z around 0 98.9%
Final simplification98.8%
(FPCore (x y z) :precision binary64 (if (<= (* (- 1.0 y) z) -5e+73) (* (* x z) (+ y -1.0)) (* x (+ 1.0 (* z (+ y -1.0))))))
double code(double x, double y, double z) {
double tmp;
if (((1.0 - y) * z) <= -5e+73) {
tmp = (x * z) * (y + -1.0);
} else {
tmp = x * (1.0 + (z * (y + -1.0)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (((1.0d0 - y) * z) <= (-5d+73)) then
tmp = (x * z) * (y + (-1.0d0))
else
tmp = x * (1.0d0 + (z * (y + (-1.0d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (((1.0 - y) * z) <= -5e+73) {
tmp = (x * z) * (y + -1.0);
} else {
tmp = x * (1.0 + (z * (y + -1.0)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if ((1.0 - y) * z) <= -5e+73: tmp = (x * z) * (y + -1.0) else: tmp = x * (1.0 + (z * (y + -1.0))) return tmp
function code(x, y, z) tmp = 0.0 if (Float64(Float64(1.0 - y) * z) <= -5e+73) tmp = Float64(Float64(x * z) * Float64(y + -1.0)); else tmp = Float64(x * Float64(1.0 + Float64(z * Float64(y + -1.0)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (((1.0 - y) * z) <= -5e+73) tmp = (x * z) * (y + -1.0); else tmp = x * (1.0 + (z * (y + -1.0))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], -5e+73], N[(N[(x * z), $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 + N[(z * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(1 - y\right) \cdot z \leq -5 \cdot 10^{+73}:\\
\;\;\;\;\left(x \cdot z\right) \cdot \left(y + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + z \cdot \left(y + -1\right)\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 1 y) z) < -4.99999999999999976e73Initial program 91.2%
Taylor expanded in z around 0 91.2%
+-commutative91.2%
*-commutative91.2%
fma-define91.2%
sub-neg91.2%
metadata-eval91.2%
Applied egg-rr91.2%
Taylor expanded in z around inf 91.2%
*-commutative91.2%
sub-neg91.2%
metadata-eval91.2%
associate-*r*98.4%
*-commutative98.4%
associate-*l*99.9%
Simplified99.9%
if -4.99999999999999976e73 < (*.f64 (-.f64 1 y) z) Initial program 97.9%
Final simplification98.4%
(FPCore (x y z) :precision binary64 (if (or (<= z -170000.0) (not (<= z 3.8e-60))) (* x (* z (+ y -1.0))) (- x (* x z))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -170000.0) || !(z <= 3.8e-60)) {
tmp = x * (z * (y + -1.0));
} else {
tmp = x - (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 <= (-170000.0d0)) .or. (.not. (z <= 3.8d-60))) then
tmp = x * (z * (y + (-1.0d0)))
else
tmp = x - (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -170000.0) || !(z <= 3.8e-60)) {
tmp = x * (z * (y + -1.0));
} else {
tmp = x - (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -170000.0) or not (z <= 3.8e-60): tmp = x * (z * (y + -1.0)) else: tmp = x - (x * z) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -170000.0) || !(z <= 3.8e-60)) tmp = Float64(x * Float64(z * Float64(y + -1.0))); else tmp = Float64(x - Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -170000.0) || ~((z <= 3.8e-60))) tmp = x * (z * (y + -1.0)); else tmp = x - (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -170000.0], N[Not[LessEqual[z, 3.8e-60]], $MachinePrecision]], N[(x * N[(z * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -170000 \lor \neg \left(z \leq 3.8 \cdot 10^{-60}\right):\\
\;\;\;\;x \cdot \left(z \cdot \left(y + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot z\\
\end{array}
\end{array}
if z < -1.7e5 or 3.79999999999999994e-60 < z Initial program 93.6%
Taylor expanded in z around inf 89.6%
if -1.7e5 < z < 3.79999999999999994e-60Initial program 100.0%
Taylor expanded in z around 0 100.0%
Taylor expanded in y around 0 82.6%
mul-1-neg5.0%
distribute-rgt-neg-in5.0%
Simplified82.6%
Final simplification86.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -170000.0) (not (<= z 0.00045))) (* z (* x (+ y -1.0))) (- x (* x z))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -170000.0) || !(z <= 0.00045)) {
tmp = z * (x * (y + -1.0));
} else {
tmp = x - (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 <= (-170000.0d0)) .or. (.not. (z <= 0.00045d0))) then
tmp = z * (x * (y + (-1.0d0)))
else
tmp = x - (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -170000.0) || !(z <= 0.00045)) {
tmp = z * (x * (y + -1.0));
} else {
tmp = x - (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -170000.0) or not (z <= 0.00045): tmp = z * (x * (y + -1.0)) else: tmp = x - (x * z) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -170000.0) || !(z <= 0.00045)) tmp = Float64(z * Float64(x * Float64(y + -1.0))); else tmp = Float64(x - Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -170000.0) || ~((z <= 0.00045))) tmp = z * (x * (y + -1.0)); else tmp = x - (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -170000.0], N[Not[LessEqual[z, 0.00045]], $MachinePrecision]], N[(z * N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -170000 \lor \neg \left(z \leq 0.00045\right):\\
\;\;\;\;z \cdot \left(x \cdot \left(y + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot z\\
\end{array}
\end{array}
if z < -1.7e5 or 4.4999999999999999e-4 < z Initial program 93.1%
Taylor expanded in z around inf 92.6%
*-commutative92.6%
associate-*l*99.4%
sub-neg99.4%
remove-double-neg99.4%
distribute-neg-in99.4%
+-commutative99.4%
sub-neg99.4%
distribute-lft-neg-out99.4%
*-commutative99.4%
distribute-rgt-neg-out99.4%
neg-sub099.4%
associate--r-99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
if -1.7e5 < z < 4.4999999999999999e-4Initial program 99.9%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around 0 79.2%
mul-1-neg4.9%
distribute-rgt-neg-in4.9%
Simplified79.2%
Final simplification90.2%
(FPCore (x y z) :precision binary64 (if (<= z -210000.0) (* z (* x (+ y -1.0))) (if (<= z 1.08e-5) (- x (* x z)) (* z (- (* y x) x)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -210000.0) {
tmp = z * (x * (y + -1.0));
} else if (z <= 1.08e-5) {
tmp = x - (x * z);
} else {
tmp = z * ((y * x) - x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-210000.0d0)) then
tmp = z * (x * (y + (-1.0d0)))
else if (z <= 1.08d-5) then
tmp = x - (x * z)
else
tmp = z * ((y * x) - x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -210000.0) {
tmp = z * (x * (y + -1.0));
} else if (z <= 1.08e-5) {
tmp = x - (x * z);
} else {
tmp = z * ((y * x) - x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -210000.0: tmp = z * (x * (y + -1.0)) elif z <= 1.08e-5: tmp = x - (x * z) else: tmp = z * ((y * x) - x) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -210000.0) tmp = Float64(z * Float64(x * Float64(y + -1.0))); elseif (z <= 1.08e-5) tmp = Float64(x - Float64(x * z)); else tmp = Float64(z * Float64(Float64(y * x) - x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -210000.0) tmp = z * (x * (y + -1.0)); elseif (z <= 1.08e-5) tmp = x - (x * z); else tmp = z * ((y * x) - x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -210000.0], N[(z * N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.08e-5], N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y * x), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -210000:\\
\;\;\;\;z \cdot \left(x \cdot \left(y + -1\right)\right)\\
\mathbf{elif}\;z \leq 1.08 \cdot 10^{-5}:\\
\;\;\;\;x - x \cdot z\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot x - x\right)\\
\end{array}
\end{array}
if z < -2.1e5Initial program 94.6%
Taylor expanded in z around inf 93.7%
*-commutative93.7%
associate-*l*99.0%
sub-neg99.0%
remove-double-neg99.0%
distribute-neg-in99.0%
+-commutative99.0%
sub-neg99.0%
distribute-lft-neg-out99.0%
*-commutative99.0%
distribute-rgt-neg-out99.0%
neg-sub099.0%
associate--r-99.0%
metadata-eval99.0%
+-commutative99.0%
Simplified99.0%
if -2.1e5 < z < 1.07999999999999999e-5Initial program 99.9%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around 0 79.2%
mul-1-neg4.9%
distribute-rgt-neg-in4.9%
Simplified79.2%
if 1.07999999999999999e-5 < z Initial program 91.5%
Taylor expanded in z around inf 91.5%
*-commutative91.5%
associate-*l*99.8%
sub-neg99.8%
remove-double-neg99.8%
distribute-neg-in99.8%
+-commutative99.8%
sub-neg99.8%
distribute-lft-neg-out99.8%
*-commutative99.8%
distribute-rgt-neg-out99.8%
neg-sub099.8%
associate--r-99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
distribute-rgt-in99.9%
mul-1-neg99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 99.9%
Final simplification90.2%
(FPCore (x y z) :precision binary64 (if (<= z -130000.0) (* (* x z) (+ y -1.0)) (if (<= z 1.35e-6) (- x (* x z)) (* z (- (* y x) x)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -130000.0) {
tmp = (x * z) * (y + -1.0);
} else if (z <= 1.35e-6) {
tmp = x - (x * z);
} else {
tmp = z * ((y * x) - x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-130000.0d0)) then
tmp = (x * z) * (y + (-1.0d0))
else if (z <= 1.35d-6) then
tmp = x - (x * z)
else
tmp = z * ((y * x) - x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -130000.0) {
tmp = (x * z) * (y + -1.0);
} else if (z <= 1.35e-6) {
tmp = x - (x * z);
} else {
tmp = z * ((y * x) - x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -130000.0: tmp = (x * z) * (y + -1.0) elif z <= 1.35e-6: tmp = x - (x * z) else: tmp = z * ((y * x) - x) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -130000.0) tmp = Float64(Float64(x * z) * Float64(y + -1.0)); elseif (z <= 1.35e-6) tmp = Float64(x - Float64(x * z)); else tmp = Float64(z * Float64(Float64(y * x) - x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -130000.0) tmp = (x * z) * (y + -1.0); elseif (z <= 1.35e-6) tmp = x - (x * z); else tmp = z * ((y * x) - x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -130000.0], N[(N[(x * z), $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.35e-6], N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y * x), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -130000:\\
\;\;\;\;\left(x \cdot z\right) \cdot \left(y + -1\right)\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-6}:\\
\;\;\;\;x - x \cdot z\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot x - x\right)\\
\end{array}
\end{array}
if z < -1.3e5Initial program 94.6%
Taylor expanded in z around 0 94.6%
+-commutative94.6%
*-commutative94.6%
fma-define94.6%
sub-neg94.6%
metadata-eval94.6%
Applied egg-rr94.6%
Taylor expanded in z around inf 93.7%
*-commutative93.7%
sub-neg93.7%
metadata-eval93.7%
associate-*r*99.0%
*-commutative99.0%
associate-*l*99.0%
Simplified99.0%
if -1.3e5 < z < 1.34999999999999999e-6Initial program 99.9%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around 0 79.2%
mul-1-neg4.9%
distribute-rgt-neg-in4.9%
Simplified79.2%
if 1.34999999999999999e-6 < z Initial program 91.5%
Taylor expanded in z around inf 91.5%
*-commutative91.5%
associate-*l*99.8%
sub-neg99.8%
remove-double-neg99.8%
distribute-neg-in99.8%
+-commutative99.8%
sub-neg99.8%
distribute-lft-neg-out99.8%
*-commutative99.8%
distribute-rgt-neg-out99.8%
neg-sub099.8%
associate--r-99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
distribute-rgt-in99.9%
mul-1-neg99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 99.9%
Final simplification90.2%
(FPCore (x y z) :precision binary64 (if (<= z -1.15) (* (* x z) (+ y -1.0)) (if (<= z 1.0) (+ x (* x (* y z))) (* z (- (* y x) x)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.15) {
tmp = (x * z) * (y + -1.0);
} else if (z <= 1.0) {
tmp = x + (x * (y * z));
} else {
tmp = z * ((y * x) - x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.15d0)) then
tmp = (x * z) * (y + (-1.0d0))
else if (z <= 1.0d0) then
tmp = x + (x * (y * z))
else
tmp = z * ((y * x) - x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.15) {
tmp = (x * z) * (y + -1.0);
} else if (z <= 1.0) {
tmp = x + (x * (y * z));
} else {
tmp = z * ((y * x) - x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.15: tmp = (x * z) * (y + -1.0) elif z <= 1.0: tmp = x + (x * (y * z)) else: tmp = z * ((y * x) - x) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.15) tmp = Float64(Float64(x * z) * Float64(y + -1.0)); elseif (z <= 1.0) tmp = Float64(x + Float64(x * Float64(y * z))); else tmp = Float64(z * Float64(Float64(y * x) - x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.15) tmp = (x * z) * (y + -1.0); elseif (z <= 1.0) tmp = x + (x * (y * z)); else tmp = z * ((y * x) - x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.15], N[(N[(x * z), $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(x + N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y * x), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15:\\
\;\;\;\;\left(x \cdot z\right) \cdot \left(y + -1\right)\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x + x \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot x - x\right)\\
\end{array}
\end{array}
if z < -1.1499999999999999Initial program 94.9%
Taylor expanded in z around 0 94.9%
+-commutative94.9%
*-commutative94.9%
fma-define94.9%
sub-neg94.9%
metadata-eval94.9%
Applied egg-rr94.9%
Taylor expanded in z around inf 91.5%
*-commutative91.5%
sub-neg91.5%
metadata-eval91.5%
associate-*r*96.5%
*-commutative96.5%
associate-*l*96.6%
Simplified96.6%
if -1.1499999999999999 < z < 1Initial program 99.9%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around inf 99.2%
*-commutative99.2%
Simplified99.2%
if 1 < z Initial program 91.4%
Taylor expanded in z around inf 91.4%
*-commutative91.4%
associate-*l*99.8%
sub-neg99.8%
remove-double-neg99.8%
distribute-neg-in99.8%
+-commutative99.8%
sub-neg99.8%
distribute-lft-neg-out99.8%
*-commutative99.8%
distribute-rgt-neg-out99.8%
neg-sub099.8%
associate--r-99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
distribute-rgt-in99.9%
mul-1-neg99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 99.9%
Final simplification98.6%
(FPCore (x y z) :precision binary64 (if (<= z -1.0) (* (* x z) (+ y -1.0)) (if (<= z 1.0) (* x (+ 1.0 (* y z))) (* z (- (* y x) x)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (x * z) * (y + -1.0);
} else if (z <= 1.0) {
tmp = x * (1.0 + (y * z));
} else {
tmp = z * ((y * x) - x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.0d0)) then
tmp = (x * z) * (y + (-1.0d0))
else if (z <= 1.0d0) then
tmp = x * (1.0d0 + (y * z))
else
tmp = z * ((y * x) - x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (x * z) * (y + -1.0);
} else if (z <= 1.0) {
tmp = x * (1.0 + (y * z));
} else {
tmp = z * ((y * x) - x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.0: tmp = (x * z) * (y + -1.0) elif z <= 1.0: tmp = x * (1.0 + (y * z)) else: tmp = z * ((y * x) - x) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(x * z) * Float64(y + -1.0)); elseif (z <= 1.0) tmp = Float64(x * Float64(1.0 + Float64(y * z))); else tmp = Float64(z * Float64(Float64(y * x) - x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.0) tmp = (x * z) * (y + -1.0); elseif (z <= 1.0) tmp = x * (1.0 + (y * z)); else tmp = z * ((y * x) - x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.0], N[(N[(x * z), $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(x * N[(1.0 + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y * x), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\left(x \cdot z\right) \cdot \left(y + -1\right)\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x \cdot \left(1 + y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot x - x\right)\\
\end{array}
\end{array}
if z < -1Initial program 94.9%
Taylor expanded in z around 0 94.9%
+-commutative94.9%
*-commutative94.9%
fma-define94.9%
sub-neg94.9%
metadata-eval94.9%
Applied egg-rr94.9%
Taylor expanded in z around inf 91.5%
*-commutative91.5%
sub-neg91.5%
metadata-eval91.5%
associate-*r*96.5%
*-commutative96.5%
associate-*l*96.6%
Simplified96.6%
if -1 < z < 1Initial program 99.9%
Taylor expanded in y around inf 99.3%
mul-1-neg99.3%
distribute-lft-neg-out99.3%
*-commutative99.3%
Simplified99.3%
if 1 < z Initial program 91.4%
Taylor expanded in z around inf 91.4%
*-commutative91.4%
associate-*l*99.8%
sub-neg99.8%
remove-double-neg99.8%
distribute-neg-in99.8%
+-commutative99.8%
sub-neg99.8%
distribute-lft-neg-out99.8%
*-commutative99.8%
distribute-rgt-neg-out99.8%
neg-sub099.8%
associate--r-99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
distribute-rgt-in99.9%
mul-1-neg99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 99.9%
Final simplification98.6%
(FPCore (x y z) :precision binary64 (if (or (<= y -8e+83) (not (<= y 4.8e+14))) (* x (* y z)) (* x (- 1.0 z))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -8e+83) || !(y <= 4.8e+14)) {
tmp = x * (y * z);
} else {
tmp = x * (1.0 - 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 <= (-8d+83)) .or. (.not. (y <= 4.8d+14))) then
tmp = x * (y * z)
else
tmp = x * (1.0d0 - z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -8e+83) || !(y <= 4.8e+14)) {
tmp = x * (y * z);
} else {
tmp = x * (1.0 - z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -8e+83) or not (y <= 4.8e+14): tmp = x * (y * z) else: tmp = x * (1.0 - z) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -8e+83) || !(y <= 4.8e+14)) tmp = Float64(x * Float64(y * z)); else tmp = Float64(x * Float64(1.0 - z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -8e+83) || ~((y <= 4.8e+14))) tmp = x * (y * z); else tmp = x * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -8e+83], N[Not[LessEqual[y, 4.8e+14]], $MachinePrecision]], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{+83} \lor \neg \left(y \leq 4.8 \cdot 10^{+14}\right):\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if y < -8.00000000000000025e83 or 4.8e14 < y Initial program 92.4%
Taylor expanded in y around inf 72.5%
*-commutative72.5%
Simplified72.5%
if -8.00000000000000025e83 < y < 4.8e14Initial program 98.7%
Taylor expanded in y around 0 92.1%
Final simplification84.5%
(FPCore (x y z) :precision binary64 (if (<= y -2.3e+83) (* x (* y z)) (if (<= y 15000000000.0) (* x (- 1.0 z)) (* y (* x z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.3e+83) {
tmp = x * (y * z);
} else if (y <= 15000000000.0) {
tmp = x * (1.0 - z);
} else {
tmp = 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 (y <= (-2.3d+83)) then
tmp = x * (y * z)
else if (y <= 15000000000.0d0) then
tmp = x * (1.0d0 - z)
else
tmp = y * (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.3e+83) {
tmp = x * (y * z);
} else if (y <= 15000000000.0) {
tmp = x * (1.0 - z);
} else {
tmp = y * (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.3e+83: tmp = x * (y * z) elif y <= 15000000000.0: tmp = x * (1.0 - z) else: tmp = y * (x * z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.3e+83) tmp = Float64(x * Float64(y * z)); elseif (y <= 15000000000.0) tmp = Float64(x * Float64(1.0 - z)); else tmp = Float64(y * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.3e+83) tmp = x * (y * z); elseif (y <= 15000000000.0) tmp = x * (1.0 - z); else tmp = y * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.3e+83], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 15000000000.0], N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+83}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;y \leq 15000000000:\\
\;\;\;\;x \cdot \left(1 - z\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if y < -2.29999999999999995e83Initial program 95.2%
Taylor expanded in y around inf 82.2%
*-commutative82.2%
Simplified82.2%
if -2.29999999999999995e83 < y < 1.5e10Initial program 99.9%
Taylor expanded in y around 0 93.3%
if 1.5e10 < y Initial program 87.9%
Taylor expanded in z around 0 87.9%
+-commutative87.9%
*-commutative87.9%
fma-define87.9%
sub-neg87.9%
metadata-eval87.9%
Applied egg-rr87.9%
Taylor expanded in y around inf 63.1%
*-commutative63.1%
associate-*r*73.0%
*-commutative73.0%
Simplified73.0%
Final simplification86.6%
(FPCore (x y z) :precision binary64 (if (<= y -1.7e+88) (* x (* y z)) (if (<= y 15500000000.0) (- x (* x z)) (* y (* x z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.7e+88) {
tmp = x * (y * z);
} else if (y <= 15500000000.0) {
tmp = x - (x * z);
} else {
tmp = 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 (y <= (-1.7d+88)) then
tmp = x * (y * z)
else if (y <= 15500000000.0d0) then
tmp = x - (x * z)
else
tmp = y * (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.7e+88) {
tmp = x * (y * z);
} else if (y <= 15500000000.0) {
tmp = x - (x * z);
} else {
tmp = y * (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.7e+88: tmp = x * (y * z) elif y <= 15500000000.0: tmp = x - (x * z) else: tmp = y * (x * z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.7e+88) tmp = Float64(x * Float64(y * z)); elseif (y <= 15500000000.0) tmp = Float64(x - Float64(x * z)); else tmp = Float64(y * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.7e+88) tmp = x * (y * z); elseif (y <= 15500000000.0) tmp = x - (x * z); else tmp = y * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.7e+88], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 15500000000.0], N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision], N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{+88}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;y \leq 15500000000:\\
\;\;\;\;x - x \cdot z\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if y < -1.70000000000000002e88Initial program 95.2%
Taylor expanded in y around inf 82.2%
*-commutative82.2%
Simplified82.2%
if -1.70000000000000002e88 < y < 1.55e10Initial program 99.9%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around 0 93.3%
mul-1-neg49.1%
distribute-rgt-neg-in49.1%
Simplified93.3%
if 1.55e10 < y Initial program 87.9%
Taylor expanded in z around 0 87.9%
+-commutative87.9%
*-commutative87.9%
fma-define87.9%
sub-neg87.9%
metadata-eval87.9%
Applied egg-rr87.9%
Taylor expanded in y around inf 63.1%
*-commutative63.1%
associate-*r*73.0%
*-commutative73.0%
Simplified73.0%
Final simplification86.6%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.0))) (* x (- z)) x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = x * -z;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = x * -z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = x * -z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 1.0): tmp = x * -z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.0)) tmp = Float64(x * Float64(-z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.0) || ~((z <= 1.0))) tmp = x * -z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x * (-z)), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 93.2%
Taylor expanded in z around inf 91.5%
Taylor expanded in y around 0 54.5%
mul-1-neg54.5%
distribute-rgt-neg-in54.5%
Simplified54.5%
if -1 < z < 1Initial program 99.9%
Taylor expanded in z around 0 78.0%
Final simplification65.0%
(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 96.2%
Taylor expanded in z around 0 36.6%
Final simplification36.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (- 1.0 (* (- 1.0 y) z))))
(t_1 (+ x (* (- 1.0 y) (* (- z) x)))))
(if (< t_0 -1.618195973607049e+50)
t_1
(if (< t_0 3.892237649663903e+134) (- (* (* x y) z) (- (* x z) x)) t_1))))
double code(double x, double y, double z) {
double t_0 = x * (1.0 - ((1.0 - y) * z));
double t_1 = x + ((1.0 - y) * (-z * x));
double tmp;
if (t_0 < -1.618195973607049e+50) {
tmp = t_1;
} else if (t_0 < 3.892237649663903e+134) {
tmp = ((x * y) * z) - ((x * z) - x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x * (1.0d0 - ((1.0d0 - y) * z))
t_1 = x + ((1.0d0 - y) * (-z * x))
if (t_0 < (-1.618195973607049d+50)) then
tmp = t_1
else if (t_0 < 3.892237649663903d+134) then
tmp = ((x * y) * z) - ((x * z) - x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (1.0 - ((1.0 - y) * z));
double t_1 = x + ((1.0 - y) * (-z * x));
double tmp;
if (t_0 < -1.618195973607049e+50) {
tmp = t_1;
} else if (t_0 < 3.892237649663903e+134) {
tmp = ((x * y) * z) - ((x * z) - x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = x * (1.0 - ((1.0 - y) * z)) t_1 = x + ((1.0 - y) * (-z * x)) tmp = 0 if t_0 < -1.618195973607049e+50: tmp = t_1 elif t_0 < 3.892237649663903e+134: tmp = ((x * y) * z) - ((x * z) - x) else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(1.0 - Float64(Float64(1.0 - y) * z))) t_1 = Float64(x + Float64(Float64(1.0 - y) * Float64(Float64(-z) * x))) tmp = 0.0 if (t_0 < -1.618195973607049e+50) tmp = t_1; elseif (t_0 < 3.892237649663903e+134) tmp = Float64(Float64(Float64(x * y) * z) - Float64(Float64(x * z) - x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (1.0 - ((1.0 - y) * z)); t_1 = x + ((1.0 - y) * (-z * x)); tmp = 0.0; if (t_0 < -1.618195973607049e+50) tmp = t_1; elseif (t_0 < 3.892237649663903e+134) tmp = ((x * y) * z) - ((x * z) - x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(1.0 - N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(N[(1.0 - y), $MachinePrecision] * N[((-z) * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$0, -1.618195973607049e+50], t$95$1, If[Less[t$95$0, 3.892237649663903e+134], N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] - N[(N[(x * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(1 - \left(1 - y\right) \cdot z\right)\\
t_1 := x + \left(1 - y\right) \cdot \left(\left(-z\right) \cdot x\right)\\
\mathbf{if}\;t\_0 < -1.618195973607049 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 < 3.892237649663903 \cdot 10^{+134}:\\
\;\;\;\;\left(x \cdot y\right) \cdot z - \left(x \cdot z - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024040
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, J"
:precision binary64
:herbie-target
(if (< (* x (- 1.0 (* (- 1.0 y) z))) -1.618195973607049e+50) (+ x (* (- 1.0 y) (* (- z) x))) (if (< (* x (- 1.0 (* (- 1.0 y) z))) 3.892237649663903e+134) (- (* (* x y) z) (- (* x z) x)) (+ x (* (- 1.0 y) (* (- z) x)))))
(* x (- 1.0 (* (- 1.0 y) z))))