
(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 11 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 (<= (/ (* x (- y z)) (- t z)) -5e+127) (* (- y z) (/ x (- t z))) (/ x (/ (- t z) (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x * (y - z)) / (t - z)) <= -5e+127) {
tmp = (y - z) * (x / (t - z));
} else {
tmp = x / ((t - z) / (y - 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 (((x * (y - z)) / (t - z)) <= (-5d+127)) then
tmp = (y - z) * (x / (t - z))
else
tmp = x / ((t - z) / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x * (y - z)) / (t - z)) <= -5e+127) {
tmp = (y - z) * (x / (t - z));
} else {
tmp = x / ((t - z) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x * (y - z)) / (t - z)) <= -5e+127: tmp = (y - z) * (x / (t - z)) else: tmp = x / ((t - z) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(x * Float64(y - z)) / Float64(t - z)) <= -5e+127) tmp = Float64(Float64(y - z) * Float64(x / Float64(t - z))); else tmp = Float64(x / Float64(Float64(t - z) / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x * (y - z)) / (t - z)) <= -5e+127) tmp = (y - z) * (x / (t - z)); else tmp = x / ((t - z) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], -5e+127], N[(N[(y - z), $MachinePrecision] * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq -5 \cdot 10^{+127}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -5.0000000000000004e127Initial program 72.5%
associate-*l/99.8%
Simplified99.8%
if -5.0000000000000004e127 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 90.3%
associate-/l*98.3%
Simplified98.3%
Final simplification98.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ (- z y) z))))
(if (<= z -5.5e+31)
t_1
(if (<= z -2.65e-256)
(* (- y z) (/ x t))
(if (<= z 8.5e-26)
(* x (/ y (- t z)))
(if (<= z 4.9e+20) (* x (/ (- y z) t)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((z - y) / z);
double tmp;
if (z <= -5.5e+31) {
tmp = t_1;
} else if (z <= -2.65e-256) {
tmp = (y - z) * (x / t);
} else if (z <= 8.5e-26) {
tmp = x * (y / (t - z));
} else if (z <= 4.9e+20) {
tmp = x * ((y - z) / t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * ((z - y) / z)
if (z <= (-5.5d+31)) then
tmp = t_1
else if (z <= (-2.65d-256)) then
tmp = (y - z) * (x / t)
else if (z <= 8.5d-26) then
tmp = x * (y / (t - z))
else if (z <= 4.9d+20) then
tmp = x * ((y - z) / t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((z - y) / z);
double tmp;
if (z <= -5.5e+31) {
tmp = t_1;
} else if (z <= -2.65e-256) {
tmp = (y - z) * (x / t);
} else if (z <= 8.5e-26) {
tmp = x * (y / (t - z));
} else if (z <= 4.9e+20) {
tmp = x * ((y - z) / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((z - y) / z) tmp = 0 if z <= -5.5e+31: tmp = t_1 elif z <= -2.65e-256: tmp = (y - z) * (x / t) elif z <= 8.5e-26: tmp = x * (y / (t - z)) elif z <= 4.9e+20: tmp = x * ((y - z) / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(z - y) / z)) tmp = 0.0 if (z <= -5.5e+31) tmp = t_1; elseif (z <= -2.65e-256) tmp = Float64(Float64(y - z) * Float64(x / t)); elseif (z <= 8.5e-26) tmp = Float64(x * Float64(y / Float64(t - z))); elseif (z <= 4.9e+20) tmp = Float64(x * Float64(Float64(y - z) / t)); 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 <= -5.5e+31) tmp = t_1; elseif (z <= -2.65e-256) tmp = (y - z) * (x / t); elseif (z <= 8.5e-26) tmp = x * (y / (t - z)); elseif (z <= 4.9e+20) tmp = x * ((y - z) / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.5e+31], t$95$1, If[LessEqual[z, -2.65e-256], N[(N[(y - z), $MachinePrecision] * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e-26], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.9e+20], N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{z - y}{z}\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{+31}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.65 \cdot 10^{-256}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-26}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{elif}\;z \leq 4.9 \cdot 10^{+20}:\\
\;\;\;\;x \cdot \frac{y - z}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -5.50000000000000002e31 or 4.9e20 < z Initial program 79.1%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in t around 0 68.1%
mul-1-neg68.1%
associate-/l*58.7%
distribute-neg-frac58.7%
neg-sub058.7%
associate--r-58.7%
neg-sub058.7%
Simplified58.7%
Taylor expanded in x around 0 68.1%
*-commutative68.1%
*-lft-identity68.1%
times-frac83.7%
/-rgt-identity83.7%
Simplified83.7%
if -5.50000000000000002e31 < z < -2.65000000000000012e-256Initial program 93.0%
associate-*l/97.3%
Simplified97.3%
Taylor expanded in t around inf 78.2%
if -2.65000000000000012e-256 < z < 8.50000000000000004e-26Initial program 94.9%
associate-*r/92.0%
Simplified92.0%
Taylor expanded in y around inf 80.3%
if 8.50000000000000004e-26 < z < 4.9e20Initial program 93.4%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around inf 93.3%
Final simplification82.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ (- y z) t))) (t_2 (* x (/ (- z y) z))))
(if (<= z -4.9e+33)
t_2
(if (<= z -1.25e-151)
t_1
(if (<= z 3.5e-29) (/ y (/ (- t z) x)) (if (<= z 2.1e+20) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y - z) / t);
double t_2 = x * ((z - y) / z);
double tmp;
if (z <= -4.9e+33) {
tmp = t_2;
} else if (z <= -1.25e-151) {
tmp = t_1;
} else if (z <= 3.5e-29) {
tmp = y / ((t - z) / x);
} else if (z <= 2.1e+20) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * ((y - z) / t)
t_2 = x * ((z - y) / z)
if (z <= (-4.9d+33)) then
tmp = t_2
else if (z <= (-1.25d-151)) then
tmp = t_1
else if (z <= 3.5d-29) then
tmp = y / ((t - z) / x)
else if (z <= 2.1d+20) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((y - z) / t);
double t_2 = x * ((z - y) / z);
double tmp;
if (z <= -4.9e+33) {
tmp = t_2;
} else if (z <= -1.25e-151) {
tmp = t_1;
} else if (z <= 3.5e-29) {
tmp = y / ((t - z) / x);
} else if (z <= 2.1e+20) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y - z) / t) t_2 = x * ((z - y) / z) tmp = 0 if z <= -4.9e+33: tmp = t_2 elif z <= -1.25e-151: tmp = t_1 elif z <= 3.5e-29: tmp = y / ((t - z) / x) elif z <= 2.1e+20: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y - z) / t)) t_2 = Float64(x * Float64(Float64(z - y) / z)) tmp = 0.0 if (z <= -4.9e+33) tmp = t_2; elseif (z <= -1.25e-151) tmp = t_1; elseif (z <= 3.5e-29) tmp = Float64(y / Float64(Float64(t - z) / x)); elseif (z <= 2.1e+20) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y - z) / t); t_2 = x * ((z - y) / z); tmp = 0.0; if (z <= -4.9e+33) tmp = t_2; elseif (z <= -1.25e-151) tmp = t_1; elseif (z <= 3.5e-29) tmp = y / ((t - z) / x); elseif (z <= 2.1e+20) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.9e+33], t$95$2, If[LessEqual[z, -1.25e-151], t$95$1, If[LessEqual[z, 3.5e-29], N[(y / N[(N[(t - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1e+20], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y - z}{t}\\
t_2 := x \cdot \frac{z - y}{z}\\
\mathbf{if}\;z \leq -4.9 \cdot 10^{+33}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-151}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-29}:\\
\;\;\;\;\frac{y}{\frac{t - z}{x}}\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+20}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -4.90000000000000014e33 or 2.1e20 < z Initial program 79.1%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in t around 0 68.1%
mul-1-neg68.1%
associate-/l*58.7%
distribute-neg-frac58.7%
neg-sub058.7%
associate--r-58.7%
neg-sub058.7%
Simplified58.7%
Taylor expanded in x around 0 68.1%
*-commutative68.1%
*-lft-identity68.1%
times-frac83.7%
/-rgt-identity83.7%
Simplified83.7%
if -4.90000000000000014e33 < z < -1.25000000000000001e-151 or 3.4999999999999997e-29 < z < 2.1e20Initial program 90.7%
associate-*r/99.6%
Simplified99.6%
Taylor expanded in t around inf 84.8%
if -1.25000000000000001e-151 < z < 3.4999999999999997e-29Initial program 95.8%
associate-*r/90.6%
Simplified90.6%
associate-*r/95.8%
clear-num95.6%
Applied egg-rr95.6%
Taylor expanded in y around inf 82.4%
associate-/l*82.4%
Simplified82.4%
Final simplification83.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ (- y z) t))) (t_2 (* x (/ (- z y) z))))
(if (<= z -1.65e+34)
t_2
(if (<= z 7e-249)
t_1
(if (<= z 8.4e-29) (/ (* x y) (- t z)) (if (<= z 7.5e+22) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y - z) / t);
double t_2 = x * ((z - y) / z);
double tmp;
if (z <= -1.65e+34) {
tmp = t_2;
} else if (z <= 7e-249) {
tmp = t_1;
} else if (z <= 8.4e-29) {
tmp = (x * y) / (t - z);
} else if (z <= 7.5e+22) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * ((y - z) / t)
t_2 = x * ((z - y) / z)
if (z <= (-1.65d+34)) then
tmp = t_2
else if (z <= 7d-249) then
tmp = t_1
else if (z <= 8.4d-29) then
tmp = (x * y) / (t - z)
else if (z <= 7.5d+22) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((y - z) / t);
double t_2 = x * ((z - y) / z);
double tmp;
if (z <= -1.65e+34) {
tmp = t_2;
} else if (z <= 7e-249) {
tmp = t_1;
} else if (z <= 8.4e-29) {
tmp = (x * y) / (t - z);
} else if (z <= 7.5e+22) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y - z) / t) t_2 = x * ((z - y) / z) tmp = 0 if z <= -1.65e+34: tmp = t_2 elif z <= 7e-249: tmp = t_1 elif z <= 8.4e-29: tmp = (x * y) / (t - z) elif z <= 7.5e+22: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y - z) / t)) t_2 = Float64(x * Float64(Float64(z - y) / z)) tmp = 0.0 if (z <= -1.65e+34) tmp = t_2; elseif (z <= 7e-249) tmp = t_1; elseif (z <= 8.4e-29) tmp = Float64(Float64(x * y) / Float64(t - z)); elseif (z <= 7.5e+22) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y - z) / t); t_2 = x * ((z - y) / z); tmp = 0.0; if (z <= -1.65e+34) tmp = t_2; elseif (z <= 7e-249) tmp = t_1; elseif (z <= 8.4e-29) tmp = (x * y) / (t - z); elseif (z <= 7.5e+22) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.65e+34], t$95$2, If[LessEqual[z, 7e-249], t$95$1, If[LessEqual[z, 8.4e-29], N[(N[(x * y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.5e+22], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y - z}{t}\\
t_2 := x \cdot \frac{z - y}{z}\\
\mathbf{if}\;z \leq -1.65 \cdot 10^{+34}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-249}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 8.4 \cdot 10^{-29}:\\
\;\;\;\;\frac{x \cdot y}{t - z}\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+22}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -1.64999999999999994e34 or 7.5000000000000002e22 < z Initial program 79.1%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in t around 0 68.1%
mul-1-neg68.1%
associate-/l*58.7%
distribute-neg-frac58.7%
neg-sub058.7%
associate--r-58.7%
neg-sub058.7%
Simplified58.7%
Taylor expanded in x around 0 68.1%
*-commutative68.1%
*-lft-identity68.1%
times-frac83.7%
/-rgt-identity83.7%
Simplified83.7%
if -1.64999999999999994e34 < z < 7.00000000000000025e-249 or 8.39999999999999958e-29 < z < 7.5000000000000002e22Initial program 90.6%
associate-*r/96.6%
Simplified96.6%
Taylor expanded in t around inf 83.7%
if 7.00000000000000025e-249 < z < 8.39999999999999958e-29Initial program 99.7%
associate-*r/89.2%
Simplified89.2%
Taylor expanded in y around inf 85.3%
Final simplification84.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -8e+31) (not (<= z 1.15e+25))) (* x (/ (- z y) z)) (* x (/ (- y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8e+31) || !(z <= 1.15e+25)) {
tmp = x * ((z - y) / z);
} else {
tmp = x * ((y - 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 ((z <= (-8d+31)) .or. (.not. (z <= 1.15d+25))) then
tmp = x * ((z - y) / z)
else
tmp = x * ((y - z) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8e+31) || !(z <= 1.15e+25)) {
tmp = x * ((z - y) / z);
} else {
tmp = x * ((y - z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -8e+31) or not (z <= 1.15e+25): tmp = x * ((z - y) / z) else: tmp = x * ((y - z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -8e+31) || !(z <= 1.15e+25)) tmp = Float64(x * Float64(Float64(z - y) / z)); else tmp = Float64(x * Float64(Float64(y - z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -8e+31) || ~((z <= 1.15e+25))) tmp = x * ((z - y) / z); else tmp = x * ((y - z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -8e+31], N[Not[LessEqual[z, 1.15e+25]], $MachinePrecision]], N[(x * N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+31} \lor \neg \left(z \leq 1.15 \cdot 10^{+25}\right):\\
\;\;\;\;x \cdot \frac{z - y}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y - z}{t}\\
\end{array}
\end{array}
if z < -7.9999999999999997e31 or 1.1499999999999999e25 < z Initial program 79.1%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in t around 0 68.1%
mul-1-neg68.1%
associate-/l*58.7%
distribute-neg-frac58.7%
neg-sub058.7%
associate--r-58.7%
neg-sub058.7%
Simplified58.7%
Taylor expanded in x around 0 68.1%
*-commutative68.1%
*-lft-identity68.1%
times-frac83.7%
/-rgt-identity83.7%
Simplified83.7%
if -7.9999999999999997e31 < z < 1.1499999999999999e25Initial program 94.0%
associate-*r/93.8%
Simplified93.8%
Taylor expanded in t around inf 76.2%
Final simplification79.5%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.3e+16) (not (<= t 5.6e+29))) (* x (/ (- y z) t)) (- x (/ (* x y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.3e+16) || !(t <= 5.6e+29)) {
tmp = x * ((y - z) / t);
} else {
tmp = x - ((x * y) / 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 ((t <= (-2.3d+16)) .or. (.not. (t <= 5.6d+29))) then
tmp = x * ((y - z) / t)
else
tmp = x - ((x * y) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.3e+16) || !(t <= 5.6e+29)) {
tmp = x * ((y - z) / t);
} else {
tmp = x - ((x * y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.3e+16) or not (t <= 5.6e+29): tmp = x * ((y - z) / t) else: tmp = x - ((x * y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.3e+16) || !(t <= 5.6e+29)) tmp = Float64(x * Float64(Float64(y - z) / t)); else tmp = Float64(x - Float64(Float64(x * y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2.3e+16) || ~((t <= 5.6e+29))) tmp = x * ((y - z) / t); else tmp = x - ((x * y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.3e+16], N[Not[LessEqual[t, 5.6e+29]], $MachinePrecision]], N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.3 \cdot 10^{+16} \lor \neg \left(t \leq 5.6 \cdot 10^{+29}\right):\\
\;\;\;\;x \cdot \frac{y - z}{t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{x \cdot y}{z}\\
\end{array}
\end{array}
if t < -2.3e16 or 5.5999999999999999e29 < t Initial program 81.3%
associate-*r/98.1%
Simplified98.1%
Taylor expanded in t around inf 79.1%
if -2.3e16 < t < 5.5999999999999999e29Initial program 92.2%
associate-*r/95.3%
Simplified95.3%
Taylor expanded in t around 0 75.8%
mul-1-neg75.8%
associate-/l*62.3%
distribute-neg-frac62.3%
neg-sub062.3%
associate--r-62.3%
neg-sub062.3%
Simplified62.3%
Taylor expanded in y around 0 79.0%
+-commutative79.0%
mul-1-neg79.0%
unsub-neg79.0%
Simplified79.0%
Final simplification79.1%
(FPCore (x y z t) :precision binary64 (if (<= z -4.8e+74) x (if (<= z 2.5e+28) (* x (/ y (- t z))) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.8e+74) {
tmp = x;
} else if (z <= 2.5e+28) {
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.8d+74)) then
tmp = x
else if (z <= 2.5d+28) 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.8e+74) {
tmp = x;
} else if (z <= 2.5e+28) {
tmp = x * (y / (t - z));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.8e+74: tmp = x elif z <= 2.5e+28: tmp = x * (y / (t - z)) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.8e+74) tmp = x; elseif (z <= 2.5e+28) 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.8e+74) tmp = x; elseif (z <= 2.5e+28) tmp = x * (y / (t - z)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.8e+74], x, If[LessEqual[z, 2.5e+28], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+74}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+28}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.80000000000000017e74 or 2.49999999999999979e28 < z Initial program 77.9%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around inf 66.3%
if -4.80000000000000017e74 < z < 2.49999999999999979e28Initial program 94.2%
associate-*r/94.1%
Simplified94.1%
Taylor expanded in y around inf 74.9%
Final simplification71.3%
(FPCore (x y z t) :precision binary64 (if (<= z -3.6e+44) x (if (<= z 2.4e+24) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.6e+44) {
tmp = x;
} else if (z <= 2.4e+24) {
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+44)) then
tmp = x
else if (z <= 2.4d+24) 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+44) {
tmp = x;
} else if (z <= 2.4e+24) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.6e+44: tmp = x elif z <= 2.4e+24: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.6e+44) tmp = x; elseif (z <= 2.4e+24) 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+44) tmp = x; elseif (z <= 2.4e+24) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.6e+44], x, If[LessEqual[z, 2.4e+24], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+44}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+24}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.6e44 or 2.4000000000000001e24 < z Initial program 78.9%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around inf 65.2%
if -3.6e44 < z < 2.4000000000000001e24Initial program 94.0%
associate-*r/93.9%
Simplified93.9%
Taylor expanded in z around 0 61.3%
Final simplification63.0%
(FPCore (x y z t) :precision binary64 (if (<= z -1.85e+45) x (if (<= z 9e+22) (/ x (/ t y)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.85e+45) {
tmp = x;
} else if (z <= 9e+22) {
tmp = x / (t / y);
} 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.85d+45)) then
tmp = x
else if (z <= 9d+22) then
tmp = x / (t / y)
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.85e+45) {
tmp = x;
} else if (z <= 9e+22) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.85e+45: tmp = x elif z <= 9e+22: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.85e+45) tmp = x; elseif (z <= 9e+22) tmp = Float64(x / Float64(t / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.85e+45) tmp = x; elseif (z <= 9e+22) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.85e+45], x, If[LessEqual[z, 9e+22], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+45}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+22}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.84999999999999989e45 or 8.9999999999999996e22 < z Initial program 78.9%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around inf 65.2%
if -1.84999999999999989e45 < z < 8.9999999999999996e22Initial program 94.0%
associate-/l*94.3%
Simplified94.3%
Taylor expanded in z around 0 61.7%
Final simplification63.3%
(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 87.4%
associate-*r/96.5%
Simplified96.5%
Final simplification96.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 87.4%
associate-*r/96.5%
Simplified96.5%
Taylor expanded in z around inf 33.1%
Final simplification33.1%
(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 2023208
(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)))