
(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 8 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 (* 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(x * Float64(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[(x * N[(N[(y - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{y - z}{t - z}
\end{array}
Initial program 84.9%
*-commutative84.9%
associate-*l/97.5%
*-commutative97.5%
Simplified97.5%
Final simplification97.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (* x (/ y z)))))
(if (<= z -2.75e-15)
t_1
(if (<= z -3.9e-212)
(* x (/ y (- t z)))
(if (<= z 1.5e-141)
(/ (* x (- y z)) t)
(if (<= z 1e+67) (/ x (/ (- t z) y)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x - (x * (y / z));
double tmp;
if (z <= -2.75e-15) {
tmp = t_1;
} else if (z <= -3.9e-212) {
tmp = x * (y / (t - z));
} else if (z <= 1.5e-141) {
tmp = (x * (y - z)) / t;
} else if (z <= 1e+67) {
tmp = x / ((t - 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 = x - (x * (y / z))
if (z <= (-2.75d-15)) then
tmp = t_1
else if (z <= (-3.9d-212)) then
tmp = x * (y / (t - z))
else if (z <= 1.5d-141) then
tmp = (x * (y - z)) / t
else if (z <= 1d+67) then
tmp = x / ((t - 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 = x - (x * (y / z));
double tmp;
if (z <= -2.75e-15) {
tmp = t_1;
} else if (z <= -3.9e-212) {
tmp = x * (y / (t - z));
} else if (z <= 1.5e-141) {
tmp = (x * (y - z)) / t;
} else if (z <= 1e+67) {
tmp = x / ((t - z) / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (x * (y / z)) tmp = 0 if z <= -2.75e-15: tmp = t_1 elif z <= -3.9e-212: tmp = x * (y / (t - z)) elif z <= 1.5e-141: tmp = (x * (y - z)) / t elif z <= 1e+67: tmp = x / ((t - z) / y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(x * Float64(y / z))) tmp = 0.0 if (z <= -2.75e-15) tmp = t_1; elseif (z <= -3.9e-212) tmp = Float64(x * Float64(y / Float64(t - z))); elseif (z <= 1.5e-141) tmp = Float64(Float64(x * Float64(y - z)) / t); elseif (z <= 1e+67) tmp = Float64(x / Float64(Float64(t - z) / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (x * (y / z)); tmp = 0.0; if (z <= -2.75e-15) tmp = t_1; elseif (z <= -3.9e-212) tmp = x * (y / (t - z)); elseif (z <= 1.5e-141) tmp = (x * (y - z)) / t; elseif (z <= 1e+67) tmp = x / ((t - z) / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.75e-15], t$95$1, If[LessEqual[z, -3.9e-212], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e-141], N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 1e+67], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - x \cdot \frac{y}{z}\\
\mathbf{if}\;z \leq -2.75 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.9 \cdot 10^{-212}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-141}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{t}\\
\mathbf{elif}\;z \leq 10^{+67}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.7500000000000001e-15 or 9.99999999999999983e66 < z Initial program 74.3%
associate-*l/77.4%
Simplified77.4%
Taylor expanded in t around 0 67.1%
associate-*r/67.1%
neg-mul-167.1%
Simplified67.1%
Taylor expanded in z around 0 76.1%
mul-1-neg76.1%
unsub-neg76.1%
associate-/l*85.4%
Simplified85.4%
div-inv85.4%
clear-num85.4%
*-commutative85.4%
Applied egg-rr85.4%
if -2.7500000000000001e-15 < z < -3.9e-212Initial program 91.1%
*-commutative91.1%
associate-*l/97.6%
*-commutative97.6%
Simplified97.6%
Taylor expanded in y around inf 88.7%
if -3.9e-212 < z < 1.49999999999999992e-141Initial program 94.9%
*-commutative94.9%
associate-*l/89.7%
*-commutative89.7%
Simplified89.7%
Taylor expanded in t around inf 89.7%
if 1.49999999999999992e-141 < z < 9.99999999999999983e66Initial program 95.6%
*-commutative95.6%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around inf 66.6%
associate-/l*70.8%
Simplified70.8%
Final simplification84.2%
(FPCore (x y z t)
:precision binary64
(if (<= z -7.1e+53)
x
(if (<= z 5.8e-26)
(* x (/ y t))
(if (<= z 2.9e+62) (* x (/ (- y) z)) (if (<= z 4e+64) (* y (/ x t)) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.1e+53) {
tmp = x;
} else if (z <= 5.8e-26) {
tmp = x * (y / t);
} else if (z <= 2.9e+62) {
tmp = x * (-y / z);
} else if (z <= 4e+64) {
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 <= (-7.1d+53)) then
tmp = x
else if (z <= 5.8d-26) then
tmp = x * (y / t)
else if (z <= 2.9d+62) then
tmp = x * (-y / z)
else if (z <= 4d+64) 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 <= -7.1e+53) {
tmp = x;
} else if (z <= 5.8e-26) {
tmp = x * (y / t);
} else if (z <= 2.9e+62) {
tmp = x * (-y / z);
} else if (z <= 4e+64) {
tmp = y * (x / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -7.1e+53: tmp = x elif z <= 5.8e-26: tmp = x * (y / t) elif z <= 2.9e+62: tmp = x * (-y / z) elif z <= 4e+64: tmp = y * (x / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -7.1e+53) tmp = x; elseif (z <= 5.8e-26) tmp = Float64(x * Float64(y / t)); elseif (z <= 2.9e+62) tmp = Float64(x * Float64(Float64(-y) / z)); elseif (z <= 4e+64) 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 <= -7.1e+53) tmp = x; elseif (z <= 5.8e-26) tmp = x * (y / t); elseif (z <= 2.9e+62) tmp = x * (-y / z); elseif (z <= 4e+64) tmp = y * (x / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -7.1e+53], x, If[LessEqual[z, 5.8e-26], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e+62], N[(x * N[((-y) / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e+64], N[(y * N[(x / t), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.1 \cdot 10^{+53}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-26}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+62}:\\
\;\;\;\;x \cdot \frac{-y}{z}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+64}:\\
\;\;\;\;y \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.09999999999999974e53 or 4.00000000000000009e64 < z Initial program 71.7%
*-commutative71.7%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 66.6%
if -7.09999999999999974e53 < z < 5.7999999999999996e-26Initial program 94.2%
*-commutative94.2%
associate-*l/95.1%
*-commutative95.1%
Simplified95.1%
Taylor expanded in z around 0 69.1%
if 5.7999999999999996e-26 < z < 2.89999999999999984e62Initial program 95.1%
*-commutative95.1%
associate-*l/99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in y around inf 61.0%
Taylor expanded in t around 0 43.7%
associate-*r/43.7%
neg-mul-143.7%
Simplified43.7%
if 2.89999999999999984e62 < z < 4.00000000000000009e64Initial program 100.0%
*-commutative100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
associate-*r/100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around 0 71.0%
associate-/l*71.0%
associate-/r/71.0%
Simplified71.0%
Final simplification66.1%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.65e+54)
x
(if (<= z 1.95e-26)
(* x (/ y t))
(if (<= z 2.9e+62)
(* (- y) (/ x z))
(if (<= z 4.2e+64) (* y (/ x t)) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.65e+54) {
tmp = x;
} else if (z <= 1.95e-26) {
tmp = x * (y / t);
} else if (z <= 2.9e+62) {
tmp = -y * (x / z);
} else if (z <= 4.2e+64) {
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.65d+54)) then
tmp = x
else if (z <= 1.95d-26) then
tmp = x * (y / t)
else if (z <= 2.9d+62) then
tmp = -y * (x / z)
else if (z <= 4.2d+64) 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.65e+54) {
tmp = x;
} else if (z <= 1.95e-26) {
tmp = x * (y / t);
} else if (z <= 2.9e+62) {
tmp = -y * (x / z);
} else if (z <= 4.2e+64) {
tmp = y * (x / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.65e+54: tmp = x elif z <= 1.95e-26: tmp = x * (y / t) elif z <= 2.9e+62: tmp = -y * (x / z) elif z <= 4.2e+64: tmp = y * (x / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.65e+54) tmp = x; elseif (z <= 1.95e-26) tmp = Float64(x * Float64(y / t)); elseif (z <= 2.9e+62) tmp = Float64(Float64(-y) * Float64(x / z)); elseif (z <= 4.2e+64) 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.65e+54) tmp = x; elseif (z <= 1.95e-26) tmp = x * (y / t); elseif (z <= 2.9e+62) tmp = -y * (x / z); elseif (z <= 4.2e+64) tmp = y * (x / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.65e+54], x, If[LessEqual[z, 1.95e-26], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e+62], N[((-y) * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.2e+64], N[(y * N[(x / t), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+54}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{-26}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+62}:\\
\;\;\;\;\left(-y\right) \cdot \frac{x}{z}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+64}:\\
\;\;\;\;y \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.65e54 or 4.2000000000000001e64 < z Initial program 71.7%
*-commutative71.7%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 66.6%
if -1.65e54 < z < 1.94999999999999993e-26Initial program 94.2%
*-commutative94.2%
associate-*l/95.1%
*-commutative95.1%
Simplified95.1%
Taylor expanded in z around 0 69.1%
if 1.94999999999999993e-26 < z < 2.89999999999999984e62Initial program 95.1%
*-commutative95.1%
associate-*l/99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in y around inf 61.0%
Taylor expanded in t around 0 43.8%
mul-1-neg43.8%
associate-*l/43.8%
*-commutative43.8%
distribute-rgt-neg-in43.8%
distribute-neg-frac43.8%
Simplified43.8%
if 2.89999999999999984e62 < z < 4.2000000000000001e64Initial program 100.0%
*-commutative100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
associate-*r/100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around 0 71.0%
associate-/l*71.0%
associate-/r/71.0%
Simplified71.0%
Final simplification66.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.2e-11) (not (<= z 4.6e+64))) (- x (* x (/ y z))) (* x (/ y (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.2e-11) || !(z <= 4.6e+64)) {
tmp = x - (x * (y / z));
} else {
tmp = x * (y / (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.2d-11)) .or. (.not. (z <= 4.6d+64))) then
tmp = x - (x * (y / z))
else
tmp = x * (y / (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.2e-11) || !(z <= 4.6e+64)) {
tmp = x - (x * (y / z));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.2e-11) or not (z <= 4.6e+64): tmp = x - (x * (y / z)) else: tmp = x * (y / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.2e-11) || !(z <= 4.6e+64)) tmp = Float64(x - Float64(x * Float64(y / z))); else tmp = Float64(x * Float64(y / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.2e-11) || ~((z <= 4.6e+64))) tmp = x - (x * (y / z)); else tmp = x * (y / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.2e-11], N[Not[LessEqual[z, 4.6e+64]], $MachinePrecision]], N[(x - N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-11} \lor \neg \left(z \leq 4.6 \cdot 10^{+64}\right):\\
\;\;\;\;x - x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -2.2000000000000002e-11 or 4.6e64 < z Initial program 74.3%
associate-*l/77.4%
Simplified77.4%
Taylor expanded in t around 0 67.1%
associate-*r/67.1%
neg-mul-167.1%
Simplified67.1%
Taylor expanded in z around 0 76.1%
mul-1-neg76.1%
unsub-neg76.1%
associate-/l*85.4%
Simplified85.4%
div-inv85.4%
clear-num85.4%
*-commutative85.4%
Applied egg-rr85.4%
if -2.2000000000000002e-11 < z < 4.6e64Initial program 93.9%
*-commutative93.9%
associate-*l/95.4%
*-commutative95.4%
Simplified95.4%
Taylor expanded in y around inf 80.1%
Final simplification82.6%
(FPCore (x y z t) :precision binary64 (if (<= z -4.2e+61) x (if (<= z 6.2e+72) (* x (/ y (- t z))) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.2e+61) {
tmp = x;
} else if (z <= 6.2e+72) {
tmp = x * (y / (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 <= (-4.2d+61)) then
tmp = x
else if (z <= 6.2d+72) then
tmp = x * (y / (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 <= -4.2e+61) {
tmp = x;
} else if (z <= 6.2e+72) {
tmp = x * (y / (t - z));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.2e+61: tmp = x elif z <= 6.2e+72: tmp = x * (y / (t - z)) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.2e+61) tmp = x; elseif (z <= 6.2e+72) tmp = Float64(x * Float64(y / Float64(t - z))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.2e+61) tmp = x; elseif (z <= 6.2e+72) tmp = x * (y / (t - z)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.2e+61], x, If[LessEqual[z, 6.2e+72], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+61}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+72}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.2000000000000002e61 or 6.19999999999999977e72 < z Initial program 71.4%
*-commutative71.4%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 67.2%
if -4.2000000000000002e61 < z < 6.19999999999999977e72Initial program 94.4%
*-commutative94.4%
associate-*l/95.8%
*-commutative95.8%
Simplified95.8%
Taylor expanded in y around inf 79.1%
Final simplification74.2%
(FPCore (x y z t) :precision binary64 (if (<= z -3.6e+53) x (if (<= z 2.6e+69) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.6e+53) {
tmp = x;
} else if (z <= 2.6e+69) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-3.6d+53)) then
tmp = x
else if (z <= 2.6d+69) then
tmp = x * (y / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.6e+53) {
tmp = x;
} else if (z <= 2.6e+69) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.6e+53: tmp = x elif z <= 2.6e+69: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.6e+53) tmp = x; elseif (z <= 2.6e+69) tmp = Float64(x * Float64(y / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.6e+53) tmp = x; elseif (z <= 2.6e+69) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.6e+53], x, If[LessEqual[z, 2.6e+69], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+53}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+69}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.6e53 or 2.6000000000000002e69 < z Initial program 71.7%
*-commutative71.7%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 66.6%
if -3.6e53 < z < 2.6000000000000002e69Initial program 94.4%
*-commutative94.4%
associate-*l/95.8%
*-commutative95.8%
Simplified95.8%
Taylor expanded in z around 0 62.9%
Final simplification64.5%
(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 84.9%
*-commutative84.9%
associate-*l/97.5%
*-commutative97.5%
Simplified97.5%
Taylor expanded in z around inf 34.7%
Final simplification34.7%
(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 2024027
(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)))