
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - 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 * (y - z)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - 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 * (y - z)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.2e-22) (not (<= z 4.8e-101))) (/ x (/ (- t z) (- y z))) (* (- y z) (/ x (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.2e-22) || !(z <= 4.8e-101)) {
tmp = x / ((t - z) / (y - z));
} else {
tmp = (y - z) * (x / (t - 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 <= (-1.2d-22)) .or. (.not. (z <= 4.8d-101))) then
tmp = x / ((t - z) / (y - z))
else
tmp = (y - z) * (x / (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.2e-22) || !(z <= 4.8e-101)) {
tmp = x / ((t - z) / (y - z));
} else {
tmp = (y - z) * (x / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.2e-22) or not (z <= 4.8e-101): tmp = x / ((t - z) / (y - z)) else: tmp = (y - z) * (x / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.2e-22) || !(z <= 4.8e-101)) tmp = Float64(x / Float64(Float64(t - z) / Float64(y - z))); else tmp = Float64(Float64(y - z) * Float64(x / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.2e-22) || ~((z <= 4.8e-101))) tmp = x / ((t - z) / (y - z)); else tmp = (y - z) * (x / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.2e-22], N[Not[LessEqual[z, 4.8e-101]], $MachinePrecision]], N[(x / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{-22} \lor \neg \left(z \leq 4.8 \cdot 10^{-101}\right):\\
\;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\
\end{array}
\end{array}
if z < -1.20000000000000001e-22 or 4.8e-101 < z Initial program 82.0%
associate-/l*99.9%
Simplified99.9%
if -1.20000000000000001e-22 < z < 4.8e-101Initial program 91.2%
associate-*l/97.1%
Simplified97.1%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(if (<= z -3e+27)
x
(if (<= z -2.9e-8)
(* x (/ y (- z)))
(if (<= z -5.5e-50)
(/ x (/ t y))
(if (<= z -3.3e-123)
(* z (/ (- x) t))
(if (<= z 8e+52) (/ y (/ t x)) x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3e+27) {
tmp = x;
} else if (z <= -2.9e-8) {
tmp = x * (y / -z);
} else if (z <= -5.5e-50) {
tmp = x / (t / y);
} else if (z <= -3.3e-123) {
tmp = z * (-x / t);
} else if (z <= 8e+52) {
tmp = y / (t / 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 <= (-3d+27)) then
tmp = x
else if (z <= (-2.9d-8)) then
tmp = x * (y / -z)
else if (z <= (-5.5d-50)) then
tmp = x / (t / y)
else if (z <= (-3.3d-123)) then
tmp = z * (-x / t)
else if (z <= 8d+52) then
tmp = y / (t / 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 <= -3e+27) {
tmp = x;
} else if (z <= -2.9e-8) {
tmp = x * (y / -z);
} else if (z <= -5.5e-50) {
tmp = x / (t / y);
} else if (z <= -3.3e-123) {
tmp = z * (-x / t);
} else if (z <= 8e+52) {
tmp = y / (t / x);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3e+27: tmp = x elif z <= -2.9e-8: tmp = x * (y / -z) elif z <= -5.5e-50: tmp = x / (t / y) elif z <= -3.3e-123: tmp = z * (-x / t) elif z <= 8e+52: tmp = y / (t / x) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3e+27) tmp = x; elseif (z <= -2.9e-8) tmp = Float64(x * Float64(y / Float64(-z))); elseif (z <= -5.5e-50) tmp = Float64(x / Float64(t / y)); elseif (z <= -3.3e-123) tmp = Float64(z * Float64(Float64(-x) / t)); elseif (z <= 8e+52) tmp = Float64(y / Float64(t / x)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3e+27) tmp = x; elseif (z <= -2.9e-8) tmp = x * (y / -z); elseif (z <= -5.5e-50) tmp = x / (t / y); elseif (z <= -3.3e-123) tmp = z * (-x / t); elseif (z <= 8e+52) tmp = y / (t / x); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3e+27], x, If[LessEqual[z, -2.9e-8], N[(x * N[(y / (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.5e-50], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.3e-123], N[(z * N[((-x) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e+52], N[(y / N[(t / x), $MachinePrecision]), $MachinePrecision], x]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+27}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-8}:\\
\;\;\;\;x \cdot \frac{y}{-z}\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-50}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-123}:\\
\;\;\;\;z \cdot \frac{-x}{t}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+52}:\\
\;\;\;\;\frac{y}{\frac{t}{x}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.99999999999999976e27 or 7.9999999999999999e52 < z Initial program 78.9%
associate-*l/67.8%
Simplified67.8%
Taylor expanded in z around inf 67.2%
if -2.99999999999999976e27 < z < -2.9000000000000002e-8Initial program 88.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in t around 0 77.2%
mul-1-neg77.2%
associate-/l*77.2%
distribute-neg-frac77.2%
Simplified77.2%
Taylor expanded in z around 0 75.9%
Taylor expanded in x around 0 75.9%
associate-*r/75.9%
*-commutative75.9%
associate-*l/75.9%
associate-*r/75.9%
associate-*l/75.9%
metadata-eval75.9%
associate-/r*75.9%
neg-mul-175.9%
associate-*l*75.9%
associate-/r/75.7%
*-commutative75.7%
associate-/r/75.9%
associate-*l/75.9%
*-lft-identity75.9%
Simplified75.9%
if -2.9000000000000002e-8 < z < -5.49999999999999975e-50Initial program 90.2%
associate-*l/84.0%
Simplified84.0%
Taylor expanded in z around 0 41.8%
associate-/l*51.3%
Simplified51.3%
if -5.49999999999999975e-50 < z < -3.3000000000000003e-123Initial program 76.0%
associate-*l/92.0%
Simplified92.0%
Taylor expanded in t around inf 75.7%
Taylor expanded in y around 0 53.2%
mul-1-neg53.2%
distribute-neg-frac53.2%
*-commutative53.2%
distribute-lft-neg-out53.2%
associate-*r/68.4%
distribute-lft-neg-out68.4%
distribute-rgt-neg-in68.4%
distribute-neg-frac68.4%
Simplified68.4%
if -3.3000000000000003e-123 < z < 7.9999999999999999e52Initial program 92.8%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in z around 0 65.5%
associate-/l*63.0%
Simplified63.0%
associate-/r/69.0%
Applied egg-rr69.0%
*-commutative69.0%
clear-num69.0%
div-inv69.1%
Applied egg-rr69.1%
Final simplification67.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (/ x (- t z)))))
(if (<= z -7.6e+27)
x
(if (<= z -1.3e-41)
t_1
(if (<= z -1.18e-172) (* (- y z) (/ x t)) (if (<= z 1.3e+65) t_1 x))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (x / (t - z));
double tmp;
if (z <= -7.6e+27) {
tmp = x;
} else if (z <= -1.3e-41) {
tmp = t_1;
} else if (z <= -1.18e-172) {
tmp = (y - z) * (x / t);
} else if (z <= 1.3e+65) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = y * (x / (t - z))
if (z <= (-7.6d+27)) then
tmp = x
else if (z <= (-1.3d-41)) then
tmp = t_1
else if (z <= (-1.18d-172)) then
tmp = (y - z) * (x / t)
else if (z <= 1.3d+65) then
tmp = t_1
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (x / (t - z));
double tmp;
if (z <= -7.6e+27) {
tmp = x;
} else if (z <= -1.3e-41) {
tmp = t_1;
} else if (z <= -1.18e-172) {
tmp = (y - z) * (x / t);
} else if (z <= 1.3e+65) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (x / (t - z)) tmp = 0 if z <= -7.6e+27: tmp = x elif z <= -1.3e-41: tmp = t_1 elif z <= -1.18e-172: tmp = (y - z) * (x / t) elif z <= 1.3e+65: tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(x / Float64(t - z))) tmp = 0.0 if (z <= -7.6e+27) tmp = x; elseif (z <= -1.3e-41) tmp = t_1; elseif (z <= -1.18e-172) tmp = Float64(Float64(y - z) * Float64(x / t)); elseif (z <= 1.3e+65) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (x / (t - z)); tmp = 0.0; if (z <= -7.6e+27) tmp = x; elseif (z <= -1.3e-41) tmp = t_1; elseif (z <= -1.18e-172) tmp = (y - z) * (x / t); elseif (z <= 1.3e+65) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.6e+27], x, If[LessEqual[z, -1.3e-41], t$95$1, If[LessEqual[z, -1.18e-172], N[(N[(y - z), $MachinePrecision] * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e+65], t$95$1, x]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{x}{t - z}\\
\mathbf{if}\;z \leq -7.6 \cdot 10^{+27}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-41}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.18 \cdot 10^{-172}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+65}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.60000000000000043e27 or 1.30000000000000001e65 < z Initial program 77.9%
associate-*l/66.2%
Simplified66.2%
Taylor expanded in z around inf 68.4%
if -7.60000000000000043e27 < z < -1.3e-41 or -1.17999999999999999e-172 < z < 1.30000000000000001e65Initial program 93.0%
associate-*l/97.2%
Simplified97.2%
Taylor expanded in y around inf 77.9%
associate-*l/81.2%
*-commutative81.2%
Simplified81.2%
if -1.3e-41 < z < -1.17999999999999999e-172Initial program 77.5%
associate-*l/94.3%
Simplified94.3%
Taylor expanded in t around inf 82.9%
Final simplification76.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (- x) (/ z (- y z)))))
(if (<= z -4.1e-41)
t_1
(if (<= z -8.6e-173)
(* (- y z) (/ x t))
(if (<= z 7.6e+48) (* y (/ x (- t z))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = -x / (z / (y - z));
double tmp;
if (z <= -4.1e-41) {
tmp = t_1;
} else if (z <= -8.6e-173) {
tmp = (y - z) * (x / t);
} else if (z <= 7.6e+48) {
tmp = y * (x / (t - z));
} 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 = -x / (z / (y - z))
if (z <= (-4.1d-41)) then
tmp = t_1
else if (z <= (-8.6d-173)) then
tmp = (y - z) * (x / t)
else if (z <= 7.6d+48) then
tmp = y * (x / (t - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = -x / (z / (y - z));
double tmp;
if (z <= -4.1e-41) {
tmp = t_1;
} else if (z <= -8.6e-173) {
tmp = (y - z) * (x / t);
} else if (z <= 7.6e+48) {
tmp = y * (x / (t - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -x / (z / (y - z)) tmp = 0 if z <= -4.1e-41: tmp = t_1 elif z <= -8.6e-173: tmp = (y - z) * (x / t) elif z <= 7.6e+48: tmp = y * (x / (t - z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-x) / Float64(z / Float64(y - z))) tmp = 0.0 if (z <= -4.1e-41) tmp = t_1; elseif (z <= -8.6e-173) tmp = Float64(Float64(y - z) * Float64(x / t)); elseif (z <= 7.6e+48) tmp = Float64(y * Float64(x / Float64(t - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -x / (z / (y - z)); tmp = 0.0; if (z <= -4.1e-41) tmp = t_1; elseif (z <= -8.6e-173) tmp = (y - z) * (x / t); elseif (z <= 7.6e+48) tmp = y * (x / (t - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-x) / N[(z / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.1e-41], t$95$1, If[LessEqual[z, -8.6e-173], N[(N[(y - z), $MachinePrecision] * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.6e+48], N[(y * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-x}{\frac{z}{y - z}}\\
\mathbf{if}\;z \leq -4.1 \cdot 10^{-41}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -8.6 \cdot 10^{-173}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{+48}:\\
\;\;\;\;y \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -4.10000000000000014e-41 or 7.60000000000000001e48 < z Initial program 80.4%
associate-*l/71.1%
Simplified71.1%
Taylor expanded in t around 0 63.9%
mul-1-neg63.9%
associate-/l*80.0%
distribute-neg-frac80.0%
Simplified80.0%
if -4.10000000000000014e-41 < z < -8.6000000000000006e-173Initial program 77.5%
associate-*l/94.3%
Simplified94.3%
Taylor expanded in t around inf 82.9%
if -8.6000000000000006e-173 < z < 7.60000000000000001e48Initial program 93.3%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in y around inf 81.1%
associate-*l/84.7%
*-commutative84.7%
Simplified84.7%
Final simplification82.3%
(FPCore (x y z t)
:precision binary64
(if (<= z -2.3e+27)
x
(if (<= z -4.6e-7)
(* x (/ y (- z)))
(if (<= z -2.2e-72) (/ x (/ t y)) (if (<= z 7.6e+48) (/ y (/ t x)) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.3e+27) {
tmp = x;
} else if (z <= -4.6e-7) {
tmp = x * (y / -z);
} else if (z <= -2.2e-72) {
tmp = x / (t / y);
} else if (z <= 7.6e+48) {
tmp = y / (t / 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 <= (-2.3d+27)) then
tmp = x
else if (z <= (-4.6d-7)) then
tmp = x * (y / -z)
else if (z <= (-2.2d-72)) then
tmp = x / (t / y)
else if (z <= 7.6d+48) then
tmp = y / (t / 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 <= -2.3e+27) {
tmp = x;
} else if (z <= -4.6e-7) {
tmp = x * (y / -z);
} else if (z <= -2.2e-72) {
tmp = x / (t / y);
} else if (z <= 7.6e+48) {
tmp = y / (t / x);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.3e+27: tmp = x elif z <= -4.6e-7: tmp = x * (y / -z) elif z <= -2.2e-72: tmp = x / (t / y) elif z <= 7.6e+48: tmp = y / (t / x) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.3e+27) tmp = x; elseif (z <= -4.6e-7) tmp = Float64(x * Float64(y / Float64(-z))); elseif (z <= -2.2e-72) tmp = Float64(x / Float64(t / y)); elseif (z <= 7.6e+48) tmp = Float64(y / Float64(t / x)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.3e+27) tmp = x; elseif (z <= -4.6e-7) tmp = x * (y / -z); elseif (z <= -2.2e-72) tmp = x / (t / y); elseif (z <= 7.6e+48) tmp = y / (t / x); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.3e+27], x, If[LessEqual[z, -4.6e-7], N[(x * N[(y / (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.2e-72], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.6e+48], N[(y / N[(t / x), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+27}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -4.6 \cdot 10^{-7}:\\
\;\;\;\;x \cdot \frac{y}{-z}\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-72}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{+48}:\\
\;\;\;\;\frac{y}{\frac{t}{x}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.3000000000000001e27 or 7.60000000000000001e48 < z Initial program 78.9%
associate-*l/67.8%
Simplified67.8%
Taylor expanded in z around inf 67.2%
if -2.3000000000000001e27 < z < -4.5999999999999999e-7Initial program 88.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in t around 0 77.2%
mul-1-neg77.2%
associate-/l*77.2%
distribute-neg-frac77.2%
Simplified77.2%
Taylor expanded in z around 0 75.9%
Taylor expanded in x around 0 75.9%
associate-*r/75.9%
*-commutative75.9%
associate-*l/75.9%
associate-*r/75.9%
associate-*l/75.9%
metadata-eval75.9%
associate-/r*75.9%
neg-mul-175.9%
associate-*l*75.9%
associate-/r/75.7%
*-commutative75.7%
associate-/r/75.9%
associate-*l/75.9%
*-lft-identity75.9%
Simplified75.9%
if -4.5999999999999999e-7 < z < -2.20000000000000002e-72Initial program 86.8%
associate-*l/89.4%
Simplified89.4%
Taylor expanded in z around 0 29.6%
associate-/l*42.4%
Simplified42.4%
if -2.20000000000000002e-72 < z < 7.60000000000000001e48Initial program 91.7%
associate-*l/97.5%
Simplified97.5%
Taylor expanded in z around 0 63.6%
associate-/l*62.1%
Simplified62.1%
associate-/r/66.9%
Applied egg-rr66.9%
*-commutative66.9%
clear-num66.9%
div-inv67.0%
Applied egg-rr67.0%
Final simplification65.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (* y (/ x z)))))
(if (<= z -2.05e-42)
t_1
(if (<= z -1.65e-172)
(* (- y z) (/ x t))
(if (<= z 3e+53) (* y (/ x (- t z))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x - (y * (x / z));
double tmp;
if (z <= -2.05e-42) {
tmp = t_1;
} else if (z <= -1.65e-172) {
tmp = (y - z) * (x / t);
} else if (z <= 3e+53) {
tmp = y * (x / (t - z));
} 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 = x - (y * (x / z))
if (z <= (-2.05d-42)) then
tmp = t_1
else if (z <= (-1.65d-172)) then
tmp = (y - z) * (x / t)
else if (z <= 3d+53) then
tmp = y * (x / (t - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x - (y * (x / z));
double tmp;
if (z <= -2.05e-42) {
tmp = t_1;
} else if (z <= -1.65e-172) {
tmp = (y - z) * (x / t);
} else if (z <= 3e+53) {
tmp = y * (x / (t - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (y * (x / z)) tmp = 0 if z <= -2.05e-42: tmp = t_1 elif z <= -1.65e-172: tmp = (y - z) * (x / t) elif z <= 3e+53: tmp = y * (x / (t - z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(y * Float64(x / z))) tmp = 0.0 if (z <= -2.05e-42) tmp = t_1; elseif (z <= -1.65e-172) tmp = Float64(Float64(y - z) * Float64(x / t)); elseif (z <= 3e+53) tmp = Float64(y * Float64(x / Float64(t - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (y * (x / z)); tmp = 0.0; if (z <= -2.05e-42) tmp = t_1; elseif (z <= -1.65e-172) tmp = (y - z) * (x / t); elseif (z <= 3e+53) tmp = y * (x / (t - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.05e-42], t$95$1, If[LessEqual[z, -1.65e-172], N[(N[(y - z), $MachinePrecision] * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+53], N[(y * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -2.05 \cdot 10^{-42}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-172}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+53}:\\
\;\;\;\;y \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.0500000000000001e-42 or 2.99999999999999998e53 < z Initial program 80.4%
associate-*l/71.1%
Simplified71.1%
Taylor expanded in t around 0 63.9%
mul-1-neg63.9%
associate-/l*80.0%
distribute-neg-frac80.0%
Simplified80.0%
Taylor expanded in z around 0 74.6%
mul-1-neg74.6%
unsub-neg74.6%
associate-*l/78.5%
*-commutative78.5%
Simplified78.5%
if -2.0500000000000001e-42 < z < -1.65e-172Initial program 77.5%
associate-*l/94.3%
Simplified94.3%
Taylor expanded in t around inf 82.9%
if -1.65e-172 < z < 2.99999999999999998e53Initial program 93.3%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in y around inf 81.1%
associate-*l/84.7%
*-commutative84.7%
Simplified84.7%
Final simplification81.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.45e+188) (not (<= z 4e+97))) (/ (- x) (/ z (- y z))) (* (- y z) (/ x (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.45e+188) || !(z <= 4e+97)) {
tmp = -x / (z / (y - z));
} else {
tmp = (y - z) * (x / (t - 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 <= (-2.45d+188)) .or. (.not. (z <= 4d+97))) then
tmp = -x / (z / (y - z))
else
tmp = (y - z) * (x / (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.45e+188) || !(z <= 4e+97)) {
tmp = -x / (z / (y - z));
} else {
tmp = (y - z) * (x / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.45e+188) or not (z <= 4e+97): tmp = -x / (z / (y - z)) else: tmp = (y - z) * (x / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.45e+188) || !(z <= 4e+97)) tmp = Float64(Float64(-x) / Float64(z / Float64(y - z))); else tmp = Float64(Float64(y - z) * Float64(x / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.45e+188) || ~((z <= 4e+97))) tmp = -x / (z / (y - z)); else tmp = (y - z) * (x / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.45e+188], N[Not[LessEqual[z, 4e+97]], $MachinePrecision]], N[((-x) / N[(z / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.45 \cdot 10^{+188} \lor \neg \left(z \leq 4 \cdot 10^{+97}\right):\\
\;\;\;\;\frac{-x}{\frac{z}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\
\end{array}
\end{array}
if z < -2.45e188 or 4.0000000000000003e97 < z Initial program 71.1%
associate-*l/53.8%
Simplified53.8%
Taylor expanded in t around 0 65.4%
mul-1-neg65.4%
associate-/l*91.3%
distribute-neg-frac91.3%
Simplified91.3%
if -2.45e188 < z < 4.0000000000000003e97Initial program 91.0%
associate-*l/95.1%
Simplified95.1%
Final simplification94.2%
(FPCore (x y z t) :precision binary64 (if (<= z -8.5e+27) x (if (<= z 8e+66) (* y (/ x (- t z))) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.5e+27) {
tmp = x;
} else if (z <= 8e+66) {
tmp = y * (x / (t - 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 <= (-8.5d+27)) then
tmp = x
else if (z <= 8d+66) then
tmp = y * (x / (t - 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 <= -8.5e+27) {
tmp = x;
} else if (z <= 8e+66) {
tmp = y * (x / (t - z));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -8.5e+27: tmp = x elif z <= 8e+66: tmp = y * (x / (t - z)) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -8.5e+27) tmp = x; elseif (z <= 8e+66) tmp = Float64(y * Float64(x / Float64(t - z))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -8.5e+27) tmp = x; elseif (z <= 8e+66) tmp = y * (x / (t - z)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -8.5e+27], x, If[LessEqual[z, 8e+66], N[(y * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+27}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+66}:\\
\;\;\;\;y \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -8.5e27 or 7.99999999999999956e66 < z Initial program 77.9%
associate-*l/66.2%
Simplified66.2%
Taylor expanded in z around inf 68.4%
if -8.5e27 < z < 7.99999999999999956e66Initial program 91.3%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in y around inf 74.2%
associate-*l/77.7%
*-commutative77.7%
Simplified77.7%
Final simplification74.0%
(FPCore (x y z t) :precision binary64 (if (<= z -1.5e+18) x (if (<= z 4.8e+53) (* y (/ x t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.5e+18) {
tmp = x;
} else if (z <= 4.8e+53) {
tmp = y * (x / t);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.5d+18)) then
tmp = x
else if (z <= 4.8d+53) then
tmp = y * (x / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.5e+18) {
tmp = x;
} else if (z <= 4.8e+53) {
tmp = y * (x / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.5e+18: tmp = x elif z <= 4.8e+53: tmp = y * (x / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.5e+18) tmp = x; elseif (z <= 4.8e+53) tmp = Float64(y * Float64(x / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.5e+18) tmp = x; elseif (z <= 4.8e+53) tmp = y * (x / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.5e+18], x, If[LessEqual[z, 4.8e+53], N[(y * N[(x / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+18}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+53}:\\
\;\;\;\;y \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.5e18 or 4.8e53 < z Initial program 79.1%
associate-*l/68.1%
Simplified68.1%
Taylor expanded in z around inf 66.6%
if -1.5e18 < z < 4.8e53Initial program 90.9%
associate-*l/96.8%
Simplified96.8%
Taylor expanded in z around 0 58.6%
associate-/l*59.3%
Simplified59.3%
associate-/r/62.3%
Applied egg-rr62.3%
Final simplification64.1%
(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 85.9%
associate-*l/84.7%
Simplified84.7%
Taylor expanded in z around inf 34.3%
Final simplification34.3%
(FPCore (x y z t) :precision binary64 (/ x (/ (- t z) (- y z))))
double code(double x, double y, double z, double t) {
return x / ((t - z) / (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 - z) / (y - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
def code(x, y, z, t): return x / ((t - z) / (y - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(t - z) / Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = x / ((t - z) / (y - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{t - z}{y - z}}
\end{array}
herbie shell --seed 2023318
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:herbie-target
(/ x (/ (- t z) (- y z)))
(/ (* x (- y z)) (- t z)))