
(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 14 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 (fma (- y z) (- t x) x))
double code(double x, double y, double z, double t) {
return fma((y - z), (t - x), x);
}
function code(x, y, z, t) return fma(Float64(y - z), Float64(t - x), x) end
code[x_, y_, z_, t_] := N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - z, t - x, x\right)
\end{array}
Initial program 100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))))
(if (<= y -2.95e+106)
(* y t)
(if (<= y -4.5e-116)
(* z x)
(if (<= y -7e-283)
t_1
(if (<= y 6e-240)
(* z x)
(if (<= y 5.1e-92) t_1 (if (<= y 4.2e+30) (* z x) (* y t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (y <= -2.95e+106) {
tmp = y * t;
} else if (y <= -4.5e-116) {
tmp = z * x;
} else if (y <= -7e-283) {
tmp = t_1;
} else if (y <= 6e-240) {
tmp = z * x;
} else if (y <= 5.1e-92) {
tmp = t_1;
} else if (y <= 4.2e+30) {
tmp = z * x;
} 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) :: tmp
t_1 = z * -t
if (y <= (-2.95d+106)) then
tmp = y * t
else if (y <= (-4.5d-116)) then
tmp = z * x
else if (y <= (-7d-283)) then
tmp = t_1
else if (y <= 6d-240) then
tmp = z * x
else if (y <= 5.1d-92) then
tmp = t_1
else if (y <= 4.2d+30) then
tmp = z * x
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 = z * -t;
double tmp;
if (y <= -2.95e+106) {
tmp = y * t;
} else if (y <= -4.5e-116) {
tmp = z * x;
} else if (y <= -7e-283) {
tmp = t_1;
} else if (y <= 6e-240) {
tmp = z * x;
} else if (y <= 5.1e-92) {
tmp = t_1;
} else if (y <= 4.2e+30) {
tmp = z * x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t tmp = 0 if y <= -2.95e+106: tmp = y * t elif y <= -4.5e-116: tmp = z * x elif y <= -7e-283: tmp = t_1 elif y <= 6e-240: tmp = z * x elif y <= 5.1e-92: tmp = t_1 elif y <= 4.2e+30: tmp = z * x else: tmp = y * t return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) tmp = 0.0 if (y <= -2.95e+106) tmp = Float64(y * t); elseif (y <= -4.5e-116) tmp = Float64(z * x); elseif (y <= -7e-283) tmp = t_1; elseif (y <= 6e-240) tmp = Float64(z * x); elseif (y <= 5.1e-92) tmp = t_1; elseif (y <= 4.2e+30) tmp = Float64(z * x); else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; tmp = 0.0; if (y <= -2.95e+106) tmp = y * t; elseif (y <= -4.5e-116) tmp = z * x; elseif (y <= -7e-283) tmp = t_1; elseif (y <= 6e-240) tmp = z * x; elseif (y <= 5.1e-92) tmp = t_1; elseif (y <= 4.2e+30) tmp = z * x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[y, -2.95e+106], N[(y * t), $MachinePrecision], If[LessEqual[y, -4.5e-116], N[(z * x), $MachinePrecision], If[LessEqual[y, -7e-283], t$95$1, If[LessEqual[y, 6e-240], N[(z * x), $MachinePrecision], If[LessEqual[y, 5.1e-92], t$95$1, If[LessEqual[y, 4.2e+30], N[(z * x), $MachinePrecision], N[(y * t), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
\mathbf{if}\;y \leq -2.95 \cdot 10^{+106}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -4.5 \cdot 10^{-116}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq -7 \cdot 10^{-283}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-240}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 5.1 \cdot 10^{-92}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+30}:\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -2.95000000000000014e106 or 4.2e30 < y Initial program 100.0%
Taylor expanded in t around inf 62.8%
Taylor expanded in y around inf 58.1%
*-commutative58.1%
Simplified58.1%
if -2.95000000000000014e106 < y < -4.50000000000000012e-116 or -6.9999999999999997e-283 < y < 5.99999999999999982e-240 or 5.09999999999999972e-92 < y < 4.2e30Initial program 100.0%
Taylor expanded in x around 0 96.9%
fma-def99.0%
+-commutative99.0%
mul-1-neg99.0%
neg-sub099.0%
associate-+l-99.0%
associate--r+99.0%
+-commutative99.0%
neg-sub099.0%
distribute-rgt-neg-in99.0%
mul-1-neg99.0%
mul-1-neg99.0%
distribute-rgt-neg-in99.0%
neg-sub099.0%
+-commutative99.0%
associate--r+99.0%
associate-+l-99.0%
neg-sub099.0%
mul-1-neg99.0%
+-commutative99.0%
mul-1-neg99.0%
Simplified99.0%
Taylor expanded in z around inf 71.3%
Taylor expanded in t around 0 50.1%
if -4.50000000000000012e-116 < y < -6.9999999999999997e-283 or 5.99999999999999982e-240 < y < 5.09999999999999972e-92Initial program 100.0%
Taylor expanded in t around inf 82.6%
Taylor expanded in z around inf 53.7%
associate-*r*53.7%
mul-1-neg53.7%
Simplified53.7%
Final simplification53.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (- y z))) (t_2 (* x (- 1.0 y))))
(if (<= t -6.8e-142)
t_1
(if (<= t -1.45e-299)
t_2
(if (<= t 3.4e-255)
(* z x)
(if (<= t 9.2e-33) t_2 (if (<= t 3.2e+32) (* z x) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (y - z);
double t_2 = x * (1.0 - y);
double tmp;
if (t <= -6.8e-142) {
tmp = t_1;
} else if (t <= -1.45e-299) {
tmp = t_2;
} else if (t <= 3.4e-255) {
tmp = z * x;
} else if (t <= 9.2e-33) {
tmp = t_2;
} else if (t <= 3.2e+32) {
tmp = z * x;
} 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 = t * (y - z)
t_2 = x * (1.0d0 - y)
if (t <= (-6.8d-142)) then
tmp = t_1
else if (t <= (-1.45d-299)) then
tmp = t_2
else if (t <= 3.4d-255) then
tmp = z * x
else if (t <= 9.2d-33) then
tmp = t_2
else if (t <= 3.2d+32) then
tmp = z * x
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 = t * (y - z);
double t_2 = x * (1.0 - y);
double tmp;
if (t <= -6.8e-142) {
tmp = t_1;
} else if (t <= -1.45e-299) {
tmp = t_2;
} else if (t <= 3.4e-255) {
tmp = z * x;
} else if (t <= 9.2e-33) {
tmp = t_2;
} else if (t <= 3.2e+32) {
tmp = z * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (y - z) t_2 = x * (1.0 - y) tmp = 0 if t <= -6.8e-142: tmp = t_1 elif t <= -1.45e-299: tmp = t_2 elif t <= 3.4e-255: tmp = z * x elif t <= 9.2e-33: tmp = t_2 elif t <= 3.2e+32: tmp = z * x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(y - z)) t_2 = Float64(x * Float64(1.0 - y)) tmp = 0.0 if (t <= -6.8e-142) tmp = t_1; elseif (t <= -1.45e-299) tmp = t_2; elseif (t <= 3.4e-255) tmp = Float64(z * x); elseif (t <= 9.2e-33) tmp = t_2; elseif (t <= 3.2e+32) tmp = Float64(z * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (y - z); t_2 = x * (1.0 - y); tmp = 0.0; if (t <= -6.8e-142) tmp = t_1; elseif (t <= -1.45e-299) tmp = t_2; elseif (t <= 3.4e-255) tmp = z * x; elseif (t <= 9.2e-33) tmp = t_2; elseif (t <= 3.2e+32) tmp = z * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.8e-142], t$95$1, If[LessEqual[t, -1.45e-299], t$95$2, If[LessEqual[t, 3.4e-255], N[(z * x), $MachinePrecision], If[LessEqual[t, 9.2e-33], t$95$2, If[LessEqual[t, 3.2e+32], N[(z * x), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(y - z\right)\\
t_2 := x \cdot \left(1 - y\right)\\
\mathbf{if}\;t \leq -6.8 \cdot 10^{-142}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.45 \cdot 10^{-299}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{-255}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;t \leq 9.2 \cdot 10^{-33}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{+32}:\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -6.80000000000000057e-142 or 3.1999999999999999e32 < t Initial program 100.0%
Taylor expanded in x around 0 93.7%
fma-def94.4%
+-commutative94.4%
mul-1-neg94.4%
neg-sub094.4%
associate-+l-94.4%
associate--r+94.4%
+-commutative94.4%
neg-sub094.4%
distribute-rgt-neg-in94.4%
mul-1-neg94.4%
mul-1-neg94.4%
distribute-rgt-neg-in94.4%
neg-sub094.4%
+-commutative94.4%
associate--r+94.4%
associate-+l-94.4%
neg-sub094.4%
mul-1-neg94.4%
+-commutative94.4%
mul-1-neg94.4%
Simplified94.4%
Taylor expanded in t around inf 78.1%
if -6.80000000000000057e-142 < t < -1.45000000000000013e-299 or 3.39999999999999983e-255 < t < 9.19999999999999942e-33Initial program 100.0%
Taylor expanded in x around 0 99.9%
fma-def99.9%
+-commutative99.9%
mul-1-neg99.9%
neg-sub099.9%
associate-+l-99.9%
associate--r+99.9%
+-commutative99.9%
neg-sub099.9%
distribute-rgt-neg-in99.9%
mul-1-neg99.9%
mul-1-neg99.9%
distribute-rgt-neg-in99.9%
neg-sub099.9%
+-commutative99.9%
associate--r+99.9%
associate-+l-99.9%
neg-sub099.9%
mul-1-neg99.9%
+-commutative99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 63.3%
+-commutative63.3%
fma-def63.3%
*-commutative63.3%
Simplified63.3%
Taylor expanded in x around inf 55.4%
if -1.45000000000000013e-299 < t < 3.39999999999999983e-255 or 9.19999999999999942e-33 < t < 3.1999999999999999e32Initial program 100.0%
Taylor expanded in x around 0 93.5%
fma-def100.0%
+-commutative100.0%
mul-1-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
associate--r+100.0%
+-commutative100.0%
neg-sub0100.0%
distribute-rgt-neg-in100.0%
mul-1-neg100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
+-commutative100.0%
associate--r+100.0%
associate-+l-100.0%
neg-sub0100.0%
mul-1-neg100.0%
+-commutative100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 75.9%
Taylor expanded in t around 0 64.7%
Final simplification69.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* t (- y z)))))
(if (<= t -14200000000.0)
t_1
(if (<= t -2.6e-54)
(* z (- x t))
(if (or (<= t -7e-142) (not (<= t 1.25e+33)))
t_1
(+ x (* x (- z y))))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (t * (y - z));
double tmp;
if (t <= -14200000000.0) {
tmp = t_1;
} else if (t <= -2.6e-54) {
tmp = z * (x - t);
} else if ((t <= -7e-142) || !(t <= 1.25e+33)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (t * (y - z))
if (t <= (-14200000000.0d0)) then
tmp = t_1
else if (t <= (-2.6d-54)) then
tmp = z * (x - t)
else if ((t <= (-7d-142)) .or. (.not. (t <= 1.25d+33))) then
tmp = t_1
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 t_1 = x + (t * (y - z));
double tmp;
if (t <= -14200000000.0) {
tmp = t_1;
} else if (t <= -2.6e-54) {
tmp = z * (x - t);
} else if ((t <= -7e-142) || !(t <= 1.25e+33)) {
tmp = t_1;
} else {
tmp = x + (x * (z - y));
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (t * (y - z)) tmp = 0 if t <= -14200000000.0: tmp = t_1 elif t <= -2.6e-54: tmp = z * (x - t) elif (t <= -7e-142) or not (t <= 1.25e+33): tmp = t_1 else: tmp = x + (x * (z - y)) return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(t * Float64(y - z))) tmp = 0.0 if (t <= -14200000000.0) tmp = t_1; elseif (t <= -2.6e-54) tmp = Float64(z * Float64(x - t)); elseif ((t <= -7e-142) || !(t <= 1.25e+33)) tmp = t_1; else tmp = Float64(x + Float64(x * Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (t * (y - z)); tmp = 0.0; if (t <= -14200000000.0) tmp = t_1; elseif (t <= -2.6e-54) tmp = z * (x - t); elseif ((t <= -7e-142) || ~((t <= 1.25e+33))) tmp = t_1; else tmp = x + (x * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -14200000000.0], t$95$1, If[LessEqual[t, -2.6e-54], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -7e-142], N[Not[LessEqual[t, 1.25e+33]], $MachinePrecision]], t$95$1, N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot \left(y - z\right)\\
\mathbf{if}\;t \leq -14200000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -2.6 \cdot 10^{-54}:\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{elif}\;t \leq -7 \cdot 10^{-142} \lor \neg \left(t \leq 1.25 \cdot 10^{+33}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot \left(z - y\right)\\
\end{array}
\end{array}
if t < -1.42e10 or -2.60000000000000002e-54 < t < -7.00000000000000029e-142 or 1.24999999999999993e33 < t Initial program 100.0%
Taylor expanded in t around inf 87.0%
if -1.42e10 < t < -2.60000000000000002e-54Initial program 99.9%
Taylor expanded in x around 0 100.0%
fma-def100.0%
+-commutative100.0%
mul-1-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
associate--r+100.0%
+-commutative100.0%
neg-sub0100.0%
distribute-rgt-neg-in100.0%
mul-1-neg100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
+-commutative100.0%
associate--r+100.0%
associate-+l-100.0%
neg-sub0100.0%
mul-1-neg100.0%
+-commutative100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 92.0%
mul-1-neg92.0%
sub-neg92.0%
Simplified92.0%
if -7.00000000000000029e-142 < t < 1.24999999999999993e33Initial program 100.0%
Taylor expanded in t around 0 85.6%
mul-1-neg85.6%
distribute-rgt-neg-in85.6%
neg-sub085.6%
sub-neg85.6%
+-commutative85.6%
associate--r+85.6%
neg-sub085.6%
remove-double-neg85.6%
Simplified85.6%
Final simplification86.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))) (t_2 (+ x (* (- y z) t))))
(if (<= z -1.7e-8)
t_1
(if (<= z -2e-305)
t_2
(if (<= z 1e-254) (* y (- t x)) (if (<= z 7.5e+45) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double t_2 = x + ((y - z) * t);
double tmp;
if (z <= -1.7e-8) {
tmp = t_1;
} else if (z <= -2e-305) {
tmp = t_2;
} else if (z <= 1e-254) {
tmp = y * (t - x);
} else if (z <= 7.5e+45) {
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 * (x - t)
t_2 = x + ((y - z) * t)
if (z <= (-1.7d-8)) then
tmp = t_1
else if (z <= (-2d-305)) then
tmp = t_2
else if (z <= 1d-254) then
tmp = y * (t - x)
else if (z <= 7.5d+45) 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 * (x - t);
double t_2 = x + ((y - z) * t);
double tmp;
if (z <= -1.7e-8) {
tmp = t_1;
} else if (z <= -2e-305) {
tmp = t_2;
} else if (z <= 1e-254) {
tmp = y * (t - x);
} else if (z <= 7.5e+45) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) t_2 = x + ((y - z) * t) tmp = 0 if z <= -1.7e-8: tmp = t_1 elif z <= -2e-305: tmp = t_2 elif z <= 1e-254: tmp = y * (t - x) elif z <= 7.5e+45: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) t_2 = Float64(x + Float64(Float64(y - z) * t)) tmp = 0.0 if (z <= -1.7e-8) tmp = t_1; elseif (z <= -2e-305) tmp = t_2; elseif (z <= 1e-254) tmp = Float64(y * Float64(t - x)); elseif (z <= 7.5e+45) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); t_2 = x + ((y - z) * t); tmp = 0.0; if (z <= -1.7e-8) tmp = t_1; elseif (z <= -2e-305) tmp = t_2; elseif (z <= 1e-254) tmp = y * (t - x); elseif (z <= 7.5e+45) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7e-8], t$95$1, If[LessEqual[z, -2e-305], t$95$2, If[LessEqual[z, 1e-254], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.5e+45], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
t_2 := x + \left(y - z\right) \cdot t\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{-8}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-305}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 10^{-254}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+45}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.7e-8 or 7.50000000000000058e45 < z Initial program 100.0%
Taylor expanded in x around 0 93.6%
fma-def95.7%
+-commutative95.7%
mul-1-neg95.7%
neg-sub095.7%
associate-+l-95.7%
associate--r+95.7%
+-commutative95.7%
neg-sub095.7%
distribute-rgt-neg-in95.7%
mul-1-neg95.7%
mul-1-neg95.7%
distribute-rgt-neg-in95.7%
neg-sub095.7%
+-commutative95.7%
associate--r+95.7%
associate-+l-95.7%
neg-sub095.7%
mul-1-neg95.7%
+-commutative95.7%
mul-1-neg95.7%
Simplified95.7%
Taylor expanded in z around inf 85.5%
mul-1-neg85.5%
sub-neg85.5%
Simplified85.5%
if -1.7e-8 < z < -1.99999999999999999e-305 or 9.9999999999999991e-255 < z < 7.50000000000000058e45Initial program 100.0%
Taylor expanded in t around inf 82.6%
if -1.99999999999999999e-305 < z < 9.9999999999999991e-255Initial program 100.0%
Taylor expanded in x around 0 100.0%
fma-def100.0%
+-commutative100.0%
mul-1-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
associate--r+100.0%
+-commutative100.0%
neg-sub0100.0%
distribute-rgt-neg-in100.0%
mul-1-neg100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
+-commutative100.0%
associate--r+100.0%
associate-+l-100.0%
neg-sub0100.0%
mul-1-neg100.0%
+-commutative100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
neg-mul-1100.0%
sub-neg100.0%
Simplified100.0%
Final simplification84.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (- y z))))
(if (<= t -1e-142)
t_1
(if (<= t 3.6e-109)
(* z x)
(if (<= t 1.15e-34) (* y (- x)) (if (<= t 1.8e+34) (* z x) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (y - z);
double tmp;
if (t <= -1e-142) {
tmp = t_1;
} else if (t <= 3.6e-109) {
tmp = z * x;
} else if (t <= 1.15e-34) {
tmp = y * -x;
} else if (t <= 1.8e+34) {
tmp = z * x;
} 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) :: tmp
t_1 = t * (y - z)
if (t <= (-1d-142)) then
tmp = t_1
else if (t <= 3.6d-109) then
tmp = z * x
else if (t <= 1.15d-34) then
tmp = y * -x
else if (t <= 1.8d+34) then
tmp = z * x
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 = t * (y - z);
double tmp;
if (t <= -1e-142) {
tmp = t_1;
} else if (t <= 3.6e-109) {
tmp = z * x;
} else if (t <= 1.15e-34) {
tmp = y * -x;
} else if (t <= 1.8e+34) {
tmp = z * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (y - z) tmp = 0 if t <= -1e-142: tmp = t_1 elif t <= 3.6e-109: tmp = z * x elif t <= 1.15e-34: tmp = y * -x elif t <= 1.8e+34: tmp = z * x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(y - z)) tmp = 0.0 if (t <= -1e-142) tmp = t_1; elseif (t <= 3.6e-109) tmp = Float64(z * x); elseif (t <= 1.15e-34) tmp = Float64(y * Float64(-x)); elseif (t <= 1.8e+34) tmp = Float64(z * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (y - z); tmp = 0.0; if (t <= -1e-142) tmp = t_1; elseif (t <= 3.6e-109) tmp = z * x; elseif (t <= 1.15e-34) tmp = y * -x; elseif (t <= 1.8e+34) tmp = z * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1e-142], t$95$1, If[LessEqual[t, 3.6e-109], N[(z * x), $MachinePrecision], If[LessEqual[t, 1.15e-34], N[(y * (-x)), $MachinePrecision], If[LessEqual[t, 1.8e+34], N[(z * x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(y - z\right)\\
\mathbf{if}\;t \leq -1 \cdot 10^{-142}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{-109}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-34}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{+34}:\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1e-142 or 1.8e34 < t Initial program 100.0%
Taylor expanded in x around 0 93.7%
fma-def94.4%
+-commutative94.4%
mul-1-neg94.4%
neg-sub094.4%
associate-+l-94.4%
associate--r+94.4%
+-commutative94.4%
neg-sub094.4%
distribute-rgt-neg-in94.4%
mul-1-neg94.4%
mul-1-neg94.4%
distribute-rgt-neg-in94.4%
neg-sub094.4%
+-commutative94.4%
associate--r+94.4%
associate-+l-94.4%
neg-sub094.4%
mul-1-neg94.4%
+-commutative94.4%
mul-1-neg94.4%
Simplified94.4%
Taylor expanded in t around inf 77.6%
if -1e-142 < t < 3.6000000000000001e-109 or 1.15000000000000006e-34 < t < 1.8e34Initial program 100.0%
Taylor expanded in x around 0 97.8%
fma-def100.0%
+-commutative100.0%
mul-1-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
associate--r+100.0%
+-commutative100.0%
neg-sub0100.0%
distribute-rgt-neg-in100.0%
mul-1-neg100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
+-commutative100.0%
associate--r+100.0%
associate-+l-100.0%
neg-sub0100.0%
mul-1-neg100.0%
+-commutative100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 61.6%
Taylor expanded in t around 0 49.7%
if 3.6000000000000001e-109 < t < 1.15000000000000006e-34Initial program 99.9%
Taylor expanded in x around 0 99.8%
fma-def99.8%
+-commutative99.8%
mul-1-neg99.8%
neg-sub099.8%
associate-+l-99.8%
associate--r+99.8%
+-commutative99.8%
neg-sub099.8%
distribute-rgt-neg-in99.8%
mul-1-neg99.8%
mul-1-neg99.8%
distribute-rgt-neg-in99.8%
neg-sub099.8%
+-commutative99.8%
associate--r+99.8%
associate-+l-99.8%
neg-sub099.8%
mul-1-neg99.8%
+-commutative99.8%
mul-1-neg99.8%
Simplified99.8%
Taylor expanded in y around inf 70.8%
neg-mul-170.8%
sub-neg70.8%
Simplified70.8%
Taylor expanded in t around 0 56.2%
associate-*r*56.2%
mul-1-neg56.2%
Simplified56.2%
Final simplification65.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))) (t_2 (+ x (* y t))))
(if (<= z -1.7e-8)
t_1
(if (<= z -3e-305)
t_2
(if (<= z 1.02e-252) (* y (- t x)) (if (<= z 3.6e+48) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double t_2 = x + (y * t);
double tmp;
if (z <= -1.7e-8) {
tmp = t_1;
} else if (z <= -3e-305) {
tmp = t_2;
} else if (z <= 1.02e-252) {
tmp = y * (t - x);
} else if (z <= 3.6e+48) {
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 * (x - t)
t_2 = x + (y * t)
if (z <= (-1.7d-8)) then
tmp = t_1
else if (z <= (-3d-305)) then
tmp = t_2
else if (z <= 1.02d-252) then
tmp = y * (t - x)
else if (z <= 3.6d+48) 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 * (x - t);
double t_2 = x + (y * t);
double tmp;
if (z <= -1.7e-8) {
tmp = t_1;
} else if (z <= -3e-305) {
tmp = t_2;
} else if (z <= 1.02e-252) {
tmp = y * (t - x);
} else if (z <= 3.6e+48) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) t_2 = x + (y * t) tmp = 0 if z <= -1.7e-8: tmp = t_1 elif z <= -3e-305: tmp = t_2 elif z <= 1.02e-252: tmp = y * (t - x) elif z <= 3.6e+48: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) t_2 = Float64(x + Float64(y * t)) tmp = 0.0 if (z <= -1.7e-8) tmp = t_1; elseif (z <= -3e-305) tmp = t_2; elseif (z <= 1.02e-252) tmp = Float64(y * Float64(t - x)); elseif (z <= 3.6e+48) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); t_2 = x + (y * t); tmp = 0.0; if (z <= -1.7e-8) tmp = t_1; elseif (z <= -3e-305) tmp = t_2; elseif (z <= 1.02e-252) tmp = y * (t - x); elseif (z <= 3.6e+48) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7e-8], t$95$1, If[LessEqual[z, -3e-305], t$95$2, If[LessEqual[z, 1.02e-252], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e+48], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
t_2 := x + y \cdot t\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{-8}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-305}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-252}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+48}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.7e-8 or 3.59999999999999983e48 < z Initial program 100.0%
Taylor expanded in x around 0 93.6%
fma-def95.7%
+-commutative95.7%
mul-1-neg95.7%
neg-sub095.7%
associate-+l-95.7%
associate--r+95.7%
+-commutative95.7%
neg-sub095.7%
distribute-rgt-neg-in95.7%
mul-1-neg95.7%
mul-1-neg95.7%
distribute-rgt-neg-in95.7%
neg-sub095.7%
+-commutative95.7%
associate--r+95.7%
associate-+l-95.7%
neg-sub095.7%
mul-1-neg95.7%
+-commutative95.7%
mul-1-neg95.7%
Simplified95.7%
Taylor expanded in z around inf 85.5%
mul-1-neg85.5%
sub-neg85.5%
Simplified85.5%
if -1.7e-8 < z < -3.0000000000000001e-305 or 1.02000000000000002e-252 < z < 3.59999999999999983e48Initial program 100.0%
Taylor expanded in t around inf 82.6%
Taylor expanded in z around 0 73.5%
*-commutative73.5%
Simplified73.5%
if -3.0000000000000001e-305 < z < 1.02000000000000002e-252Initial program 100.0%
Taylor expanded in x around 0 100.0%
fma-def100.0%
+-commutative100.0%
mul-1-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
associate--r+100.0%
+-commutative100.0%
neg-sub0100.0%
distribute-rgt-neg-in100.0%
mul-1-neg100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
+-commutative100.0%
associate--r+100.0%
associate-+l-100.0%
neg-sub0100.0%
mul-1-neg100.0%
+-commutative100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
neg-mul-1100.0%
sub-neg100.0%
Simplified100.0%
Final simplification81.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))))
(if (<= z -0.72)
t_1
(if (<= z -3e-102)
(* x (- 1.0 y))
(if (<= z 3.1e+43) (* y (- t x)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -0.72) {
tmp = t_1;
} else if (z <= -3e-102) {
tmp = x * (1.0 - y);
} else if (z <= 3.1e+43) {
tmp = y * (t - x);
} 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) :: tmp
t_1 = z * (x - t)
if (z <= (-0.72d0)) then
tmp = t_1
else if (z <= (-3d-102)) then
tmp = x * (1.0d0 - y)
else if (z <= 3.1d+43) then
tmp = y * (t - x)
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 * (x - t);
double tmp;
if (z <= -0.72) {
tmp = t_1;
} else if (z <= -3e-102) {
tmp = x * (1.0 - y);
} else if (z <= 3.1e+43) {
tmp = y * (t - x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) tmp = 0 if z <= -0.72: tmp = t_1 elif z <= -3e-102: tmp = x * (1.0 - y) elif z <= 3.1e+43: tmp = y * (t - x) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) tmp = 0.0 if (z <= -0.72) tmp = t_1; elseif (z <= -3e-102) tmp = Float64(x * Float64(1.0 - y)); elseif (z <= 3.1e+43) tmp = Float64(y * Float64(t - x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); tmp = 0.0; if (z <= -0.72) tmp = t_1; elseif (z <= -3e-102) tmp = x * (1.0 - y); elseif (z <= 3.1e+43) tmp = y * (t - x); else tmp = 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, -0.72], t$95$1, If[LessEqual[z, -3e-102], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.1e+43], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -0.72:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-102}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+43}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -0.71999999999999997 or 3.1000000000000002e43 < z Initial program 100.0%
Taylor expanded in x around 0 93.5%
fma-def95.7%
+-commutative95.7%
mul-1-neg95.7%
neg-sub095.7%
associate-+l-95.7%
associate--r+95.7%
+-commutative95.7%
neg-sub095.7%
distribute-rgt-neg-in95.7%
mul-1-neg95.7%
mul-1-neg95.7%
distribute-rgt-neg-in95.7%
neg-sub095.7%
+-commutative95.7%
associate--r+95.7%
associate-+l-95.7%
neg-sub095.7%
mul-1-neg95.7%
+-commutative95.7%
mul-1-neg95.7%
Simplified95.7%
Taylor expanded in z around inf 86.6%
mul-1-neg86.6%
sub-neg86.6%
Simplified86.6%
if -0.71999999999999997 < z < -3e-102Initial program 100.0%
Taylor expanded in x around 0 99.9%
fma-def99.9%
+-commutative99.9%
mul-1-neg99.9%
neg-sub099.9%
associate-+l-99.9%
associate--r+99.9%
+-commutative99.9%
neg-sub099.9%
distribute-rgt-neg-in99.9%
mul-1-neg99.9%
mul-1-neg99.9%
distribute-rgt-neg-in99.9%
neg-sub099.9%
+-commutative99.9%
associate--r+99.9%
associate-+l-99.9%
neg-sub099.9%
mul-1-neg99.9%
+-commutative99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 82.2%
+-commutative82.2%
fma-def82.2%
*-commutative82.2%
Simplified82.2%
Taylor expanded in x around inf 69.7%
if -3e-102 < z < 3.1000000000000002e43Initial program 100.0%
Taylor expanded in x around 0 98.0%
fma-def98.0%
+-commutative98.0%
mul-1-neg98.0%
neg-sub098.0%
associate-+l-98.0%
associate--r+98.0%
+-commutative98.0%
neg-sub098.0%
distribute-rgt-neg-in98.0%
mul-1-neg98.0%
mul-1-neg98.0%
distribute-rgt-neg-in98.0%
neg-sub098.0%
+-commutative98.0%
associate--r+98.0%
associate-+l-98.0%
neg-sub098.0%
mul-1-neg98.0%
+-commutative98.0%
mul-1-neg98.0%
Simplified98.0%
Taylor expanded in y around inf 68.0%
neg-mul-168.0%
sub-neg68.0%
Simplified68.0%
Final simplification78.2%
(FPCore (x y z t) :precision binary64 (if (<= z -1.7e-8) (* z x) (if (<= z -1.4e-99) x (if (<= z 3.2e+46) (* y t) (* z x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.7e-8) {
tmp = z * x;
} else if (z <= -1.4e-99) {
tmp = x;
} else if (z <= 3.2e+46) {
tmp = y * t;
} else {
tmp = z * 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 (z <= (-1.7d-8)) then
tmp = z * x
else if (z <= (-1.4d-99)) then
tmp = x
else if (z <= 3.2d+46) then
tmp = y * t
else
tmp = z * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.7e-8) {
tmp = z * x;
} else if (z <= -1.4e-99) {
tmp = x;
} else if (z <= 3.2e+46) {
tmp = y * t;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.7e-8: tmp = z * x elif z <= -1.4e-99: tmp = x elif z <= 3.2e+46: tmp = y * t else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.7e-8) tmp = Float64(z * x); elseif (z <= -1.4e-99) tmp = x; elseif (z <= 3.2e+46) tmp = Float64(y * t); else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.7e-8) tmp = z * x; elseif (z <= -1.4e-99) tmp = x; elseif (z <= 3.2e+46) tmp = y * t; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.7e-8], N[(z * x), $MachinePrecision], If[LessEqual[z, -1.4e-99], x, If[LessEqual[z, 3.2e+46], N[(y * t), $MachinePrecision], N[(z * x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{-8}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-99}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+46}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -1.7e-8 or 3.1999999999999998e46 < z Initial program 100.0%
Taylor expanded in x around 0 93.6%
fma-def95.7%
+-commutative95.7%
mul-1-neg95.7%
neg-sub095.7%
associate-+l-95.7%
associate--r+95.7%
+-commutative95.7%
neg-sub095.7%
distribute-rgt-neg-in95.7%
mul-1-neg95.7%
mul-1-neg95.7%
distribute-rgt-neg-in95.7%
neg-sub095.7%
+-commutative95.7%
associate--r+95.7%
associate-+l-95.7%
neg-sub095.7%
mul-1-neg95.7%
+-commutative95.7%
mul-1-neg95.7%
Simplified95.7%
Taylor expanded in z around inf 87.6%
Taylor expanded in t around 0 50.5%
if -1.7e-8 < z < -1.4e-99Initial program 100.0%
Taylor expanded in t around inf 86.0%
Taylor expanded in x around inf 51.9%
if -1.4e-99 < z < 3.1999999999999998e46Initial program 100.0%
Taylor expanded in t around inf 79.0%
Taylor expanded in y around inf 48.7%
*-commutative48.7%
Simplified48.7%
Final simplification49.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -250.0) (not (<= z 1.08e+43))) (* z (- x t)) (+ x (* y (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -250.0) || !(z <= 1.08e+43)) {
tmp = z * (x - t);
} else {
tmp = x + (y * (t - 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 ((z <= (-250.0d0)) .or. (.not. (z <= 1.08d+43))) then
tmp = z * (x - t)
else
tmp = x + (y * (t - x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -250.0) || !(z <= 1.08e+43)) {
tmp = z * (x - t);
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -250.0) or not (z <= 1.08e+43): tmp = z * (x - t) else: tmp = x + (y * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -250.0) || !(z <= 1.08e+43)) tmp = Float64(z * Float64(x - t)); else tmp = Float64(x + Float64(y * Float64(t - x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -250.0) || ~((z <= 1.08e+43))) tmp = z * (x - t); else tmp = x + (y * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -250.0], N[Not[LessEqual[z, 1.08e+43]], $MachinePrecision]], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -250 \lor \neg \left(z \leq 1.08 \cdot 10^{+43}\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\end{array}
\end{array}
if z < -250 or 1.08e43 < z Initial program 100.0%
Taylor expanded in x around 0 93.5%
fma-def95.7%
+-commutative95.7%
mul-1-neg95.7%
neg-sub095.7%
associate-+l-95.7%
associate--r+95.7%
+-commutative95.7%
neg-sub095.7%
distribute-rgt-neg-in95.7%
mul-1-neg95.7%
mul-1-neg95.7%
distribute-rgt-neg-in95.7%
neg-sub095.7%
+-commutative95.7%
associate--r+95.7%
associate-+l-95.7%
neg-sub095.7%
mul-1-neg95.7%
+-commutative95.7%
mul-1-neg95.7%
Simplified95.7%
Taylor expanded in z around inf 86.6%
mul-1-neg86.6%
sub-neg86.6%
Simplified86.6%
if -250 < z < 1.08e43Initial program 100.0%
Taylor expanded in y around inf 90.2%
*-commutative90.2%
Simplified90.2%
Final simplification88.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* y (- t x)))) (if (<= y -2.3e+47) t_1 (if (<= y 4.8e+16) (+ x (* z (- x t))) (+ x t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -2.3e+47) {
tmp = t_1;
} else if (y <= 4.8e+16) {
tmp = x + (z * (x - t));
} 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 = y * (t - x)
if (y <= (-2.3d+47)) then
tmp = t_1
else if (y <= 4.8d+16) then
tmp = x + (z * (x - t))
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 = y * (t - x);
double tmp;
if (y <= -2.3e+47) {
tmp = t_1;
} else if (y <= 4.8e+16) {
tmp = x + (z * (x - t));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) tmp = 0 if y <= -2.3e+47: tmp = t_1 elif y <= 4.8e+16: tmp = x + (z * (x - t)) else: tmp = x + t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -2.3e+47) tmp = t_1; elseif (y <= 4.8e+16) tmp = Float64(x + Float64(z * Float64(x - t))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); tmp = 0.0; if (y <= -2.3e+47) tmp = t_1; elseif (y <= 4.8e+16) tmp = x + (z * (x - t)); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.3e+47], t$95$1, If[LessEqual[y, 4.8e+16], N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -2.3 \cdot 10^{+47}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+16}:\\
\;\;\;\;x + z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + t_1\\
\end{array}
\end{array}
if y < -2.2999999999999999e47Initial program 99.9%
Taylor expanded in x around 0 96.8%
fma-def96.8%
+-commutative96.8%
mul-1-neg96.8%
neg-sub096.8%
associate-+l-96.8%
associate--r+96.8%
+-commutative96.8%
neg-sub096.8%
distribute-rgt-neg-in96.8%
mul-1-neg96.8%
mul-1-neg96.8%
distribute-rgt-neg-in96.8%
neg-sub096.8%
+-commutative96.8%
associate--r+96.8%
associate-+l-96.8%
neg-sub096.8%
mul-1-neg96.8%
+-commutative96.8%
mul-1-neg96.8%
Simplified96.8%
Taylor expanded in y around inf 90.6%
neg-mul-190.6%
sub-neg90.6%
Simplified90.6%
if -2.2999999999999999e47 < y < 4.8e16Initial program 100.0%
Taylor expanded in y around 0 90.4%
mul-1-neg90.4%
unsub-neg90.4%
Simplified90.4%
if 4.8e16 < y Initial program 100.0%
Taylor expanded in y around inf 86.0%
*-commutative86.0%
Simplified86.0%
Final simplification89.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.7e-8) (not (<= z 2.6e-8))) (* z x) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.7e-8) || !(z <= 2.6e-8)) {
tmp = z * x;
} 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 ((z <= (-1.7d-8)) .or. (.not. (z <= 2.6d-8))) then
tmp = z * x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.7e-8) || !(z <= 2.6e-8)) {
tmp = z * x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.7e-8) or not (z <= 2.6e-8): tmp = z * x else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.7e-8) || !(z <= 2.6e-8)) tmp = Float64(z * x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.7e-8) || ~((z <= 2.6e-8))) tmp = z * x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.7e-8], N[Not[LessEqual[z, 2.6e-8]], $MachinePrecision]], N[(z * x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{-8} \lor \neg \left(z \leq 2.6 \cdot 10^{-8}\right):\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.7e-8 or 2.6000000000000001e-8 < z Initial program 100.0%
Taylor expanded in x around 0 94.0%
fma-def96.0%
+-commutative96.0%
mul-1-neg96.0%
neg-sub096.0%
associate-+l-96.0%
associate--r+96.0%
+-commutative96.0%
neg-sub096.0%
distribute-rgt-neg-in96.0%
mul-1-neg96.0%
mul-1-neg96.0%
distribute-rgt-neg-in96.0%
neg-sub096.0%
+-commutative96.0%
associate--r+96.0%
associate-+l-96.0%
neg-sub096.0%
mul-1-neg96.0%
+-commutative96.0%
mul-1-neg96.0%
Simplified96.0%
Taylor expanded in z around inf 87.2%
Taylor expanded in t around 0 48.3%
if -1.7e-8 < z < 2.6000000000000001e-8Initial program 100.0%
Taylor expanded in t around inf 80.1%
Taylor expanded in x around inf 31.5%
Final simplification41.3%
(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 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 62.4%
Taylor expanded in x around inf 14.6%
Final simplification14.6%
(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 2024019
(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))))