
(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 18 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-define100.0%
Simplified100.0%
(FPCore (x y z t)
:precision binary64
(if (or (<= t -1.05e+65)
(not
(or (<= t -4800000000000.0)
(and (not (<= t -3.35e-100)) (<= t 1.75e-39)))))
(* (- y z) t)
(* x (+ (- z y) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.05e+65) || !((t <= -4800000000000.0) || (!(t <= -3.35e-100) && (t <= 1.75e-39)))) {
tmp = (y - z) * t;
} else {
tmp = x * ((z - y) + 1.0);
}
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 <= (-1.05d+65)) .or. (.not. (t <= (-4800000000000.0d0)) .or. (.not. (t <= (-3.35d-100))) .and. (t <= 1.75d-39))) then
tmp = (y - z) * t
else
tmp = x * ((z - y) + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.05e+65) || !((t <= -4800000000000.0) || (!(t <= -3.35e-100) && (t <= 1.75e-39)))) {
tmp = (y - z) * t;
} else {
tmp = x * ((z - y) + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.05e+65) or not ((t <= -4800000000000.0) or (not (t <= -3.35e-100) and (t <= 1.75e-39))): tmp = (y - z) * t else: tmp = x * ((z - y) + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.05e+65) || !((t <= -4800000000000.0) || (!(t <= -3.35e-100) && (t <= 1.75e-39)))) tmp = Float64(Float64(y - z) * t); else tmp = Float64(x * Float64(Float64(z - y) + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.05e+65) || ~(((t <= -4800000000000.0) || (~((t <= -3.35e-100)) && (t <= 1.75e-39))))) tmp = (y - z) * t; else tmp = x * ((z - y) + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.05e+65], N[Not[Or[LessEqual[t, -4800000000000.0], And[N[Not[LessEqual[t, -3.35e-100]], $MachinePrecision], LessEqual[t, 1.75e-39]]]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+65} \lor \neg \left(t \leq -4800000000000 \lor \neg \left(t \leq -3.35 \cdot 10^{-100}\right) \land t \leq 1.75 \cdot 10^{-39}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\
\end{array}
\end{array}
if t < -1.04999999999999996e65 or -4.8e12 < t < -3.34999999999999986e-100 or 1.75e-39 < t Initial program 100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in t around inf 87.4%
Taylor expanded in t around inf 81.6%
if -1.04999999999999996e65 < t < -4.8e12 or -3.34999999999999986e-100 < t < 1.75e-39Initial program 99.9%
Taylor expanded in x around inf 85.4%
mul-1-neg85.4%
unsub-neg85.4%
Simplified85.4%
Final simplification83.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))))
(if (<= y -7.8e+87)
t_1
(if (<= y -2e+28)
(* (- y z) t)
(if (<= y -8e-61)
(* x (+ z 1.0))
(if (<= y 6000000000.0) (- x (* z t)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -7.8e+87) {
tmp = t_1;
} else if (y <= -2e+28) {
tmp = (y - z) * t;
} else if (y <= -8e-61) {
tmp = x * (z + 1.0);
} else if (y <= 6000000000.0) {
tmp = x - (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) :: tmp
t_1 = y * (t - x)
if (y <= (-7.8d+87)) then
tmp = t_1
else if (y <= (-2d+28)) then
tmp = (y - z) * t
else if (y <= (-8d-61)) then
tmp = x * (z + 1.0d0)
else if (y <= 6000000000.0d0) then
tmp = x - (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 = y * (t - x);
double tmp;
if (y <= -7.8e+87) {
tmp = t_1;
} else if (y <= -2e+28) {
tmp = (y - z) * t;
} else if (y <= -8e-61) {
tmp = x * (z + 1.0);
} else if (y <= 6000000000.0) {
tmp = x - (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) tmp = 0 if y <= -7.8e+87: tmp = t_1 elif y <= -2e+28: tmp = (y - z) * t elif y <= -8e-61: tmp = x * (z + 1.0) elif y <= 6000000000.0: tmp = x - (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -7.8e+87) tmp = t_1; elseif (y <= -2e+28) tmp = Float64(Float64(y - z) * t); elseif (y <= -8e-61) tmp = Float64(x * Float64(z + 1.0)); elseif (y <= 6000000000.0) tmp = Float64(x - Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); tmp = 0.0; if (y <= -7.8e+87) tmp = t_1; elseif (y <= -2e+28) tmp = (y - z) * t; elseif (y <= -8e-61) tmp = x * (z + 1.0); elseif (y <= 6000000000.0) tmp = x - (z * t); else tmp = 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, -7.8e+87], t$95$1, If[LessEqual[y, -2e+28], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, -8e-61], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6000000000.0], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -7.8 \cdot 10^{+87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2 \cdot 10^{+28}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{elif}\;y \leq -8 \cdot 10^{-61}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{elif}\;y \leq 6000000000:\\
\;\;\;\;x - z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.80000000000000039e87 or 6e9 < y Initial program 100.0%
Taylor expanded in y around inf 90.0%
+-commutative90.0%
associate--l+90.0%
+-commutative90.0%
mul-1-neg90.0%
unsub-neg90.0%
div-sub90.0%
unsub-neg90.0%
mul-1-neg90.0%
+-commutative90.0%
Simplified90.0%
Taylor expanded in y around inf 88.9%
if -7.80000000000000039e87 < y < -1.99999999999999992e28Initial program 100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in t around inf 88.5%
Taylor expanded in t around inf 88.5%
if -1.99999999999999992e28 < y < -8.0000000000000003e-61Initial program 100.0%
Taylor expanded in x around inf 85.1%
mul-1-neg85.1%
unsub-neg85.1%
Simplified85.1%
Taylor expanded in y around 0 71.0%
+-commutative71.0%
Simplified71.0%
if -8.0000000000000003e-61 < y < 6e9Initial program 99.9%
Taylor expanded in t around inf 83.6%
Taylor expanded in y around 0 74.2%
mul-1-neg74.2%
unsub-neg74.2%
Simplified74.2%
Final simplification80.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))))
(if (<= y -1.35e+88)
t_1
(if (<= y -4.8e+27)
(* (- y z) t)
(if (<= y 4.3e-297)
(* x (+ z 1.0))
(if (<= y 880000000000.0) (* z (- x t)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -1.35e+88) {
tmp = t_1;
} else if (y <= -4.8e+27) {
tmp = (y - z) * t;
} else if (y <= 4.3e-297) {
tmp = x * (z + 1.0);
} else if (y <= 880000000000.0) {
tmp = z * (x - 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) :: tmp
t_1 = y * (t - x)
if (y <= (-1.35d+88)) then
tmp = t_1
else if (y <= (-4.8d+27)) then
tmp = (y - z) * t
else if (y <= 4.3d-297) then
tmp = x * (z + 1.0d0)
else if (y <= 880000000000.0d0) then
tmp = z * (x - 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 = y * (t - x);
double tmp;
if (y <= -1.35e+88) {
tmp = t_1;
} else if (y <= -4.8e+27) {
tmp = (y - z) * t;
} else if (y <= 4.3e-297) {
tmp = x * (z + 1.0);
} else if (y <= 880000000000.0) {
tmp = z * (x - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) tmp = 0 if y <= -1.35e+88: tmp = t_1 elif y <= -4.8e+27: tmp = (y - z) * t elif y <= 4.3e-297: tmp = x * (z + 1.0) elif y <= 880000000000.0: tmp = z * (x - t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -1.35e+88) tmp = t_1; elseif (y <= -4.8e+27) tmp = Float64(Float64(y - z) * t); elseif (y <= 4.3e-297) tmp = Float64(x * Float64(z + 1.0)); elseif (y <= 880000000000.0) tmp = Float64(z * Float64(x - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); tmp = 0.0; if (y <= -1.35e+88) tmp = t_1; elseif (y <= -4.8e+27) tmp = (y - z) * t; elseif (y <= 4.3e-297) tmp = x * (z + 1.0); elseif (y <= 880000000000.0) tmp = z * (x - t); else tmp = 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, -1.35e+88], t$95$1, If[LessEqual[y, -4.8e+27], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, 4.3e-297], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 880000000000.0], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -1.35 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -4.8 \cdot 10^{+27}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{elif}\;y \leq 4.3 \cdot 10^{-297}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{elif}\;y \leq 880000000000:\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.35000000000000008e88 or 8.8e11 < y Initial program 100.0%
Taylor expanded in y around inf 90.0%
+-commutative90.0%
associate--l+90.0%
+-commutative90.0%
mul-1-neg90.0%
unsub-neg90.0%
div-sub90.0%
unsub-neg90.0%
mul-1-neg90.0%
+-commutative90.0%
Simplified90.0%
Taylor expanded in y around inf 88.9%
if -1.35000000000000008e88 < y < -4.79999999999999995e27Initial program 100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in t around inf 88.5%
Taylor expanded in t around inf 88.5%
if -4.79999999999999995e27 < y < 4.3000000000000003e-297Initial program 100.0%
Taylor expanded in x around inf 68.8%
mul-1-neg68.8%
unsub-neg68.8%
Simplified68.8%
Taylor expanded in y around 0 64.7%
+-commutative64.7%
Simplified64.7%
if 4.3000000000000003e-297 < y < 8.8e11Initial program 99.9%
Taylor expanded in y around 0 90.1%
mul-1-neg90.1%
unsub-neg90.1%
Simplified90.1%
Taylor expanded in z around inf 66.2%
Final simplification75.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))) (t_2 (* (- y z) t)))
(if (<= y -7.7e+87)
t_1
(if (<= y -7.2e+27)
t_2
(if (<= y 2.5e-296) (* x (+ z 1.0)) (if (<= y 1.45e+14) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = (y - z) * t;
double tmp;
if (y <= -7.7e+87) {
tmp = t_1;
} else if (y <= -7.2e+27) {
tmp = t_2;
} else if (y <= 2.5e-296) {
tmp = x * (z + 1.0);
} else if (y <= 1.45e+14) {
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 = y * (t - x)
t_2 = (y - z) * t
if (y <= (-7.7d+87)) then
tmp = t_1
else if (y <= (-7.2d+27)) then
tmp = t_2
else if (y <= 2.5d-296) then
tmp = x * (z + 1.0d0)
else if (y <= 1.45d+14) 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 = y * (t - x);
double t_2 = (y - z) * t;
double tmp;
if (y <= -7.7e+87) {
tmp = t_1;
} else if (y <= -7.2e+27) {
tmp = t_2;
} else if (y <= 2.5e-296) {
tmp = x * (z + 1.0);
} else if (y <= 1.45e+14) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = (y - z) * t tmp = 0 if y <= -7.7e+87: tmp = t_1 elif y <= -7.2e+27: tmp = t_2 elif y <= 2.5e-296: tmp = x * (z + 1.0) elif y <= 1.45e+14: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) t_2 = Float64(Float64(y - z) * t) tmp = 0.0 if (y <= -7.7e+87) tmp = t_1; elseif (y <= -7.2e+27) tmp = t_2; elseif (y <= 2.5e-296) tmp = Float64(x * Float64(z + 1.0)); elseif (y <= 1.45e+14) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); t_2 = (y - z) * t; tmp = 0.0; if (y <= -7.7e+87) tmp = t_1; elseif (y <= -7.2e+27) tmp = t_2; elseif (y <= 2.5e-296) tmp = x * (z + 1.0); elseif (y <= 1.45e+14) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[y, -7.7e+87], t$95$1, If[LessEqual[y, -7.2e+27], t$95$2, If[LessEqual[y, 2.5e-296], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e+14], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := \left(y - z\right) \cdot t\\
\mathbf{if}\;y \leq -7.7 \cdot 10^{+87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -7.2 \cdot 10^{+27}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-296}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+14}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.70000000000000031e87 or 1.45e14 < y Initial program 100.0%
Taylor expanded in y around inf 90.0%
+-commutative90.0%
associate--l+90.0%
+-commutative90.0%
mul-1-neg90.0%
unsub-neg90.0%
div-sub90.0%
unsub-neg90.0%
mul-1-neg90.0%
+-commutative90.0%
Simplified90.0%
Taylor expanded in y around inf 88.9%
if -7.70000000000000031e87 < y < -7.19999999999999966e27 or 2.50000000000000015e-296 < y < 1.45e14Initial program 99.9%
+-commutative99.9%
fma-define100.0%
Simplified100.0%
Taylor expanded in t around inf 84.1%
Taylor expanded in t around inf 62.9%
if -7.19999999999999966e27 < y < 2.50000000000000015e-296Initial program 100.0%
Taylor expanded in x around inf 68.8%
mul-1-neg68.8%
unsub-neg68.8%
Simplified68.8%
Taylor expanded in y around 0 64.7%
+-commutative64.7%
Simplified64.7%
Final simplification73.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))))
(if (<= z -1.2e+63)
t_1
(if (<= z 1.25e-277) (* y t) (if (<= z 2e-17) x t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (z <= -1.2e+63) {
tmp = t_1;
} else if (z <= 1.25e-277) {
tmp = y * t;
} else if (z <= 2e-17) {
tmp = 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 * -t
if (z <= (-1.2d+63)) then
tmp = t_1
else if (z <= 1.25d-277) then
tmp = y * t
else if (z <= 2d-17) then
tmp = 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 * -t;
double tmp;
if (z <= -1.2e+63) {
tmp = t_1;
} else if (z <= 1.25e-277) {
tmp = y * t;
} else if (z <= 2e-17) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t tmp = 0 if z <= -1.2e+63: tmp = t_1 elif z <= 1.25e-277: tmp = y * t elif z <= 2e-17: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) tmp = 0.0 if (z <= -1.2e+63) tmp = t_1; elseif (z <= 1.25e-277) tmp = Float64(y * t); elseif (z <= 2e-17) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; tmp = 0.0; if (z <= -1.2e+63) tmp = t_1; elseif (z <= 1.25e-277) tmp = y * t; elseif (z <= 2e-17) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[z, -1.2e+63], t$95$1, If[LessEqual[z, 1.25e-277], N[(y * t), $MachinePrecision], If[LessEqual[z, 2e-17], x, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
\mathbf{if}\;z \leq -1.2 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-277}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-17}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.2e63 or 2.00000000000000014e-17 < z Initial program 100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in t around inf 58.0%
Taylor expanded in z around inf 48.2%
associate-*r*48.2%
mul-1-neg48.2%
Simplified48.2%
if -1.2e63 < z < 1.25e-277Initial program 100.0%
Taylor expanded in y around inf 83.8%
+-commutative83.8%
associate--l+83.8%
+-commutative83.8%
mul-1-neg83.8%
unsub-neg83.8%
div-sub85.4%
unsub-neg85.4%
mul-1-neg85.4%
+-commutative85.4%
Simplified85.4%
Taylor expanded in t around inf 49.1%
neg-mul-149.1%
sub-neg49.1%
Simplified49.1%
Taylor expanded in z around 0 46.2%
if 1.25e-277 < z < 2.00000000000000014e-17Initial program 99.9%
Taylor expanded in t around inf 77.7%
Taylor expanded in x around inf 46.7%
Final simplification47.3%
(FPCore (x y z t) :precision binary64 (if (<= z -6e+50) (* z x) (if (<= z 6.8e-279) (* y t) (if (<= z 6.5e-14) x (* z x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6e+50) {
tmp = z * x;
} else if (z <= 6.8e-279) {
tmp = y * t;
} else if (z <= 6.5e-14) {
tmp = x;
} 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 <= (-6d+50)) then
tmp = z * x
else if (z <= 6.8d-279) then
tmp = y * t
else if (z <= 6.5d-14) then
tmp = x
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 <= -6e+50) {
tmp = z * x;
} else if (z <= 6.8e-279) {
tmp = y * t;
} else if (z <= 6.5e-14) {
tmp = x;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -6e+50: tmp = z * x elif z <= 6.8e-279: tmp = y * t elif z <= 6.5e-14: tmp = x else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -6e+50) tmp = Float64(z * x); elseif (z <= 6.8e-279) tmp = Float64(y * t); elseif (z <= 6.5e-14) tmp = x; else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -6e+50) tmp = z * x; elseif (z <= 6.8e-279) tmp = y * t; elseif (z <= 6.5e-14) tmp = x; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6e+50], N[(z * x), $MachinePrecision], If[LessEqual[z, 6.8e-279], N[(y * t), $MachinePrecision], If[LessEqual[z, 6.5e-14], x, N[(z * x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+50}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-279}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-14}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -5.9999999999999996e50 or 6.5000000000000001e-14 < z Initial program 100.0%
Taylor expanded in x around inf 50.1%
mul-1-neg50.1%
unsub-neg50.1%
Simplified50.1%
Taylor expanded in z around inf 35.5%
if -5.9999999999999996e50 < z < 6.8000000000000003e-279Initial program 100.0%
Taylor expanded in y around inf 84.7%
+-commutative84.7%
associate--l+84.7%
+-commutative84.7%
mul-1-neg84.7%
unsub-neg84.7%
div-sub85.1%
unsub-neg85.1%
mul-1-neg85.1%
+-commutative85.1%
Simplified85.1%
Taylor expanded in t around inf 49.0%
neg-mul-149.0%
sub-neg49.0%
Simplified49.0%
Taylor expanded in z around 0 46.0%
if 6.8000000000000003e-279 < z < 6.5000000000000001e-14Initial program 99.9%
Taylor expanded in t around inf 77.7%
Taylor expanded in x around inf 46.7%
Final simplification41.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.3e+70) (not (<= y 1.08e+15))) (* y (- t x)) (+ x (* z (- x t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.3e+70) || !(y <= 1.08e+15)) {
tmp = y * (t - x);
} else {
tmp = x + (z * (x - 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 ((y <= (-1.3d+70)) .or. (.not. (y <= 1.08d+15))) then
tmp = y * (t - x)
else
tmp = x + (z * (x - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.3e+70) || !(y <= 1.08e+15)) {
tmp = y * (t - x);
} else {
tmp = x + (z * (x - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.3e+70) or not (y <= 1.08e+15): tmp = y * (t - x) else: tmp = x + (z * (x - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.3e+70) || !(y <= 1.08e+15)) tmp = Float64(y * Float64(t - x)); else tmp = Float64(x + Float64(z * Float64(x - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.3e+70) || ~((y <= 1.08e+15))) tmp = y * (t - x); else tmp = x + (z * (x - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.3e+70], N[Not[LessEqual[y, 1.08e+15]], $MachinePrecision]], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{+70} \lor \neg \left(y \leq 1.08 \cdot 10^{+15}\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(x - t\right)\\
\end{array}
\end{array}
if y < -1.3e70 or 1.08e15 < y Initial program 100.0%
Taylor expanded in y around inf 90.2%
+-commutative90.2%
associate--l+90.2%
+-commutative90.2%
mul-1-neg90.2%
unsub-neg90.2%
div-sub90.2%
unsub-neg90.2%
mul-1-neg90.2%
+-commutative90.2%
Simplified90.2%
Taylor expanded in y around inf 89.1%
if -1.3e70 < y < 1.08e15Initial program 99.9%
Taylor expanded in y around 0 85.8%
mul-1-neg85.8%
unsub-neg85.8%
Simplified85.8%
Final simplification87.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.22e-100) (not (<= t 4.9e-54))) (+ x (* (- y z) t)) (* x (+ (- z y) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.22e-100) || !(t <= 4.9e-54)) {
tmp = x + ((y - z) * t);
} else {
tmp = x * ((z - y) + 1.0);
}
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 <= (-2.22d-100)) .or. (.not. (t <= 4.9d-54))) then
tmp = x + ((y - z) * t)
else
tmp = x * ((z - y) + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.22e-100) || !(t <= 4.9e-54)) {
tmp = x + ((y - z) * t);
} else {
tmp = x * ((z - y) + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.22e-100) or not (t <= 4.9e-54): tmp = x + ((y - z) * t) else: tmp = x * ((z - y) + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.22e-100) || !(t <= 4.9e-54)) tmp = Float64(x + Float64(Float64(y - z) * t)); else tmp = Float64(x * Float64(Float64(z - y) + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2.22e-100) || ~((t <= 4.9e-54))) tmp = x + ((y - z) * t); else tmp = x * ((z - y) + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.22e-100], N[Not[LessEqual[t, 4.9e-54]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.22 \cdot 10^{-100} \lor \neg \left(t \leq 4.9 \cdot 10^{-54}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\
\end{array}
\end{array}
if t < -2.2199999999999999e-100 or 4.90000000000000021e-54 < t Initial program 100.0%
Taylor expanded in t around inf 84.6%
if -2.2199999999999999e-100 < t < 4.90000000000000021e-54Initial program 99.9%
Taylor expanded in x around inf 87.0%
mul-1-neg87.0%
unsub-neg87.0%
Simplified87.0%
Final simplification85.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.02e+51) (not (<= z 4e+44))) (* z (- x t)) (+ x (* y (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.02e+51) || !(z <= 4e+44)) {
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 <= (-1.02d+51)) .or. (.not. (z <= 4d+44))) 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 <= -1.02e+51) || !(z <= 4e+44)) {
tmp = z * (x - t);
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.02e+51) or not (z <= 4e+44): tmp = z * (x - t) else: tmp = x + (y * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.02e+51) || !(z <= 4e+44)) 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 <= -1.02e+51) || ~((z <= 4e+44))) tmp = z * (x - t); else tmp = x + (y * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.02e+51], N[Not[LessEqual[z, 4e+44]], $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 -1.02 \cdot 10^{+51} \lor \neg \left(z \leq 4 \cdot 10^{+44}\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\end{array}
\end{array}
if z < -1.02e51 or 4.0000000000000004e44 < z Initial program 100.0%
Taylor expanded in y around 0 81.6%
mul-1-neg81.6%
unsub-neg81.6%
Simplified81.6%
Taylor expanded in z around inf 81.6%
if -1.02e51 < z < 4.0000000000000004e44Initial program 99.9%
Taylor expanded in y around inf 88.6%
*-commutative88.6%
Simplified88.6%
Final simplification85.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5e+51) (not (<= z 2.1e-15))) (* z (- x t)) (+ x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5e+51) || !(z <= 2.1e-15)) {
tmp = z * (x - t);
} else {
tmp = x + (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 <= (-5d+51)) .or. (.not. (z <= 2.1d-15))) then
tmp = z * (x - t)
else
tmp = x + (y * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5e+51) || !(z <= 2.1e-15)) {
tmp = z * (x - t);
} else {
tmp = x + (y * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5e+51) or not (z <= 2.1e-15): tmp = z * (x - t) else: tmp = x + (y * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5e+51) || !(z <= 2.1e-15)) tmp = Float64(z * Float64(x - t)); else tmp = Float64(x + Float64(y * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -5e+51) || ~((z <= 2.1e-15))) tmp = z * (x - t); else tmp = x + (y * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5e+51], N[Not[LessEqual[z, 2.1e-15]], $MachinePrecision]], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+51} \lor \neg \left(z \leq 2.1 \cdot 10^{-15}\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot t\\
\end{array}
\end{array}
if z < -5e51 or 2.09999999999999981e-15 < z Initial program 100.0%
Taylor expanded in y around 0 77.2%
mul-1-neg77.2%
unsub-neg77.2%
Simplified77.2%
Taylor expanded in z around inf 77.2%
if -5e51 < z < 2.09999999999999981e-15Initial program 99.9%
Taylor expanded in t around inf 78.6%
Taylor expanded in y around inf 70.9%
Final simplification74.0%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.22e-100) (not (<= t 3.7e-61))) (* (- y z) t) (* x (- 1.0 y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.22e-100) || !(t <= 3.7e-61)) {
tmp = (y - z) * t;
} else {
tmp = x * (1.0 - 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 <= (-2.22d-100)) .or. (.not. (t <= 3.7d-61))) then
tmp = (y - z) * t
else
tmp = x * (1.0d0 - y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.22e-100) || !(t <= 3.7e-61)) {
tmp = (y - z) * t;
} else {
tmp = x * (1.0 - y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.22e-100) or not (t <= 3.7e-61): tmp = (y - z) * t else: tmp = x * (1.0 - y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.22e-100) || !(t <= 3.7e-61)) tmp = Float64(Float64(y - z) * t); else tmp = Float64(x * Float64(1.0 - y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2.22e-100) || ~((t <= 3.7e-61))) tmp = (y - z) * t; else tmp = x * (1.0 - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.22e-100], N[Not[LessEqual[t, 3.7e-61]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.22 \cdot 10^{-100} \lor \neg \left(t \leq 3.7 \cdot 10^{-61}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\end{array}
\end{array}
if t < -2.2199999999999999e-100 or 3.7e-61 < t Initial program 100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in t around inf 84.1%
Taylor expanded in t around inf 75.1%
if -2.2199999999999999e-100 < t < 3.7e-61Initial program 99.9%
Taylor expanded in x around inf 86.8%
mul-1-neg86.8%
unsub-neg86.8%
Simplified86.8%
Taylor expanded in z around 0 62.6%
Final simplification70.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -3.2e-100) (not (<= t 7.4e-38))) (* (- y z) t) (* x (+ z 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.2e-100) || !(t <= 7.4e-38)) {
tmp = (y - z) * t;
} else {
tmp = x * (z + 1.0);
}
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 <= (-3.2d-100)) .or. (.not. (t <= 7.4d-38))) then
tmp = (y - z) * t
else
tmp = x * (z + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.2e-100) || !(t <= 7.4e-38)) {
tmp = (y - z) * t;
} else {
tmp = x * (z + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -3.2e-100) or not (t <= 7.4e-38): tmp = (y - z) * t else: tmp = x * (z + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -3.2e-100) || !(t <= 7.4e-38)) tmp = Float64(Float64(y - z) * t); else tmp = Float64(x * Float64(z + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -3.2e-100) || ~((t <= 7.4e-38))) tmp = (y - z) * t; else tmp = x * (z + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.2e-100], N[Not[LessEqual[t, 7.4e-38]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{-100} \lor \neg \left(t \leq 7.4 \cdot 10^{-38}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\end{array}
\end{array}
if t < -3.20000000000000017e-100 or 7.4e-38 < t Initial program 100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in t around inf 84.4%
Taylor expanded in t around inf 75.9%
if -3.20000000000000017e-100 < t < 7.4e-38Initial program 99.9%
Taylor expanded in x around inf 86.3%
mul-1-neg86.3%
unsub-neg86.3%
Simplified86.3%
Taylor expanded in y around 0 56.8%
+-commutative56.8%
Simplified56.8%
Final simplification68.3%
(FPCore (x y z t) :precision binary64 (if (<= x -4.1e+149) (* z x) (if (<= x 1.25e+32) (* (- y z) t) (* y (- x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.1e+149) {
tmp = z * x;
} else if (x <= 1.25e+32) {
tmp = (y - z) * t;
} else {
tmp = y * -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 (x <= (-4.1d+149)) then
tmp = z * x
else if (x <= 1.25d+32) then
tmp = (y - z) * t
else
tmp = y * -x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.1e+149) {
tmp = z * x;
} else if (x <= 1.25e+32) {
tmp = (y - z) * t;
} else {
tmp = y * -x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4.1e+149: tmp = z * x elif x <= 1.25e+32: tmp = (y - z) * t else: tmp = y * -x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -4.1e+149) tmp = Float64(z * x); elseif (x <= 1.25e+32) tmp = Float64(Float64(y - z) * t); else tmp = Float64(y * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -4.1e+149) tmp = z * x; elseif (x <= 1.25e+32) tmp = (y - z) * t; else tmp = y * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -4.1e+149], N[(z * x), $MachinePrecision], If[LessEqual[x, 1.25e+32], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], N[(y * (-x)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.1 \cdot 10^{+149}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{+32}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\end{array}
\end{array}
if x < -4.0999999999999996e149Initial program 100.0%
Taylor expanded in x around inf 97.5%
mul-1-neg97.5%
unsub-neg97.5%
Simplified97.5%
Taylor expanded in z around inf 42.5%
if -4.0999999999999996e149 < x < 1.2499999999999999e32Initial program 99.9%
+-commutative99.9%
fma-define100.0%
Simplified100.0%
Taylor expanded in t around inf 80.5%
Taylor expanded in t around inf 68.2%
if 1.2499999999999999e32 < x Initial program 100.0%
Taylor expanded in x around inf 92.8%
mul-1-neg92.8%
unsub-neg92.8%
Simplified92.8%
Taylor expanded in y around inf 47.4%
neg-mul-147.4%
Simplified47.4%
Final simplification60.7%
(FPCore (x y z t) :precision binary64 (if (<= x -2.65e+91) (* z x) (if (<= x 1.45e+20) (* y t) (* y (- x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.65e+91) {
tmp = z * x;
} else if (x <= 1.45e+20) {
tmp = y * t;
} else {
tmp = y * -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 (x <= (-2.65d+91)) then
tmp = z * x
else if (x <= 1.45d+20) then
tmp = y * t
else
tmp = y * -x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.65e+91) {
tmp = z * x;
} else if (x <= 1.45e+20) {
tmp = y * t;
} else {
tmp = y * -x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.65e+91: tmp = z * x elif x <= 1.45e+20: tmp = y * t else: tmp = y * -x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.65e+91) tmp = Float64(z * x); elseif (x <= 1.45e+20) tmp = Float64(y * t); else tmp = Float64(y * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.65e+91) tmp = z * x; elseif (x <= 1.45e+20) tmp = y * t; else tmp = y * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.65e+91], N[(z * x), $MachinePrecision], If[LessEqual[x, 1.45e+20], N[(y * t), $MachinePrecision], N[(y * (-x)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.65 \cdot 10^{+91}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{+20}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\end{array}
\end{array}
if x < -2.64999999999999998e91Initial program 100.0%
Taylor expanded in x around inf 90.2%
mul-1-neg90.2%
unsub-neg90.2%
Simplified90.2%
Taylor expanded in z around inf 41.3%
if -2.64999999999999998e91 < x < 1.45e20Initial program 99.9%
Taylor expanded in y around inf 86.4%
+-commutative86.4%
associate--l+86.4%
+-commutative86.4%
mul-1-neg86.4%
unsub-neg86.4%
div-sub86.4%
unsub-neg86.4%
mul-1-neg86.4%
+-commutative86.4%
Simplified86.4%
Taylor expanded in t around inf 58.6%
neg-mul-158.6%
sub-neg58.6%
Simplified58.6%
Taylor expanded in z around 0 39.1%
if 1.45e20 < x Initial program 100.0%
Taylor expanded in x around inf 91.1%
mul-1-neg91.1%
unsub-neg91.1%
Simplified91.1%
Taylor expanded in y around inf 44.5%
neg-mul-144.5%
Simplified44.5%
Final simplification40.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 6.5e-14))) (* z x) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 6.5e-14)) {
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.0d0)) .or. (.not. (z <= 6.5d-14))) 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.0) || !(z <= 6.5e-14)) {
tmp = z * x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.0) or not (z <= 6.5e-14): tmp = z * x else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || !(z <= 6.5e-14)) 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.0) || ~((z <= 6.5e-14))) tmp = z * x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 6.5e-14]], $MachinePrecision]], N[(z * x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 6.5 \cdot 10^{-14}\right):\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1 or 6.5000000000000001e-14 < z Initial program 100.0%
Taylor expanded in x around inf 49.8%
mul-1-neg49.8%
unsub-neg49.8%
Simplified49.8%
Taylor expanded in z around inf 34.5%
if -1 < z < 6.5000000000000001e-14Initial program 99.9%
Taylor expanded in t around inf 79.0%
Taylor expanded in x around inf 37.0%
Final simplification35.7%
(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}
Initial program 100.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 68.4%
Taylor expanded in x around inf 19.3%
(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 2024123
(FPCore (x y z t)
:name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
:precision binary64
:alt
(! :herbie-platform default (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
(+ x (* (- y z) (- t x))))