
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
(FPCore (x y z t) :precision binary64 (+ x (* (- t x) (- y z))))
double code(double x, double y, double z, double t) {
return x + ((t - x) * (y - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((t - x) * (y - z))
end function
public static double code(double x, double y, double z, double t) {
return x + ((t - x) * (y - z));
}
def code(x, y, z, t): return x + ((t - x) * (y - z))
function code(x, y, z, t) return Float64(x + Float64(Float64(t - x) * Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = x + ((t - x) * (y - z)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(t - x), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t - x\right) \cdot \left(y - z\right)
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 y))) (t_2 (+ x (* x z))) (t_3 (+ x (* y t))))
(if (<= z -2e+14)
t_2
(if (<= z -1.1e-226)
t_3
(if (<= z 9e-244)
t_1
(if (<= z 3.2e-35)
t_3
(if (<= z 80000.0)
t_1
(if (or (<= z 9.5e+205) (not (<= z 8.6e+231)))
(* z (- t))
t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double t_2 = x + (x * z);
double t_3 = x + (y * t);
double tmp;
if (z <= -2e+14) {
tmp = t_2;
} else if (z <= -1.1e-226) {
tmp = t_3;
} else if (z <= 9e-244) {
tmp = t_1;
} else if (z <= 3.2e-35) {
tmp = t_3;
} else if (z <= 80000.0) {
tmp = t_1;
} else if ((z <= 9.5e+205) || !(z <= 8.6e+231)) {
tmp = z * -t;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = x * (1.0d0 - y)
t_2 = x + (x * z)
t_3 = x + (y * t)
if (z <= (-2d+14)) then
tmp = t_2
else if (z <= (-1.1d-226)) then
tmp = t_3
else if (z <= 9d-244) then
tmp = t_1
else if (z <= 3.2d-35) then
tmp = t_3
else if (z <= 80000.0d0) then
tmp = t_1
else if ((z <= 9.5d+205) .or. (.not. (z <= 8.6d+231))) then
tmp = z * -t
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double t_2 = x + (x * z);
double t_3 = x + (y * t);
double tmp;
if (z <= -2e+14) {
tmp = t_2;
} else if (z <= -1.1e-226) {
tmp = t_3;
} else if (z <= 9e-244) {
tmp = t_1;
} else if (z <= 3.2e-35) {
tmp = t_3;
} else if (z <= 80000.0) {
tmp = t_1;
} else if ((z <= 9.5e+205) || !(z <= 8.6e+231)) {
tmp = z * -t;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - y) t_2 = x + (x * z) t_3 = x + (y * t) tmp = 0 if z <= -2e+14: tmp = t_2 elif z <= -1.1e-226: tmp = t_3 elif z <= 9e-244: tmp = t_1 elif z <= 3.2e-35: tmp = t_3 elif z <= 80000.0: tmp = t_1 elif (z <= 9.5e+205) or not (z <= 8.6e+231): tmp = z * -t else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - y)) t_2 = Float64(x + Float64(x * z)) t_3 = Float64(x + Float64(y * t)) tmp = 0.0 if (z <= -2e+14) tmp = t_2; elseif (z <= -1.1e-226) tmp = t_3; elseif (z <= 9e-244) tmp = t_1; elseif (z <= 3.2e-35) tmp = t_3; elseif (z <= 80000.0) tmp = t_1; elseif ((z <= 9.5e+205) || !(z <= 8.6e+231)) tmp = Float64(z * Float64(-t)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - y); t_2 = x + (x * z); t_3 = x + (y * t); tmp = 0.0; if (z <= -2e+14) tmp = t_2; elseif (z <= -1.1e-226) tmp = t_3; elseif (z <= 9e-244) tmp = t_1; elseif (z <= 3.2e-35) tmp = t_3; elseif (z <= 80000.0) tmp = t_1; elseif ((z <= 9.5e+205) || ~((z <= 8.6e+231))) tmp = z * -t; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e+14], t$95$2, If[LessEqual[z, -1.1e-226], t$95$3, If[LessEqual[z, 9e-244], t$95$1, If[LessEqual[z, 3.2e-35], t$95$3, If[LessEqual[z, 80000.0], t$95$1, If[Or[LessEqual[z, 9.5e+205], N[Not[LessEqual[z, 8.6e+231]], $MachinePrecision]], N[(z * (-t)), $MachinePrecision], t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - y\right)\\
t_2 := x + x \cdot z\\
t_3 := x + y \cdot t\\
\mathbf{if}\;z \leq -2 \cdot 10^{+14}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-226}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-244}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-35}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq 80000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+205} \lor \neg \left(z \leq 8.6 \cdot 10^{+231}\right):\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -2e14 or 9.4999999999999997e205 < z < 8.59999999999999952e231Initial program 99.9%
Taylor expanded in y around 0 85.5%
mul-1-neg85.5%
distribute-rgt-neg-in85.5%
sub-neg85.5%
+-commutative85.5%
distribute-neg-in85.5%
unsub-neg85.5%
remove-double-neg85.5%
Simplified85.5%
Taylor expanded in t around 0 52.5%
if -2e14 < z < -1.1e-226 or 9.0000000000000003e-244 < z < 3.1999999999999998e-35Initial program 100.0%
Taylor expanded in t around inf 85.6%
Taylor expanded in y around inf 76.6%
*-commutative76.6%
Simplified76.6%
if -1.1e-226 < z < 9.0000000000000003e-244 or 3.1999999999999998e-35 < z < 8e4Initial program 100.0%
*-commutative100.0%
sub-neg100.0%
distribute-lft-in100.0%
fma-define100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 100.0%
mul-1-neg100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 79.3%
neg-mul-179.3%
unsub-neg79.3%
Simplified79.3%
if 8e4 < z < 9.4999999999999997e205 or 8.59999999999999952e231 < z Initial program 100.0%
Taylor expanded in y around 0 83.5%
mul-1-neg83.5%
distribute-rgt-neg-in83.5%
sub-neg83.5%
+-commutative83.5%
distribute-neg-in83.5%
unsub-neg83.5%
remove-double-neg83.5%
Simplified83.5%
Taylor expanded in x around -inf 81.5%
distribute-lft-out81.5%
mul-1-neg81.5%
*-commutative81.5%
fma-define81.5%
sub-neg81.5%
metadata-eval81.5%
+-commutative81.5%
mul-1-neg81.5%
unsub-neg81.5%
Simplified81.5%
Taylor expanded in t around inf 56.7%
Final simplification66.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 y))) (t_2 (* z (- x t))) (t_3 (+ x (* t (- y z)))))
(if (<= z -1.12e+58)
t_2
(if (<= z -1e-226)
t_3
(if (<= z 1.02e-243)
t_1
(if (<= z 3.4e-33)
t_3
(if (<= z 6.8e-12) t_1 (if (<= z 2.4e+92) t_3 t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double t_2 = z * (x - t);
double t_3 = x + (t * (y - z));
double tmp;
if (z <= -1.12e+58) {
tmp = t_2;
} else if (z <= -1e-226) {
tmp = t_3;
} else if (z <= 1.02e-243) {
tmp = t_1;
} else if (z <= 3.4e-33) {
tmp = t_3;
} else if (z <= 6.8e-12) {
tmp = t_1;
} else if (z <= 2.4e+92) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = x * (1.0d0 - y)
t_2 = z * (x - t)
t_3 = x + (t * (y - z))
if (z <= (-1.12d+58)) then
tmp = t_2
else if (z <= (-1d-226)) then
tmp = t_3
else if (z <= 1.02d-243) then
tmp = t_1
else if (z <= 3.4d-33) then
tmp = t_3
else if (z <= 6.8d-12) then
tmp = t_1
else if (z <= 2.4d+92) then
tmp = t_3
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double t_2 = z * (x - t);
double t_3 = x + (t * (y - z));
double tmp;
if (z <= -1.12e+58) {
tmp = t_2;
} else if (z <= -1e-226) {
tmp = t_3;
} else if (z <= 1.02e-243) {
tmp = t_1;
} else if (z <= 3.4e-33) {
tmp = t_3;
} else if (z <= 6.8e-12) {
tmp = t_1;
} else if (z <= 2.4e+92) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - y) t_2 = z * (x - t) t_3 = x + (t * (y - z)) tmp = 0 if z <= -1.12e+58: tmp = t_2 elif z <= -1e-226: tmp = t_3 elif z <= 1.02e-243: tmp = t_1 elif z <= 3.4e-33: tmp = t_3 elif z <= 6.8e-12: tmp = t_1 elif z <= 2.4e+92: tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - y)) t_2 = Float64(z * Float64(x - t)) t_3 = Float64(x + Float64(t * Float64(y - z))) tmp = 0.0 if (z <= -1.12e+58) tmp = t_2; elseif (z <= -1e-226) tmp = t_3; elseif (z <= 1.02e-243) tmp = t_1; elseif (z <= 3.4e-33) tmp = t_3; elseif (z <= 6.8e-12) tmp = t_1; elseif (z <= 2.4e+92) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - y); t_2 = z * (x - t); t_3 = x + (t * (y - z)); tmp = 0.0; if (z <= -1.12e+58) tmp = t_2; elseif (z <= -1e-226) tmp = t_3; elseif (z <= 1.02e-243) tmp = t_1; elseif (z <= 3.4e-33) tmp = t_3; elseif (z <= 6.8e-12) tmp = t_1; elseif (z <= 2.4e+92) tmp = t_3; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.12e+58], t$95$2, If[LessEqual[z, -1e-226], t$95$3, If[LessEqual[z, 1.02e-243], t$95$1, If[LessEqual[z, 3.4e-33], t$95$3, If[LessEqual[z, 6.8e-12], t$95$1, If[LessEqual[z, 2.4e+92], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - y\right)\\
t_2 := z \cdot \left(x - t\right)\\
t_3 := x + t \cdot \left(y - z\right)\\
\mathbf{if}\;z \leq -1.12 \cdot 10^{+58}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-226}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-243}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-33}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+92}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.12e58 or 2.40000000000000005e92 < z Initial program 99.9%
Taylor expanded in y around 0 89.9%
mul-1-neg89.9%
distribute-rgt-neg-in89.9%
sub-neg89.9%
+-commutative89.9%
distribute-neg-in89.9%
unsub-neg89.9%
remove-double-neg89.9%
Simplified89.9%
Taylor expanded in x around -inf 85.5%
distribute-lft-out85.5%
mul-1-neg85.5%
*-commutative85.5%
fma-define86.6%
sub-neg86.6%
metadata-eval86.6%
+-commutative86.6%
mul-1-neg86.6%
unsub-neg86.6%
Simplified86.6%
Taylor expanded in z around inf 89.9%
neg-mul-189.9%
sub-neg89.9%
Simplified89.9%
if -1.12e58 < z < -9.99999999999999921e-227 or 1.01999999999999996e-243 < z < 3.4000000000000001e-33 or 6.8000000000000001e-12 < z < 2.40000000000000005e92Initial program 100.0%
Taylor expanded in t around inf 83.0%
if -9.99999999999999921e-227 < z < 1.01999999999999996e-243 or 3.4000000000000001e-33 < z < 6.8000000000000001e-12Initial program 100.0%
*-commutative100.0%
sub-neg100.0%
distribute-lft-in100.0%
fma-define100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 100.0%
mul-1-neg100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 81.3%
neg-mul-181.3%
unsub-neg81.3%
Simplified81.3%
Final simplification85.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* x z))) (t_2 (* x (- 1.0 y))))
(if (<= z -0.0034)
t_1
(if (<= z 1.45e-223)
t_2
(if (<= z 7.6e-146)
(* y t)
(if (<= z 550000.0)
t_2
(if (or (<= z 5e+207) (not (<= z 8.2e+231))) (* z (- t)) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (x * z);
double t_2 = x * (1.0 - y);
double tmp;
if (z <= -0.0034) {
tmp = t_1;
} else if (z <= 1.45e-223) {
tmp = t_2;
} else if (z <= 7.6e-146) {
tmp = y * t;
} else if (z <= 550000.0) {
tmp = t_2;
} else if ((z <= 5e+207) || !(z <= 8.2e+231)) {
tmp = z * -t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (x * z)
t_2 = x * (1.0d0 - y)
if (z <= (-0.0034d0)) then
tmp = t_1
else if (z <= 1.45d-223) then
tmp = t_2
else if (z <= 7.6d-146) then
tmp = y * t
else if (z <= 550000.0d0) then
tmp = t_2
else if ((z <= 5d+207) .or. (.not. (z <= 8.2d+231))) then
tmp = z * -t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x + (x * z);
double t_2 = x * (1.0 - y);
double tmp;
if (z <= -0.0034) {
tmp = t_1;
} else if (z <= 1.45e-223) {
tmp = t_2;
} else if (z <= 7.6e-146) {
tmp = y * t;
} else if (z <= 550000.0) {
tmp = t_2;
} else if ((z <= 5e+207) || !(z <= 8.2e+231)) {
tmp = z * -t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (x * z) t_2 = x * (1.0 - y) tmp = 0 if z <= -0.0034: tmp = t_1 elif z <= 1.45e-223: tmp = t_2 elif z <= 7.6e-146: tmp = y * t elif z <= 550000.0: tmp = t_2 elif (z <= 5e+207) or not (z <= 8.2e+231): tmp = z * -t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(x * z)) t_2 = Float64(x * Float64(1.0 - y)) tmp = 0.0 if (z <= -0.0034) tmp = t_1; elseif (z <= 1.45e-223) tmp = t_2; elseif (z <= 7.6e-146) tmp = Float64(y * t); elseif (z <= 550000.0) tmp = t_2; elseif ((z <= 5e+207) || !(z <= 8.2e+231)) tmp = Float64(z * Float64(-t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (x * z); t_2 = x * (1.0 - y); tmp = 0.0; if (z <= -0.0034) tmp = t_1; elseif (z <= 1.45e-223) tmp = t_2; elseif (z <= 7.6e-146) tmp = y * t; elseif (z <= 550000.0) tmp = t_2; elseif ((z <= 5e+207) || ~((z <= 8.2e+231))) tmp = z * -t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.0034], t$95$1, If[LessEqual[z, 1.45e-223], t$95$2, If[LessEqual[z, 7.6e-146], N[(y * t), $MachinePrecision], If[LessEqual[z, 550000.0], t$95$2, If[Or[LessEqual[z, 5e+207], N[Not[LessEqual[z, 8.2e+231]], $MachinePrecision]], N[(z * (-t)), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + x \cdot z\\
t_2 := x \cdot \left(1 - y\right)\\
\mathbf{if}\;z \leq -0.0034:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-223}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{-146}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 550000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+207} \lor \neg \left(z \leq 8.2 \cdot 10^{+231}\right):\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -0.00339999999999999981 or 4.9999999999999999e207 < z < 8.2000000000000006e231Initial program 99.9%
Taylor expanded in y around 0 83.4%
mul-1-neg83.4%
distribute-rgt-neg-in83.4%
sub-neg83.4%
+-commutative83.4%
distribute-neg-in83.4%
unsub-neg83.4%
remove-double-neg83.4%
Simplified83.4%
Taylor expanded in t around 0 51.8%
if -0.00339999999999999981 < z < 1.45e-223 or 7.59999999999999989e-146 < z < 5.5e5Initial program 100.0%
*-commutative100.0%
sub-neg100.0%
distribute-lft-in100.0%
fma-define100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 100.0%
mul-1-neg100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 61.0%
neg-mul-161.0%
unsub-neg61.0%
Simplified61.0%
if 1.45e-223 < z < 7.59999999999999989e-146Initial program 99.9%
Taylor expanded in y around inf 96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in x around 0 67.1%
*-commutative67.1%
Simplified67.1%
if 5.5e5 < z < 4.9999999999999999e207 or 8.2000000000000006e231 < z Initial program 100.0%
Taylor expanded in y around 0 83.5%
mul-1-neg83.5%
distribute-rgt-neg-in83.5%
sub-neg83.5%
+-commutative83.5%
distribute-neg-in83.5%
unsub-neg83.5%
remove-double-neg83.5%
Simplified83.5%
Taylor expanded in x around -inf 81.5%
distribute-lft-out81.5%
mul-1-neg81.5%
*-commutative81.5%
fma-define81.5%
sub-neg81.5%
metadata-eval81.5%
+-commutative81.5%
mul-1-neg81.5%
unsub-neg81.5%
Simplified81.5%
Taylor expanded in t around inf 56.7%
Final simplification58.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 y))) (t_2 (+ x (* y t))))
(if (<= y -1e+257)
t_1
(if (<= y -1.4e+45)
t_2
(if (<= y -1.1e-135)
(+ x (* x z))
(if (<= y 1.5e-39)
(- x (* z t))
(if (<= y 1.45e+242) t_2 (if (<= y 3.5e+301) t_1 (* y t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double t_2 = x + (y * t);
double tmp;
if (y <= -1e+257) {
tmp = t_1;
} else if (y <= -1.4e+45) {
tmp = t_2;
} else if (y <= -1.1e-135) {
tmp = x + (x * z);
} else if (y <= 1.5e-39) {
tmp = x - (z * t);
} else if (y <= 1.45e+242) {
tmp = t_2;
} else if (y <= 3.5e+301) {
tmp = t_1;
} else {
tmp = y * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * (1.0d0 - y)
t_2 = x + (y * t)
if (y <= (-1d+257)) then
tmp = t_1
else if (y <= (-1.4d+45)) then
tmp = t_2
else if (y <= (-1.1d-135)) then
tmp = x + (x * z)
else if (y <= 1.5d-39) then
tmp = x - (z * t)
else if (y <= 1.45d+242) then
tmp = t_2
else if (y <= 3.5d+301) then
tmp = t_1
else
tmp = y * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double t_2 = x + (y * t);
double tmp;
if (y <= -1e+257) {
tmp = t_1;
} else if (y <= -1.4e+45) {
tmp = t_2;
} else if (y <= -1.1e-135) {
tmp = x + (x * z);
} else if (y <= 1.5e-39) {
tmp = x - (z * t);
} else if (y <= 1.45e+242) {
tmp = t_2;
} else if (y <= 3.5e+301) {
tmp = t_1;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - y) t_2 = x + (y * t) tmp = 0 if y <= -1e+257: tmp = t_1 elif y <= -1.4e+45: tmp = t_2 elif y <= -1.1e-135: tmp = x + (x * z) elif y <= 1.5e-39: tmp = x - (z * t) elif y <= 1.45e+242: tmp = t_2 elif y <= 3.5e+301: tmp = t_1 else: tmp = y * t return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - y)) t_2 = Float64(x + Float64(y * t)) tmp = 0.0 if (y <= -1e+257) tmp = t_1; elseif (y <= -1.4e+45) tmp = t_2; elseif (y <= -1.1e-135) tmp = Float64(x + Float64(x * z)); elseif (y <= 1.5e-39) tmp = Float64(x - Float64(z * t)); elseif (y <= 1.45e+242) tmp = t_2; elseif (y <= 3.5e+301) tmp = t_1; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - y); t_2 = x + (y * t); tmp = 0.0; if (y <= -1e+257) tmp = t_1; elseif (y <= -1.4e+45) tmp = t_2; elseif (y <= -1.1e-135) tmp = x + (x * z); elseif (y <= 1.5e-39) tmp = x - (z * t); elseif (y <= 1.45e+242) tmp = t_2; elseif (y <= 3.5e+301) tmp = t_1; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1e+257], t$95$1, If[LessEqual[y, -1.4e+45], t$95$2, If[LessEqual[y, -1.1e-135], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e-39], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e+242], t$95$2, If[LessEqual[y, 3.5e+301], t$95$1, N[(y * t), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - y\right)\\
t_2 := x + y \cdot t\\
\mathbf{if}\;y \leq -1 \cdot 10^{+257}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{+45}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{-135}:\\
\;\;\;\;x + x \cdot z\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-39}:\\
\;\;\;\;x - z \cdot t\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+242}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+301}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -1.00000000000000003e257 or 1.44999999999999999e242 < y < 3.4999999999999999e301Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
distribute-lft-in86.1%
fma-define86.1%
Applied egg-rr86.1%
Taylor expanded in t around inf 93.0%
mul-1-neg93.0%
distribute-lft-neg-out93.0%
*-commutative93.0%
Simplified93.0%
Taylor expanded in x around inf 65.7%
neg-mul-165.7%
unsub-neg65.7%
Simplified65.7%
if -1.00000000000000003e257 < y < -1.4e45 or 1.50000000000000014e-39 < y < 1.44999999999999999e242Initial program 100.0%
Taylor expanded in t around inf 65.9%
Taylor expanded in y around inf 53.8%
*-commutative53.8%
Simplified53.8%
if -1.4e45 < y < -1.1e-135Initial program 100.0%
Taylor expanded in y around 0 79.5%
mul-1-neg79.5%
distribute-rgt-neg-in79.5%
sub-neg79.5%
+-commutative79.5%
distribute-neg-in79.5%
unsub-neg79.5%
remove-double-neg79.5%
Simplified79.5%
Taylor expanded in t around 0 61.9%
if -1.1e-135 < y < 1.50000000000000014e-39Initial program 100.0%
Taylor expanded in t around inf 86.6%
Taylor expanded in y around 0 82.6%
mul-1-neg82.6%
unsub-neg82.6%
*-commutative82.6%
Simplified82.6%
if 3.4999999999999999e301 < y Initial program 100.0%
Taylor expanded in y around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 75.2%
*-commutative75.2%
Simplified75.2%
Final simplification66.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 y))) (t_2 (* z (- x t))) (t_3 (+ x (* y t))))
(if (<= z -160.0)
t_2
(if (<= z -1e-226)
t_3
(if (<= z 4.4e-239)
t_1
(if (<= z 1.55e-32) t_3 (if (<= z 90000.0) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double t_2 = z * (x - t);
double t_3 = x + (y * t);
double tmp;
if (z <= -160.0) {
tmp = t_2;
} else if (z <= -1e-226) {
tmp = t_3;
} else if (z <= 4.4e-239) {
tmp = t_1;
} else if (z <= 1.55e-32) {
tmp = t_3;
} else if (z <= 90000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = x * (1.0d0 - y)
t_2 = z * (x - t)
t_3 = x + (y * t)
if (z <= (-160.0d0)) then
tmp = t_2
else if (z <= (-1d-226)) then
tmp = t_3
else if (z <= 4.4d-239) then
tmp = t_1
else if (z <= 1.55d-32) then
tmp = t_3
else if (z <= 90000.0d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double t_2 = z * (x - t);
double t_3 = x + (y * t);
double tmp;
if (z <= -160.0) {
tmp = t_2;
} else if (z <= -1e-226) {
tmp = t_3;
} else if (z <= 4.4e-239) {
tmp = t_1;
} else if (z <= 1.55e-32) {
tmp = t_3;
} else if (z <= 90000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - y) t_2 = z * (x - t) t_3 = x + (y * t) tmp = 0 if z <= -160.0: tmp = t_2 elif z <= -1e-226: tmp = t_3 elif z <= 4.4e-239: tmp = t_1 elif z <= 1.55e-32: tmp = t_3 elif z <= 90000.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - y)) t_2 = Float64(z * Float64(x - t)) t_3 = Float64(x + Float64(y * t)) tmp = 0.0 if (z <= -160.0) tmp = t_2; elseif (z <= -1e-226) tmp = t_3; elseif (z <= 4.4e-239) tmp = t_1; elseif (z <= 1.55e-32) tmp = t_3; elseif (z <= 90000.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - y); t_2 = z * (x - t); t_3 = x + (y * t); tmp = 0.0; if (z <= -160.0) tmp = t_2; elseif (z <= -1e-226) tmp = t_3; elseif (z <= 4.4e-239) tmp = t_1; elseif (z <= 1.55e-32) tmp = t_3; elseif (z <= 90000.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -160.0], t$95$2, If[LessEqual[z, -1e-226], t$95$3, If[LessEqual[z, 4.4e-239], t$95$1, If[LessEqual[z, 1.55e-32], t$95$3, If[LessEqual[z, 90000.0], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - y\right)\\
t_2 := z \cdot \left(x - t\right)\\
t_3 := x + y \cdot t\\
\mathbf{if}\;z \leq -160:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-226}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-239}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{-32}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq 90000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -160 or 9e4 < z Initial program 99.9%
Taylor expanded in y around 0 84.6%
mul-1-neg84.6%
distribute-rgt-neg-in84.6%
sub-neg84.6%
+-commutative84.6%
distribute-neg-in84.6%
unsub-neg84.6%
remove-double-neg84.6%
Simplified84.6%
Taylor expanded in x around -inf 81.3%
distribute-lft-out81.3%
mul-1-neg81.3%
*-commutative81.3%
fma-define82.1%
sub-neg82.1%
metadata-eval82.1%
+-commutative82.1%
mul-1-neg82.1%
unsub-neg82.1%
Simplified82.1%
Taylor expanded in z around inf 84.6%
neg-mul-184.6%
sub-neg84.6%
Simplified84.6%
if -160 < z < -9.99999999999999921e-227 or 4.39999999999999965e-239 < z < 1.55000000000000005e-32Initial program 100.0%
Taylor expanded in t around inf 85.6%
Taylor expanded in y around inf 76.6%
*-commutative76.6%
Simplified76.6%
if -9.99999999999999921e-227 < z < 4.39999999999999965e-239 or 1.55000000000000005e-32 < z < 9e4Initial program 100.0%
*-commutative100.0%
sub-neg100.0%
distribute-lft-in100.0%
fma-define100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 100.0%
mul-1-neg100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 79.3%
neg-mul-179.3%
unsub-neg79.3%
Simplified79.3%
Final simplification80.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))) (t_2 (* x (- 1.0 y))))
(if (<= z -0.007)
t_1
(if (<= z 2.3e-221)
t_2
(if (<= z 3.4e-144) (* y t) (if (<= z 760000.0) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double t_2 = x * (1.0 - y);
double tmp;
if (z <= -0.007) {
tmp = t_1;
} else if (z <= 2.3e-221) {
tmp = t_2;
} else if (z <= 3.4e-144) {
tmp = y * t;
} else if (z <= 760000.0) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = z * -t
t_2 = x * (1.0d0 - y)
if (z <= (-0.007d0)) then
tmp = t_1
else if (z <= 2.3d-221) then
tmp = t_2
else if (z <= 3.4d-144) then
tmp = y * t
else if (z <= 760000.0d0) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double t_2 = x * (1.0 - y);
double tmp;
if (z <= -0.007) {
tmp = t_1;
} else if (z <= 2.3e-221) {
tmp = t_2;
} else if (z <= 3.4e-144) {
tmp = y * t;
} else if (z <= 760000.0) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t t_2 = x * (1.0 - y) tmp = 0 if z <= -0.007: tmp = t_1 elif z <= 2.3e-221: tmp = t_2 elif z <= 3.4e-144: tmp = y * t elif z <= 760000.0: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) t_2 = Float64(x * Float64(1.0 - y)) tmp = 0.0 if (z <= -0.007) tmp = t_1; elseif (z <= 2.3e-221) tmp = t_2; elseif (z <= 3.4e-144) tmp = Float64(y * t); elseif (z <= 760000.0) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; t_2 = x * (1.0 - y); tmp = 0.0; if (z <= -0.007) tmp = t_1; elseif (z <= 2.3e-221) tmp = t_2; elseif (z <= 3.4e-144) tmp = y * t; elseif (z <= 760000.0) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.007], t$95$1, If[LessEqual[z, 2.3e-221], t$95$2, If[LessEqual[z, 3.4e-144], N[(y * t), $MachinePrecision], If[LessEqual[z, 760000.0], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
t_2 := x \cdot \left(1 - y\right)\\
\mathbf{if}\;z \leq -0.007:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-221}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-144}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 760000:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -0.00700000000000000015 or 7.6e5 < z Initial program 99.9%
Taylor expanded in y around 0 83.3%
mul-1-neg83.3%
distribute-rgt-neg-in83.3%
sub-neg83.3%
+-commutative83.3%
distribute-neg-in83.3%
unsub-neg83.3%
remove-double-neg83.3%
Simplified83.3%
Taylor expanded in x around -inf 80.0%
distribute-lft-out80.0%
mul-1-neg80.0%
*-commutative80.0%
fma-define80.8%
sub-neg80.8%
metadata-eval80.8%
+-commutative80.8%
mul-1-neg80.8%
unsub-neg80.8%
Simplified80.8%
Taylor expanded in t around inf 47.6%
if -0.00700000000000000015 < z < 2.3e-221 or 3.40000000000000017e-144 < z < 7.6e5Initial program 100.0%
*-commutative100.0%
sub-neg100.0%
distribute-lft-in100.0%
fma-define100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 99.4%
mul-1-neg99.4%
distribute-lft-neg-out99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in x around inf 60.7%
neg-mul-160.7%
unsub-neg60.7%
Simplified60.7%
if 2.3e-221 < z < 3.40000000000000017e-144Initial program 99.9%
Taylor expanded in y around inf 96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in x around 0 67.1%
*-commutative67.1%
Simplified67.1%
Final simplification55.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -8.6e-37) (not (<= t 3.05e-55))) (+ x (* t (- y z))) (+ x (* x (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -8.6e-37) || !(t <= 3.05e-55)) {
tmp = x + (t * (y - z));
} else {
tmp = x + (x * (z - y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-8.6d-37)) .or. (.not. (t <= 3.05d-55))) then
tmp = x + (t * (y - z))
else
tmp = x + (x * (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -8.6e-37) || !(t <= 3.05e-55)) {
tmp = x + (t * (y - z));
} else {
tmp = x + (x * (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -8.6e-37) or not (t <= 3.05e-55): tmp = x + (t * (y - z)) else: tmp = x + (x * (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -8.6e-37) || !(t <= 3.05e-55)) tmp = Float64(x + Float64(t * Float64(y - z))); else tmp = Float64(x + Float64(x * Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -8.6e-37) || ~((t <= 3.05e-55))) tmp = x + (t * (y - z)); else tmp = x + (x * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -8.6e-37], N[Not[LessEqual[t, 3.05e-55]], $MachinePrecision]], N[(x + N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.6 \cdot 10^{-37} \lor \neg \left(t \leq 3.05 \cdot 10^{-55}\right):\\
\;\;\;\;x + t \cdot \left(y - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot \left(z - y\right)\\
\end{array}
\end{array}
if t < -8.59999999999999936e-37 or 3.0500000000000001e-55 < t Initial program 100.0%
Taylor expanded in t around inf 85.7%
if -8.59999999999999936e-37 < t < 3.0500000000000001e-55Initial program 99.9%
Taylor expanded in t around 0 87.4%
mul-1-neg87.4%
distribute-rgt-neg-in87.4%
sub-neg87.4%
+-commutative87.4%
distribute-neg-in87.4%
unsub-neg87.4%
remove-double-neg87.4%
Simplified87.4%
Final simplification86.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* z (- x t)))) (if (<= z -7200.0) t_1 (if (<= z 28000.0) (+ x (* y (- t x))) (+ x t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -7200.0) {
tmp = t_1;
} else if (z <= 28000.0) {
tmp = x + (y * (t - x));
} else {
tmp = x + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = z * (x - t)
if (z <= (-7200.0d0)) then
tmp = t_1
else if (z <= 28000.0d0) then
tmp = x + (y * (t - x))
else
tmp = x + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -7200.0) {
tmp = t_1;
} else if (z <= 28000.0) {
tmp = x + (y * (t - x));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) tmp = 0 if z <= -7200.0: tmp = t_1 elif z <= 28000.0: tmp = x + (y * (t - x)) else: tmp = x + t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) tmp = 0.0 if (z <= -7200.0) tmp = t_1; elseif (z <= 28000.0) tmp = Float64(x + Float64(y * Float64(t - x))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); tmp = 0.0; if (z <= -7200.0) tmp = t_1; elseif (z <= 28000.0) tmp = x + (y * (t - x)); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7200.0], t$95$1, If[LessEqual[z, 28000.0], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -7200:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 28000:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if z < -7200Initial program 99.9%
Taylor expanded in y around 0 85.4%
mul-1-neg85.4%
distribute-rgt-neg-in85.4%
sub-neg85.4%
+-commutative85.4%
distribute-neg-in85.4%
unsub-neg85.4%
remove-double-neg85.4%
Simplified85.4%
Taylor expanded in x around -inf 80.4%
distribute-lft-out80.4%
mul-1-neg80.4%
*-commutative80.4%
fma-define82.1%
sub-neg82.1%
metadata-eval82.1%
+-commutative82.1%
mul-1-neg82.1%
unsub-neg82.1%
Simplified82.1%
Taylor expanded in z around inf 85.4%
neg-mul-185.4%
sub-neg85.4%
Simplified85.4%
if -7200 < z < 28000Initial program 100.0%
Taylor expanded in y around inf 92.5%
*-commutative92.5%
Simplified92.5%
if 28000 < z Initial program 100.0%
Taylor expanded in y around 0 83.9%
mul-1-neg83.9%
distribute-rgt-neg-in83.9%
sub-neg83.9%
+-commutative83.9%
distribute-neg-in83.9%
unsub-neg83.9%
remove-double-neg83.9%
Simplified83.9%
Final simplification88.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2900000.0) (not (<= z 220000.0))) (* z (- t)) (* y t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2900000.0) || !(z <= 220000.0)) {
tmp = z * -t;
} else {
tmp = y * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-2900000.0d0)) .or. (.not. (z <= 220000.0d0))) then
tmp = z * -t
else
tmp = y * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2900000.0) || !(z <= 220000.0)) {
tmp = z * -t;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2900000.0) or not (z <= 220000.0): tmp = z * -t else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2900000.0) || !(z <= 220000.0)) tmp = Float64(z * Float64(-t)); else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2900000.0) || ~((z <= 220000.0))) tmp = z * -t; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2900000.0], N[Not[LessEqual[z, 220000.0]], $MachinePrecision]], N[(z * (-t)), $MachinePrecision], N[(y * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2900000 \lor \neg \left(z \leq 220000\right):\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if z < -2.9e6 or 2.2e5 < z Initial program 99.9%
Taylor expanded in y around 0 84.6%
mul-1-neg84.6%
distribute-rgt-neg-in84.6%
sub-neg84.6%
+-commutative84.6%
distribute-neg-in84.6%
unsub-neg84.6%
remove-double-neg84.6%
Simplified84.6%
Taylor expanded in x around -inf 81.3%
distribute-lft-out81.3%
mul-1-neg81.3%
*-commutative81.3%
fma-define82.1%
sub-neg82.1%
metadata-eval82.1%
+-commutative82.1%
mul-1-neg82.1%
unsub-neg82.1%
Simplified82.1%
Taylor expanded in t around inf 48.3%
if -2.9e6 < z < 2.2e5Initial program 100.0%
Taylor expanded in y around inf 92.5%
*-commutative92.5%
Simplified92.5%
Taylor expanded in x around 0 40.7%
*-commutative40.7%
Simplified40.7%
Final simplification44.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.75e-95) (not (<= y 1.1e-36))) (* y t) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.75e-95) || !(y <= 1.1e-36)) {
tmp = y * t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-2.75d-95)) .or. (.not. (y <= 1.1d-36))) then
tmp = y * t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.75e-95) || !(y <= 1.1e-36)) {
tmp = y * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.75e-95) or not (y <= 1.1e-36): tmp = y * t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.75e-95) || !(y <= 1.1e-36)) tmp = Float64(y * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2.75e-95) || ~((y <= 1.1e-36))) tmp = y * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.75e-95], N[Not[LessEqual[y, 1.1e-36]], $MachinePrecision]], N[(y * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.75 \cdot 10^{-95} \lor \neg \left(y \leq 1.1 \cdot 10^{-36}\right):\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.75000000000000001e-95 or 1.1e-36 < y Initial program 99.9%
Taylor expanded in y around inf 71.4%
*-commutative71.4%
Simplified71.4%
Taylor expanded in x around 0 42.6%
*-commutative42.6%
Simplified42.6%
if -2.75000000000000001e-95 < y < 1.1e-36Initial program 100.0%
Taylor expanded in t around inf 84.6%
Taylor expanded in x around inf 39.1%
Final simplification41.2%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 100.0%
Taylor expanded in t around inf 68.0%
Taylor expanded in x around inf 18.4%
Final simplification18.4%
(FPCore (x y z t) :precision binary64 (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((t * (y - z)) + (-x * (y - z)))
end function
public static double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
def code(x, y, z, t): return x + ((t * (y - z)) + (-x * (y - z)))
function code(x, y, z, t) return Float64(x + Float64(Float64(t * Float64(y - z)) + Float64(Float64(-x) * Float64(y - z)))) end
function tmp = code(x, y, z, t) tmp = x + ((t * (y - z)) + (-x * (y - z))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] + N[((-x) * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right)
\end{array}
herbie shell --seed 2024044
(FPCore (x y z t)
:name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
:precision binary64
:herbie-target
(+ x (+ (* t (- y z)) (* (- x) (- y z))))
(+ x (* (- y z) (- t x))))