
(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 (+ 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
(if (<= z -5.2e+195)
(* x z)
(if (<= z -2.3e-101)
(* t (- z))
(if (<= z -2.2e-246)
(* y (- x))
(if (<= z 3.9e-244)
(* y t)
(if (<= z 1.25e-21) x (if (<= z 9.5e+62) (* y t) (* x z))))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.2e+195) {
tmp = x * z;
} else if (z <= -2.3e-101) {
tmp = t * -z;
} else if (z <= -2.2e-246) {
tmp = y * -x;
} else if (z <= 3.9e-244) {
tmp = y * t;
} else if (z <= 1.25e-21) {
tmp = x;
} else if (z <= 9.5e+62) {
tmp = y * t;
} else {
tmp = x * z;
}
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 <= (-5.2d+195)) then
tmp = x * z
else if (z <= (-2.3d-101)) then
tmp = t * -z
else if (z <= (-2.2d-246)) then
tmp = y * -x
else if (z <= 3.9d-244) then
tmp = y * t
else if (z <= 1.25d-21) then
tmp = x
else if (z <= 9.5d+62) then
tmp = y * t
else
tmp = x * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.2e+195) {
tmp = x * z;
} else if (z <= -2.3e-101) {
tmp = t * -z;
} else if (z <= -2.2e-246) {
tmp = y * -x;
} else if (z <= 3.9e-244) {
tmp = y * t;
} else if (z <= 1.25e-21) {
tmp = x;
} else if (z <= 9.5e+62) {
tmp = y * t;
} else {
tmp = x * z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.2e+195: tmp = x * z elif z <= -2.3e-101: tmp = t * -z elif z <= -2.2e-246: tmp = y * -x elif z <= 3.9e-244: tmp = y * t elif z <= 1.25e-21: tmp = x elif z <= 9.5e+62: tmp = y * t else: tmp = x * z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.2e+195) tmp = Float64(x * z); elseif (z <= -2.3e-101) tmp = Float64(t * Float64(-z)); elseif (z <= -2.2e-246) tmp = Float64(y * Float64(-x)); elseif (z <= 3.9e-244) tmp = Float64(y * t); elseif (z <= 1.25e-21) tmp = x; elseif (z <= 9.5e+62) tmp = Float64(y * t); else tmp = Float64(x * z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.2e+195) tmp = x * z; elseif (z <= -2.3e-101) tmp = t * -z; elseif (z <= -2.2e-246) tmp = y * -x; elseif (z <= 3.9e-244) tmp = y * t; elseif (z <= 1.25e-21) tmp = x; elseif (z <= 9.5e+62) tmp = y * t; else tmp = x * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.2e+195], N[(x * z), $MachinePrecision], If[LessEqual[z, -2.3e-101], N[(t * (-z)), $MachinePrecision], If[LessEqual[z, -2.2e-246], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 3.9e-244], N[(y * t), $MachinePrecision], If[LessEqual[z, 1.25e-21], x, If[LessEqual[z, 9.5e+62], N[(y * t), $MachinePrecision], N[(x * z), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+195}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-101}:\\
\;\;\;\;t \cdot \left(-z\right)\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-246}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-244}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-21}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+62}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot z\\
\end{array}
\end{array}
if z < -5.20000000000000004e195 or 9.5000000000000003e62 < z Initial program 100.0%
Taylor expanded in t around 0 56.9%
mul-1-neg56.9%
distribute-rgt-neg-in56.9%
sub-neg56.9%
+-commutative56.9%
distribute-neg-in56.9%
remove-double-neg56.9%
sub-neg56.9%
Simplified56.9%
Taylor expanded in z around inf 52.1%
Taylor expanded in z around inf 52.1%
if -5.20000000000000004e195 < z < -2.2999999999999999e-101Initial program 99.9%
Taylor expanded in t around inf 72.7%
Taylor expanded in y around 0 53.7%
mul-1-neg53.7%
unsub-neg53.7%
*-commutative53.7%
Simplified53.7%
Taylor expanded in x around 0 50.2%
associate-*r*50.2%
neg-mul-150.2%
Simplified50.2%
if -2.2999999999999999e-101 < z < -2.19999999999999998e-246Initial program 100.0%
Taylor expanded in t around 0 77.3%
mul-1-neg77.3%
distribute-rgt-neg-in77.3%
sub-neg77.3%
+-commutative77.3%
distribute-neg-in77.3%
remove-double-neg77.3%
sub-neg77.3%
Simplified77.3%
Taylor expanded in z around 0 77.3%
mul-1-neg77.3%
*-rgt-identity77.3%
distribute-rgt-neg-out77.3%
distribute-lft-in77.3%
unsub-neg77.3%
Simplified77.3%
Taylor expanded in y around inf 51.4%
mul-1-neg51.4%
distribute-rgt-neg-in51.4%
Simplified51.4%
if -2.19999999999999998e-246 < z < 3.8999999999999999e-244 or 1.24999999999999993e-21 < z < 9.5000000000000003e62Initial program 100.0%
Taylor expanded in y around inf 88.8%
*-commutative88.8%
Simplified88.8%
*-commutative88.8%
sub-neg88.8%
distribute-lft-in84.5%
Applied egg-rr84.5%
associate-+r+84.5%
distribute-rgt-neg-out84.5%
unsub-neg84.5%
+-commutative84.5%
Applied egg-rr84.5%
Taylor expanded in t around inf 53.1%
*-commutative53.1%
Simplified53.1%
if 3.8999999999999999e-244 < z < 1.24999999999999993e-21Initial program 100.0%
Taylor expanded in y around inf 89.5%
*-commutative89.5%
Simplified89.5%
Taylor expanded in y around 0 55.7%
Final simplification52.3%
(FPCore (x y z t)
:precision binary64
(if (<= z -145000000.0)
(* x z)
(if (<= z -3.1e-243)
(* y (- x))
(if (<= z 4.8e-240)
(* y t)
(if (<= z 5.5e-37) x (if (<= z 3.2e+62) (* y t) (* x z)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -145000000.0) {
tmp = x * z;
} else if (z <= -3.1e-243) {
tmp = y * -x;
} else if (z <= 4.8e-240) {
tmp = y * t;
} else if (z <= 5.5e-37) {
tmp = x;
} else if (z <= 3.2e+62) {
tmp = y * t;
} else {
tmp = x * z;
}
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 <= (-145000000.0d0)) then
tmp = x * z
else if (z <= (-3.1d-243)) then
tmp = y * -x
else if (z <= 4.8d-240) then
tmp = y * t
else if (z <= 5.5d-37) then
tmp = x
else if (z <= 3.2d+62) then
tmp = y * t
else
tmp = x * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -145000000.0) {
tmp = x * z;
} else if (z <= -3.1e-243) {
tmp = y * -x;
} else if (z <= 4.8e-240) {
tmp = y * t;
} else if (z <= 5.5e-37) {
tmp = x;
} else if (z <= 3.2e+62) {
tmp = y * t;
} else {
tmp = x * z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -145000000.0: tmp = x * z elif z <= -3.1e-243: tmp = y * -x elif z <= 4.8e-240: tmp = y * t elif z <= 5.5e-37: tmp = x elif z <= 3.2e+62: tmp = y * t else: tmp = x * z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -145000000.0) tmp = Float64(x * z); elseif (z <= -3.1e-243) tmp = Float64(y * Float64(-x)); elseif (z <= 4.8e-240) tmp = Float64(y * t); elseif (z <= 5.5e-37) tmp = x; elseif (z <= 3.2e+62) tmp = Float64(y * t); else tmp = Float64(x * z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -145000000.0) tmp = x * z; elseif (z <= -3.1e-243) tmp = y * -x; elseif (z <= 4.8e-240) tmp = y * t; elseif (z <= 5.5e-37) tmp = x; elseif (z <= 3.2e+62) tmp = y * t; else tmp = x * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -145000000.0], N[(x * z), $MachinePrecision], If[LessEqual[z, -3.1e-243], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 4.8e-240], N[(y * t), $MachinePrecision], If[LessEqual[z, 5.5e-37], x, If[LessEqual[z, 3.2e+62], N[(y * t), $MachinePrecision], N[(x * z), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -145000000:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;z \leq -3.1 \cdot 10^{-243}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-240}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-37}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+62}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot z\\
\end{array}
\end{array}
if z < -1.45e8 or 3.19999999999999984e62 < z Initial program 100.0%
Taylor expanded in t around 0 51.0%
mul-1-neg51.0%
distribute-rgt-neg-in51.0%
sub-neg51.0%
+-commutative51.0%
distribute-neg-in51.0%
remove-double-neg51.0%
sub-neg51.0%
Simplified51.0%
Taylor expanded in z around inf 45.9%
Taylor expanded in z around inf 45.9%
if -1.45e8 < z < -3.0999999999999999e-243Initial program 100.0%
Taylor expanded in t around 0 60.4%
mul-1-neg60.4%
distribute-rgt-neg-in60.4%
sub-neg60.4%
+-commutative60.4%
distribute-neg-in60.4%
remove-double-neg60.4%
sub-neg60.4%
Simplified60.4%
Taylor expanded in z around 0 60.5%
mul-1-neg60.5%
*-rgt-identity60.5%
distribute-rgt-neg-out60.5%
distribute-lft-in60.5%
unsub-neg60.5%
Simplified60.5%
Taylor expanded in y around inf 40.7%
mul-1-neg40.7%
distribute-rgt-neg-in40.7%
Simplified40.7%
if -3.0999999999999999e-243 < z < 4.7999999999999999e-240 or 5.4999999999999998e-37 < z < 3.19999999999999984e62Initial program 100.0%
Taylor expanded in y around inf 88.8%
*-commutative88.8%
Simplified88.8%
*-commutative88.8%
sub-neg88.8%
distribute-lft-in84.5%
Applied egg-rr84.5%
associate-+r+84.5%
distribute-rgt-neg-out84.5%
unsub-neg84.5%
+-commutative84.5%
Applied egg-rr84.5%
Taylor expanded in t around inf 53.1%
*-commutative53.1%
Simplified53.1%
if 4.7999999999999999e-240 < z < 5.4999999999999998e-37Initial program 100.0%
Taylor expanded in y around inf 89.5%
*-commutative89.5%
Simplified89.5%
Taylor expanded in y around 0 55.7%
Final simplification47.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))))
(if (<= y -5.8e-9)
t_1
(if (<= y 4.1e-255)
(* t (- z))
(if (<= y 1.14e-184)
(* x z)
(if (<= y 980000000000.0) (* x (- 1.0 y)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -5.8e-9) {
tmp = t_1;
} else if (y <= 4.1e-255) {
tmp = t * -z;
} else if (y <= 1.14e-184) {
tmp = x * z;
} else if (y <= 980000000000.0) {
tmp = x * (1.0 - y);
} 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 <= (-5.8d-9)) then
tmp = t_1
else if (y <= 4.1d-255) then
tmp = t * -z
else if (y <= 1.14d-184) then
tmp = x * z
else if (y <= 980000000000.0d0) then
tmp = x * (1.0d0 - y)
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 <= -5.8e-9) {
tmp = t_1;
} else if (y <= 4.1e-255) {
tmp = t * -z;
} else if (y <= 1.14e-184) {
tmp = x * z;
} else if (y <= 980000000000.0) {
tmp = x * (1.0 - y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) tmp = 0 if y <= -5.8e-9: tmp = t_1 elif y <= 4.1e-255: tmp = t * -z elif y <= 1.14e-184: tmp = x * z elif y <= 980000000000.0: tmp = x * (1.0 - y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -5.8e-9) tmp = t_1; elseif (y <= 4.1e-255) tmp = Float64(t * Float64(-z)); elseif (y <= 1.14e-184) tmp = Float64(x * z); elseif (y <= 980000000000.0) tmp = Float64(x * Float64(1.0 - y)); 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 <= -5.8e-9) tmp = t_1; elseif (y <= 4.1e-255) tmp = t * -z; elseif (y <= 1.14e-184) tmp = x * z; elseif (y <= 980000000000.0) tmp = x * (1.0 - y); 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, -5.8e-9], t$95$1, If[LessEqual[y, 4.1e-255], N[(t * (-z)), $MachinePrecision], If[LessEqual[y, 1.14e-184], N[(x * z), $MachinePrecision], If[LessEqual[y, 980000000000.0], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -5.8 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{-255}:\\
\;\;\;\;t \cdot \left(-z\right)\\
\mathbf{elif}\;y \leq 1.14 \cdot 10^{-184}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;y \leq 980000000000:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.79999999999999982e-9 or 9.8e11 < y Initial program 100.0%
Taylor expanded in y around inf 77.0%
*-commutative77.0%
Simplified77.0%
*-commutative77.0%
sub-neg77.0%
distribute-lft-in75.5%
Applied egg-rr75.5%
associate-+r+75.5%
distribute-rgt-neg-out75.5%
unsub-neg75.5%
+-commutative75.5%
Applied egg-rr75.5%
Taylor expanded in y around inf 76.1%
if -5.79999999999999982e-9 < y < 4.1e-255Initial program 100.0%
Taylor expanded in t around inf 77.2%
Taylor expanded in y around 0 71.8%
mul-1-neg71.8%
unsub-neg71.8%
*-commutative71.8%
Simplified71.8%
Taylor expanded in x around 0 49.3%
associate-*r*49.3%
neg-mul-149.3%
Simplified49.3%
if 4.1e-255 < y < 1.13999999999999997e-184Initial program 100.0%
Taylor expanded in t around 0 64.8%
mul-1-neg64.8%
distribute-rgt-neg-in64.8%
sub-neg64.8%
+-commutative64.8%
distribute-neg-in64.8%
remove-double-neg64.8%
sub-neg64.8%
Simplified64.8%
Taylor expanded in z around inf 64.8%
Taylor expanded in z around inf 52.9%
if 1.13999999999999997e-184 < y < 9.8e11Initial program 100.0%
Taylor expanded in t around 0 73.2%
mul-1-neg73.2%
distribute-rgt-neg-in73.2%
sub-neg73.2%
+-commutative73.2%
distribute-neg-in73.2%
remove-double-neg73.2%
sub-neg73.2%
Simplified73.2%
Taylor expanded in z around 0 49.0%
mul-1-neg49.0%
*-rgt-identity49.0%
distribute-rgt-neg-out49.0%
distribute-lft-in49.0%
unsub-neg49.0%
Simplified49.0%
Final simplification63.7%
(FPCore (x y z t)
:precision binary64
(if (<= z -150000000.0)
(* x z)
(if (<= z 1.8e-237)
(* y t)
(if (<= z 5.4e-27) x (if (<= z 3.9e+62) (* y t) (* x z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -150000000.0) {
tmp = x * z;
} else if (z <= 1.8e-237) {
tmp = y * t;
} else if (z <= 5.4e-27) {
tmp = x;
} else if (z <= 3.9e+62) {
tmp = y * t;
} else {
tmp = x * z;
}
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 <= (-150000000.0d0)) then
tmp = x * z
else if (z <= 1.8d-237) then
tmp = y * t
else if (z <= 5.4d-27) then
tmp = x
else if (z <= 3.9d+62) then
tmp = y * t
else
tmp = x * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -150000000.0) {
tmp = x * z;
} else if (z <= 1.8e-237) {
tmp = y * t;
} else if (z <= 5.4e-27) {
tmp = x;
} else if (z <= 3.9e+62) {
tmp = y * t;
} else {
tmp = x * z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -150000000.0: tmp = x * z elif z <= 1.8e-237: tmp = y * t elif z <= 5.4e-27: tmp = x elif z <= 3.9e+62: tmp = y * t else: tmp = x * z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -150000000.0) tmp = Float64(x * z); elseif (z <= 1.8e-237) tmp = Float64(y * t); elseif (z <= 5.4e-27) tmp = x; elseif (z <= 3.9e+62) tmp = Float64(y * t); else tmp = Float64(x * z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -150000000.0) tmp = x * z; elseif (z <= 1.8e-237) tmp = y * t; elseif (z <= 5.4e-27) tmp = x; elseif (z <= 3.9e+62) tmp = y * t; else tmp = x * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -150000000.0], N[(x * z), $MachinePrecision], If[LessEqual[z, 1.8e-237], N[(y * t), $MachinePrecision], If[LessEqual[z, 5.4e-27], x, If[LessEqual[z, 3.9e+62], N[(y * t), $MachinePrecision], N[(x * z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -150000000:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-237}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-27}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+62}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot z\\
\end{array}
\end{array}
if z < -1.5e8 or 3.9e62 < z Initial program 100.0%
Taylor expanded in t around 0 51.0%
mul-1-neg51.0%
distribute-rgt-neg-in51.0%
sub-neg51.0%
+-commutative51.0%
distribute-neg-in51.0%
remove-double-neg51.0%
sub-neg51.0%
Simplified51.0%
Taylor expanded in z around inf 45.9%
Taylor expanded in z around inf 45.9%
if -1.5e8 < z < 1.79999999999999998e-237 or 5.39999999999999978e-27 < z < 3.9e62Initial program 100.0%
Taylor expanded in y around inf 84.5%
*-commutative84.5%
Simplified84.5%
*-commutative84.5%
sub-neg84.5%
distribute-lft-in82.6%
Applied egg-rr82.6%
associate-+r+82.6%
distribute-rgt-neg-out82.6%
unsub-neg82.6%
+-commutative82.6%
Applied egg-rr82.6%
Taylor expanded in t around inf 39.1%
*-commutative39.1%
Simplified39.1%
if 1.79999999999999998e-237 < z < 5.39999999999999978e-27Initial program 100.0%
Taylor expanded in y around inf 89.5%
*-commutative89.5%
Simplified89.5%
Taylor expanded in y around 0 55.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))))
(if (<= y -2.45e-8)
(+ x t_1)
(if (<= y 4.3e-254)
(- x (* z t))
(if (<= y 7.5e+19) (+ x (* x (- z y))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -2.45e-8) {
tmp = x + t_1;
} else if (y <= 4.3e-254) {
tmp = x - (z * t);
} else if (y <= 7.5e+19) {
tmp = x + (x * (z - y));
} 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 <= (-2.45d-8)) then
tmp = x + t_1
else if (y <= 4.3d-254) then
tmp = x - (z * t)
else if (y <= 7.5d+19) then
tmp = x + (x * (z - y))
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 <= -2.45e-8) {
tmp = x + t_1;
} else if (y <= 4.3e-254) {
tmp = x - (z * t);
} else if (y <= 7.5e+19) {
tmp = x + (x * (z - y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) tmp = 0 if y <= -2.45e-8: tmp = x + t_1 elif y <= 4.3e-254: tmp = x - (z * t) elif y <= 7.5e+19: tmp = x + (x * (z - y)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -2.45e-8) tmp = Float64(x + t_1); elseif (y <= 4.3e-254) tmp = Float64(x - Float64(z * t)); elseif (y <= 7.5e+19) tmp = Float64(x + Float64(x * Float64(z - y))); 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 <= -2.45e-8) tmp = x + t_1; elseif (y <= 4.3e-254) tmp = x - (z * t); elseif (y <= 7.5e+19) tmp = x + (x * (z - y)); 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, -2.45e-8], N[(x + t$95$1), $MachinePrecision], If[LessEqual[y, 4.3e-254], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e+19], N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -2.45 \cdot 10^{-8}:\\
\;\;\;\;x + t\_1\\
\mathbf{elif}\;y \leq 4.3 \cdot 10^{-254}:\\
\;\;\;\;x - z \cdot t\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+19}:\\
\;\;\;\;x + x \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.4500000000000001e-8Initial program 100.0%
Taylor expanded in y around inf 81.6%
*-commutative81.6%
Simplified81.6%
if -2.4500000000000001e-8 < y < 4.2999999999999997e-254Initial program 100.0%
Taylor expanded in t around inf 77.2%
Taylor expanded in y around 0 71.8%
mul-1-neg71.8%
unsub-neg71.8%
*-commutative71.8%
Simplified71.8%
if 4.2999999999999997e-254 < y < 7.5e19Initial program 100.0%
Taylor expanded in t around 0 70.7%
mul-1-neg70.7%
distribute-rgt-neg-in70.7%
sub-neg70.7%
+-commutative70.7%
distribute-neg-in70.7%
remove-double-neg70.7%
sub-neg70.7%
Simplified70.7%
if 7.5e19 < y Initial program 100.0%
Taylor expanded in y around inf 72.7%
*-commutative72.7%
Simplified72.7%
*-commutative72.7%
sub-neg72.7%
distribute-lft-in70.9%
Applied egg-rr70.9%
associate-+r+70.9%
distribute-rgt-neg-out70.9%
unsub-neg70.9%
+-commutative70.9%
Applied egg-rr70.9%
Taylor expanded in y around inf 72.7%
Final simplification74.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))))
(if (<= y -4.5e-7)
t_1
(if (<= y 3.3e-254)
(- x (* z t))
(if (<= y 2.75e+20) (+ x (* x (- z y))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -4.5e-7) {
tmp = t_1;
} else if (y <= 3.3e-254) {
tmp = x - (z * t);
} else if (y <= 2.75e+20) {
tmp = x + (x * (z - y));
} 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 <= (-4.5d-7)) then
tmp = t_1
else if (y <= 3.3d-254) then
tmp = x - (z * t)
else if (y <= 2.75d+20) then
tmp = x + (x * (z - y))
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 <= -4.5e-7) {
tmp = t_1;
} else if (y <= 3.3e-254) {
tmp = x - (z * t);
} else if (y <= 2.75e+20) {
tmp = x + (x * (z - y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) tmp = 0 if y <= -4.5e-7: tmp = t_1 elif y <= 3.3e-254: tmp = x - (z * t) elif y <= 2.75e+20: tmp = x + (x * (z - y)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -4.5e-7) tmp = t_1; elseif (y <= 3.3e-254) tmp = Float64(x - Float64(z * t)); elseif (y <= 2.75e+20) tmp = Float64(x + Float64(x * Float64(z - y))); 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 <= -4.5e-7) tmp = t_1; elseif (y <= 3.3e-254) tmp = x - (z * t); elseif (y <= 2.75e+20) tmp = x + (x * (z - y)); 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, -4.5e-7], t$95$1, If[LessEqual[y, 3.3e-254], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.75e+20], N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -4.5 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{-254}:\\
\;\;\;\;x - z \cdot t\\
\mathbf{elif}\;y \leq 2.75 \cdot 10^{+20}:\\
\;\;\;\;x + x \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.4999999999999998e-7 or 2.75e20 < y Initial program 100.0%
Taylor expanded in y around inf 77.7%
*-commutative77.7%
Simplified77.7%
*-commutative77.7%
sub-neg77.7%
distribute-lft-in76.2%
Applied egg-rr76.2%
associate-+r+76.2%
distribute-rgt-neg-out76.2%
unsub-neg76.2%
+-commutative76.2%
Applied egg-rr76.2%
Taylor expanded in y around inf 77.4%
if -4.4999999999999998e-7 < y < 3.30000000000000016e-254Initial program 100.0%
Taylor expanded in t around inf 76.8%
Taylor expanded in y around 0 71.5%
mul-1-neg71.5%
unsub-neg71.5%
*-commutative71.5%
Simplified71.5%
if 3.30000000000000016e-254 < y < 2.75e20Initial program 100.0%
Taylor expanded in t around 0 70.7%
mul-1-neg70.7%
distribute-rgt-neg-in70.7%
sub-neg70.7%
+-commutative70.7%
distribute-neg-in70.7%
remove-double-neg70.7%
sub-neg70.7%
Simplified70.7%
(FPCore (x y z t) :precision binary64 (if (<= z -5e+193) (* x z) (if (<= z -1e-33) (* t (- z)) (if (<= z 3.8e+39) (* x (- 1.0 y)) (* x z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5e+193) {
tmp = x * z;
} else if (z <= -1e-33) {
tmp = t * -z;
} else if (z <= 3.8e+39) {
tmp = x * (1.0 - y);
} else {
tmp = x * z;
}
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+193)) then
tmp = x * z
else if (z <= (-1d-33)) then
tmp = t * -z
else if (z <= 3.8d+39) then
tmp = x * (1.0d0 - y)
else
tmp = x * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5e+193) {
tmp = x * z;
} else if (z <= -1e-33) {
tmp = t * -z;
} else if (z <= 3.8e+39) {
tmp = x * (1.0 - y);
} else {
tmp = x * z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5e+193: tmp = x * z elif z <= -1e-33: tmp = t * -z elif z <= 3.8e+39: tmp = x * (1.0 - y) else: tmp = x * z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5e+193) tmp = Float64(x * z); elseif (z <= -1e-33) tmp = Float64(t * Float64(-z)); elseif (z <= 3.8e+39) tmp = Float64(x * Float64(1.0 - y)); else tmp = Float64(x * z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5e+193) tmp = x * z; elseif (z <= -1e-33) tmp = t * -z; elseif (z <= 3.8e+39) tmp = x * (1.0 - y); else tmp = x * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5e+193], N[(x * z), $MachinePrecision], If[LessEqual[z, -1e-33], N[(t * (-z)), $MachinePrecision], If[LessEqual[z, 3.8e+39], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], N[(x * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+193}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-33}:\\
\;\;\;\;t \cdot \left(-z\right)\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+39}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot z\\
\end{array}
\end{array}
if z < -4.99999999999999972e193 or 3.7999999999999998e39 < z Initial program 100.0%
Taylor expanded in t around 0 56.5%
mul-1-neg56.5%
distribute-rgt-neg-in56.5%
sub-neg56.5%
+-commutative56.5%
distribute-neg-in56.5%
remove-double-neg56.5%
sub-neg56.5%
Simplified56.5%
Taylor expanded in z around inf 50.9%
Taylor expanded in z around inf 50.9%
if -4.99999999999999972e193 < z < -1.0000000000000001e-33Initial program 99.9%
Taylor expanded in t around inf 73.0%
Taylor expanded in y around 0 52.1%
mul-1-neg52.1%
unsub-neg52.1%
*-commutative52.1%
Simplified52.1%
Taylor expanded in x around 0 52.0%
associate-*r*52.0%
neg-mul-152.0%
Simplified52.0%
if -1.0000000000000001e-33 < z < 3.7999999999999998e39Initial program 100.0%
Taylor expanded in t around 0 59.1%
mul-1-neg59.1%
distribute-rgt-neg-in59.1%
sub-neg59.1%
+-commutative59.1%
distribute-neg-in59.1%
remove-double-neg59.1%
sub-neg59.1%
Simplified59.1%
Taylor expanded in z around 0 59.1%
mul-1-neg59.1%
*-rgt-identity59.1%
distribute-rgt-neg-out59.1%
distribute-lft-in59.1%
unsub-neg59.1%
Simplified59.1%
Final simplification55.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.6e-10) (not (<= z 2.2e+64))) (+ x (* z (- x t))) (+ x (* y (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.6e-10) || !(z <= 2.2e+64)) {
tmp = x + (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 <= (-4.6d-10)) .or. (.not. (z <= 2.2d+64))) then
tmp = x + (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 <= -4.6e-10) || !(z <= 2.2e+64)) {
tmp = x + (z * (x - t));
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.6e-10) or not (z <= 2.2e+64): tmp = x + (z * (x - t)) else: tmp = x + (y * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.6e-10) || !(z <= 2.2e+64)) tmp = Float64(x + 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 <= -4.6e-10) || ~((z <= 2.2e+64))) tmp = x + (z * (x - t)); else tmp = x + (y * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.6e-10], N[Not[LessEqual[z, 2.2e+64]], $MachinePrecision]], N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{-10} \lor \neg \left(z \leq 2.2 \cdot 10^{+64}\right):\\
\;\;\;\;x + z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\end{array}
\end{array}
if z < -4.60000000000000014e-10 or 2.20000000000000002e64 < z Initial program 100.0%
Taylor expanded in y around 0 85.9%
mul-1-neg85.9%
unsub-neg85.9%
Simplified85.9%
if -4.60000000000000014e-10 < z < 2.20000000000000002e64Initial program 100.0%
Taylor expanded in y around inf 87.5%
*-commutative87.5%
Simplified87.5%
Final simplification86.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.05e+29) (not (<= t 2.1e-81))) (+ x (* t (- y z))) (+ x (* x (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.05e+29) || !(t <= 2.1e-81)) {
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 <= (-1.05d+29)) .or. (.not. (t <= 2.1d-81))) 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 <= -1.05e+29) || !(t <= 2.1e-81)) {
tmp = x + (t * (y - z));
} else {
tmp = x + (x * (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.05e+29) or not (t <= 2.1e-81): tmp = x + (t * (y - z)) else: tmp = x + (x * (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.05e+29) || !(t <= 2.1e-81)) 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 <= -1.05e+29) || ~((t <= 2.1e-81))) 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, -1.05e+29], N[Not[LessEqual[t, 2.1e-81]], $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 -1.05 \cdot 10^{+29} \lor \neg \left(t \leq 2.1 \cdot 10^{-81}\right):\\
\;\;\;\;x + t \cdot \left(y - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot \left(z - y\right)\\
\end{array}
\end{array}
if t < -1.0500000000000001e29 or 2.0999999999999999e-81 < t Initial program 100.0%
Taylor expanded in t around inf 86.5%
if -1.0500000000000001e29 < t < 2.0999999999999999e-81Initial program 100.0%
Taylor expanded in t around 0 84.4%
mul-1-neg84.4%
distribute-rgt-neg-in84.4%
sub-neg84.4%
+-commutative84.4%
distribute-neg-in84.4%
remove-double-neg84.4%
sub-neg84.4%
Simplified84.4%
Final simplification85.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5.2e-7) (not (<= y 490000000.0))) (* y (- t x)) (- x (* z t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.2e-7) || !(y <= 490000000.0)) {
tmp = y * (t - x);
} else {
tmp = x - (z * 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 <= (-5.2d-7)) .or. (.not. (y <= 490000000.0d0))) then
tmp = y * (t - x)
else
tmp = x - (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.2e-7) || !(y <= 490000000.0)) {
tmp = y * (t - x);
} else {
tmp = x - (z * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -5.2e-7) or not (y <= 490000000.0): tmp = y * (t - x) else: tmp = x - (z * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -5.2e-7) || !(y <= 490000000.0)) tmp = Float64(y * Float64(t - x)); else tmp = Float64(x - Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -5.2e-7) || ~((y <= 490000000.0))) tmp = y * (t - x); else tmp = x - (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5.2e-7], N[Not[LessEqual[y, 490000000.0]], $MachinePrecision]], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{-7} \lor \neg \left(y \leq 490000000\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot t\\
\end{array}
\end{array}
if y < -5.19999999999999998e-7 or 4.9e8 < y Initial program 100.0%
Taylor expanded in y around inf 77.0%
*-commutative77.0%
Simplified77.0%
*-commutative77.0%
sub-neg77.0%
distribute-lft-in75.5%
Applied egg-rr75.5%
associate-+r+75.5%
distribute-rgt-neg-out75.5%
unsub-neg75.5%
+-commutative75.5%
Applied egg-rr75.5%
Taylor expanded in y around inf 76.6%
if -5.19999999999999998e-7 < y < 4.9e8Initial program 100.0%
Taylor expanded in t around inf 72.4%
Taylor expanded in y around 0 67.3%
mul-1-neg67.3%
unsub-neg67.3%
*-commutative67.3%
Simplified67.3%
Final simplification72.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -6.4e-7) (not (<= y 29500.0))) (* y (- t x)) (+ x (* x z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.4e-7) || !(y <= 29500.0)) {
tmp = y * (t - x);
} else {
tmp = x + (x * z);
}
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 <= (-6.4d-7)) .or. (.not. (y <= 29500.0d0))) then
tmp = y * (t - x)
else
tmp = x + (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.4e-7) || !(y <= 29500.0)) {
tmp = y * (t - x);
} else {
tmp = x + (x * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -6.4e-7) or not (y <= 29500.0): tmp = y * (t - x) else: tmp = x + (x * z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -6.4e-7) || !(y <= 29500.0)) tmp = Float64(y * Float64(t - x)); else tmp = Float64(x + Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -6.4e-7) || ~((y <= 29500.0))) tmp = y * (t - x); else tmp = x + (x * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -6.4e-7], N[Not[LessEqual[y, 29500.0]], $MachinePrecision]], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.4 \cdot 10^{-7} \lor \neg \left(y \leq 29500\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot z\\
\end{array}
\end{array}
if y < -6.4000000000000001e-7 or 29500 < y Initial program 100.0%
Taylor expanded in y around inf 77.0%
*-commutative77.0%
Simplified77.0%
*-commutative77.0%
sub-neg77.0%
distribute-lft-in75.5%
Applied egg-rr75.5%
associate-+r+75.5%
distribute-rgt-neg-out75.5%
unsub-neg75.5%
+-commutative75.5%
Applied egg-rr75.5%
Taylor expanded in y around inf 76.6%
if -6.4000000000000001e-7 < y < 29500Initial program 100.0%
Taylor expanded in t around 0 59.9%
mul-1-neg59.9%
distribute-rgt-neg-in59.9%
sub-neg59.9%
+-commutative59.9%
distribute-neg-in59.9%
remove-double-neg59.9%
sub-neg59.9%
Simplified59.9%
Taylor expanded in z around inf 58.8%
Final simplification68.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -135000000.0) (not (<= z 3.9e-7))) (* x z) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -135000000.0) || !(z <= 3.9e-7)) {
tmp = x * z;
} 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 <= (-135000000.0d0)) .or. (.not. (z <= 3.9d-7))) then
tmp = x * z
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 <= -135000000.0) || !(z <= 3.9e-7)) {
tmp = x * z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -135000000.0) or not (z <= 3.9e-7): tmp = x * z else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -135000000.0) || !(z <= 3.9e-7)) tmp = Float64(x * z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -135000000.0) || ~((z <= 3.9e-7))) tmp = x * z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -135000000.0], N[Not[LessEqual[z, 3.9e-7]], $MachinePrecision]], N[(x * z), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -135000000 \lor \neg \left(z \leq 3.9 \cdot 10^{-7}\right):\\
\;\;\;\;x \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.35e8 or 3.90000000000000025e-7 < z Initial program 100.0%
Taylor expanded in t around 0 49.2%
mul-1-neg49.2%
distribute-rgt-neg-in49.2%
sub-neg49.2%
+-commutative49.2%
distribute-neg-in49.2%
remove-double-neg49.2%
sub-neg49.2%
Simplified49.2%
Taylor expanded in z around inf 42.4%
Taylor expanded in z around inf 42.4%
if -1.35e8 < z < 3.90000000000000025e-7Initial program 100.0%
Taylor expanded in y around inf 87.9%
*-commutative87.9%
Simplified87.9%
Taylor expanded in y around 0 31.3%
Final simplification37.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 y around inf 58.7%
*-commutative58.7%
Simplified58.7%
Taylor expanded in y around 0 16.7%
(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 2024133
(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))))