
(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 80.7%
*-commutative80.7%
associate-*l/96.3%
*-commutative96.3%
Simplified96.3%
Final simplification96.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ z (- z t)))))
(if (<= z -1.6e+57)
(* x (/ (- z y) z))
(if (<= z -7.6e-34)
(* x (/ y (- t z)))
(if (<= z -5.8e-45)
t_1
(if (<= z 7.6e-232)
(/ (* x (- y z)) t)
(if (<= z 520.0) (/ x (/ (- t z) y)) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (z / (z - t));
double tmp;
if (z <= -1.6e+57) {
tmp = x * ((z - y) / z);
} else if (z <= -7.6e-34) {
tmp = x * (y / (t - z));
} else if (z <= -5.8e-45) {
tmp = t_1;
} else if (z <= 7.6e-232) {
tmp = (x * (y - z)) / t;
} else if (z <= 520.0) {
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 * (z / (z - t))
if (z <= (-1.6d+57)) then
tmp = x * ((z - y) / z)
else if (z <= (-7.6d-34)) then
tmp = x * (y / (t - z))
else if (z <= (-5.8d-45)) then
tmp = t_1
else if (z <= 7.6d-232) then
tmp = (x * (y - z)) / t
else if (z <= 520.0d0) 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 * (z / (z - t));
double tmp;
if (z <= -1.6e+57) {
tmp = x * ((z - y) / z);
} else if (z <= -7.6e-34) {
tmp = x * (y / (t - z));
} else if (z <= -5.8e-45) {
tmp = t_1;
} else if (z <= 7.6e-232) {
tmp = (x * (y - z)) / t;
} else if (z <= 520.0) {
tmp = x / ((t - z) / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (z / (z - t)) tmp = 0 if z <= -1.6e+57: tmp = x * ((z - y) / z) elif z <= -7.6e-34: tmp = x * (y / (t - z)) elif z <= -5.8e-45: tmp = t_1 elif z <= 7.6e-232: tmp = (x * (y - z)) / t elif z <= 520.0: tmp = x / ((t - z) / y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(z / Float64(z - t))) tmp = 0.0 if (z <= -1.6e+57) tmp = Float64(x * Float64(Float64(z - y) / z)); elseif (z <= -7.6e-34) tmp = Float64(x * Float64(y / Float64(t - z))); elseif (z <= -5.8e-45) tmp = t_1; elseif (z <= 7.6e-232) tmp = Float64(Float64(x * Float64(y - z)) / t); elseif (z <= 520.0) 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 * (z / (z - t)); tmp = 0.0; if (z <= -1.6e+57) tmp = x * ((z - y) / z); elseif (z <= -7.6e-34) tmp = x * (y / (t - z)); elseif (z <= -5.8e-45) tmp = t_1; elseif (z <= 7.6e-232) tmp = (x * (y - z)) / t; elseif (z <= 520.0) 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[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.6e+57], N[(x * N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.6e-34], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.8e-45], t$95$1, If[LessEqual[z, 7.6e-232], N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 520.0], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{z}{z - t}\\
\mathbf{if}\;z \leq -1.6 \cdot 10^{+57}:\\
\;\;\;\;x \cdot \frac{z - y}{z}\\
\mathbf{elif}\;z \leq -7.6 \cdot 10^{-34}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-45}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{-232}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{t}\\
\mathbf{elif}\;z \leq 520:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.60000000000000015e57Initial program 56.5%
*-commutative56.5%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 89.9%
associate-*r/89.9%
neg-mul-189.9%
Simplified89.9%
if -1.60000000000000015e57 < z < -7.6000000000000002e-34Initial program 89.9%
*-commutative89.9%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in y around inf 66.7%
if -7.6000000000000002e-34 < z < -5.8e-45 or 520 < z Initial program 80.3%
*-commutative80.3%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 86.5%
neg-mul-186.5%
distribute-neg-frac86.5%
Simplified86.5%
frac-2neg86.5%
div-inv86.4%
remove-double-neg86.4%
sub-neg86.4%
distribute-neg-in86.4%
remove-double-neg86.4%
Applied egg-rr86.4%
associate-*r/86.5%
*-rgt-identity86.5%
+-commutative86.5%
unsub-neg86.5%
Simplified86.5%
if -5.8e-45 < z < 7.6000000000000003e-232Initial program 95.5%
*-commutative95.5%
associate-*l/89.7%
*-commutative89.7%
Simplified89.7%
Taylor expanded in t around inf 85.6%
if 7.6000000000000003e-232 < z < 520Initial program 81.3%
*-commutative81.3%
associate-*l/96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in y around inf 61.3%
associate-/l*73.3%
Simplified73.3%
Final simplification82.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ y (- t z)))) (t_2 (* x (/ z (- z t)))))
(if (<= z -1.45e+78)
t_2
(if (<= z -4.1e-189)
t_1
(if (<= z -4.2e-290)
(* (- y z) (/ x t))
(if (<= z 235000.0) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y / (t - z));
double t_2 = x * (z / (z - t));
double tmp;
if (z <= -1.45e+78) {
tmp = t_2;
} else if (z <= -4.1e-189) {
tmp = t_1;
} else if (z <= -4.2e-290) {
tmp = (y - z) * (x / t);
} else if (z <= 235000.0) {
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 / (t - z))
t_2 = x * (z / (z - t))
if (z <= (-1.45d+78)) then
tmp = t_2
else if (z <= (-4.1d-189)) then
tmp = t_1
else if (z <= (-4.2d-290)) then
tmp = (y - z) * (x / t)
else if (z <= 235000.0d0) 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 / (t - z));
double t_2 = x * (z / (z - t));
double tmp;
if (z <= -1.45e+78) {
tmp = t_2;
} else if (z <= -4.1e-189) {
tmp = t_1;
} else if (z <= -4.2e-290) {
tmp = (y - z) * (x / t);
} else if (z <= 235000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y / (t - z)) t_2 = x * (z / (z - t)) tmp = 0 if z <= -1.45e+78: tmp = t_2 elif z <= -4.1e-189: tmp = t_1 elif z <= -4.2e-290: tmp = (y - z) * (x / t) elif z <= 235000.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y / Float64(t - z))) t_2 = Float64(x * Float64(z / Float64(z - t))) tmp = 0.0 if (z <= -1.45e+78) tmp = t_2; elseif (z <= -4.1e-189) tmp = t_1; elseif (z <= -4.2e-290) tmp = Float64(Float64(y - z) * Float64(x / t)); elseif (z <= 235000.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y / (t - z)); t_2 = x * (z / (z - t)); tmp = 0.0; if (z <= -1.45e+78) tmp = t_2; elseif (z <= -4.1e-189) tmp = t_1; elseif (z <= -4.2e-290) tmp = (y - z) * (x / t); elseif (z <= 235000.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.45e+78], t$95$2, If[LessEqual[z, -4.1e-189], t$95$1, If[LessEqual[z, -4.2e-290], N[(N[(y - z), $MachinePrecision] * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 235000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{t - z}\\
t_2 := x \cdot \frac{z}{z - t}\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{+78}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -4.1 \cdot 10^{-189}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-290}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\
\mathbf{elif}\;z \leq 235000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -1.45000000000000008e78 or 235000 < z Initial program 68.8%
*-commutative68.8%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 86.4%
neg-mul-186.4%
distribute-neg-frac86.4%
Simplified86.4%
frac-2neg86.4%
div-inv86.2%
remove-double-neg86.2%
sub-neg86.2%
distribute-neg-in86.2%
remove-double-neg86.2%
Applied egg-rr86.2%
associate-*r/86.4%
*-rgt-identity86.4%
+-commutative86.4%
unsub-neg86.4%
Simplified86.4%
if -1.45000000000000008e78 < z < -4.1000000000000003e-189 or -4.2000000000000002e-290 < z < 235000Initial program 88.6%
*-commutative88.6%
associate-*l/95.6%
*-commutative95.6%
Simplified95.6%
Taylor expanded in y around inf 74.6%
if -4.1000000000000003e-189 < z < -4.2000000000000002e-290Initial program 92.1%
associate-*l/92.0%
Simplified92.0%
Taylor expanded in t around inf 88.0%
Final simplification80.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ z (- z t)))))
(if (<= z -1e+78)
t_1
(if (<= z -1.12e-189)
(* x (/ y (- t z)))
(if (<= z 1.05e-229)
(/ (* x (- y z)) t)
(if (<= z 22000000.0) (/ x (/ (- t z) y)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (z / (z - t));
double tmp;
if (z <= -1e+78) {
tmp = t_1;
} else if (z <= -1.12e-189) {
tmp = x * (y / (t - z));
} else if (z <= 1.05e-229) {
tmp = (x * (y - z)) / t;
} else if (z <= 22000000.0) {
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 * (z / (z - t))
if (z <= (-1d+78)) then
tmp = t_1
else if (z <= (-1.12d-189)) then
tmp = x * (y / (t - z))
else if (z <= 1.05d-229) then
tmp = (x * (y - z)) / t
else if (z <= 22000000.0d0) 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 * (z / (z - t));
double tmp;
if (z <= -1e+78) {
tmp = t_1;
} else if (z <= -1.12e-189) {
tmp = x * (y / (t - z));
} else if (z <= 1.05e-229) {
tmp = (x * (y - z)) / t;
} else if (z <= 22000000.0) {
tmp = x / ((t - z) / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (z / (z - t)) tmp = 0 if z <= -1e+78: tmp = t_1 elif z <= -1.12e-189: tmp = x * (y / (t - z)) elif z <= 1.05e-229: tmp = (x * (y - z)) / t elif z <= 22000000.0: tmp = x / ((t - z) / y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(z / Float64(z - t))) tmp = 0.0 if (z <= -1e+78) tmp = t_1; elseif (z <= -1.12e-189) tmp = Float64(x * Float64(y / Float64(t - z))); elseif (z <= 1.05e-229) tmp = Float64(Float64(x * Float64(y - z)) / t); elseif (z <= 22000000.0) 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 * (z / (z - t)); tmp = 0.0; if (z <= -1e+78) tmp = t_1; elseif (z <= -1.12e-189) tmp = x * (y / (t - z)); elseif (z <= 1.05e-229) tmp = (x * (y - z)) / t; elseif (z <= 22000000.0) 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[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e+78], t$95$1, If[LessEqual[z, -1.12e-189], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e-229], N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 22000000.0], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{z}{z - t}\\
\mathbf{if}\;z \leq -1 \cdot 10^{+78}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.12 \cdot 10^{-189}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-229}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{t}\\
\mathbf{elif}\;z \leq 22000000:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.00000000000000001e78 or 2.2e7 < z Initial program 68.8%
*-commutative68.8%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 86.4%
neg-mul-186.4%
distribute-neg-frac86.4%
Simplified86.4%
frac-2neg86.4%
div-inv86.2%
remove-double-neg86.2%
sub-neg86.2%
distribute-neg-in86.2%
remove-double-neg86.2%
Applied egg-rr86.2%
associate-*r/86.4%
*-rgt-identity86.4%
+-commutative86.4%
unsub-neg86.4%
Simplified86.4%
if -1.00000000000000001e78 < z < -1.12000000000000002e-189Initial program 90.9%
*-commutative90.9%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around inf 69.6%
if -1.12000000000000002e-189 < z < 1.04999999999999992e-229Initial program 96.0%
*-commutative96.0%
associate-*l/86.2%
*-commutative86.2%
Simplified86.2%
Taylor expanded in t around inf 90.2%
if 1.04999999999999992e-229 < z < 2.2e7Initial program 81.3%
*-commutative81.3%
associate-*l/96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in y around inf 61.3%
associate-/l*73.3%
Simplified73.3%
Final simplification81.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1e+78) (not (<= z 90.0))) (* x (/ z (- z t))) (* x (/ y (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1e+78) || !(z <= 90.0)) {
tmp = x * (z / (z - t));
} 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 <= (-1d+78)) .or. (.not. (z <= 90.0d0))) then
tmp = x * (z / (z - t))
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 <= -1e+78) || !(z <= 90.0)) {
tmp = x * (z / (z - t));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1e+78) or not (z <= 90.0): tmp = x * (z / (z - t)) else: tmp = x * (y / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1e+78) || !(z <= 90.0)) tmp = Float64(x * Float64(z / Float64(z - t))); 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 <= -1e+78) || ~((z <= 90.0))) tmp = x * (z / (z - t)); else tmp = x * (y / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1e+78], N[Not[LessEqual[z, 90.0]], $MachinePrecision]], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+78} \lor \neg \left(z \leq 90\right):\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -1.00000000000000001e78 or 90 < z Initial program 68.8%
*-commutative68.8%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 86.4%
neg-mul-186.4%
distribute-neg-frac86.4%
Simplified86.4%
frac-2neg86.4%
div-inv86.2%
remove-double-neg86.2%
sub-neg86.2%
distribute-neg-in86.2%
remove-double-neg86.2%
Applied egg-rr86.2%
associate-*r/86.4%
*-rgt-identity86.4%
+-commutative86.4%
unsub-neg86.4%
Simplified86.4%
if -1.00000000000000001e78 < z < 90Initial program 89.2%
*-commutative89.2%
associate-*l/93.8%
*-commutative93.8%
Simplified93.8%
Taylor expanded in y around inf 73.7%
Final simplification79.0%
(FPCore (x y z t) :precision binary64 (if (<= z -1.8e+121) x (if (<= z 6.4e+18) (* x (/ y (- t z))) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.8e+121) {
tmp = x;
} else if (z <= 6.4e+18) {
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 <= (-1.8d+121)) then
tmp = x
else if (z <= 6.4d+18) 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 <= -1.8e+121) {
tmp = x;
} else if (z <= 6.4e+18) {
tmp = x * (y / (t - z));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.8e+121: tmp = x elif z <= 6.4e+18: tmp = x * (y / (t - z)) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.8e+121) tmp = x; elseif (z <= 6.4e+18) 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 <= -1.8e+121) tmp = x; elseif (z <= 6.4e+18) tmp = x * (y / (t - z)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.8e+121], x, If[LessEqual[z, 6.4e+18], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+121}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{+18}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.79999999999999991e121 or 6.4e18 < z Initial program 67.3%
*-commutative67.3%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 79.5%
if -1.79999999999999991e121 < z < 6.4e18Initial program 89.1%
*-commutative89.1%
associate-*l/94.1%
*-commutative94.1%
Simplified94.1%
Taylor expanded in y around inf 72.4%
Final simplification75.1%
(FPCore (x y z t) :precision binary64 (if (<= z -3.8e+58) x (if (<= z 6.5e+18) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.8e+58) {
tmp = x;
} else if (z <= 6.5e+18) {
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.8d+58)) then
tmp = x
else if (z <= 6.5d+18) 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.8e+58) {
tmp = x;
} else if (z <= 6.5e+18) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.8e+58: tmp = x elif z <= 6.5e+18: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.8e+58) tmp = x; elseif (z <= 6.5e+18) 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.8e+58) tmp = x; elseif (z <= 6.5e+18) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.8e+58], x, If[LessEqual[z, 6.5e+18], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+58}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+18}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.7999999999999999e58 or 6.5e18 < z Initial program 68.0%
*-commutative68.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 75.7%
if -3.7999999999999999e58 < z < 6.5e18Initial program 89.8%
*-commutative89.8%
associate-*l/93.8%
*-commutative93.8%
Simplified93.8%
Taylor expanded in z around 0 61.8%
Final simplification67.6%
(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 80.7%
*-commutative80.7%
associate-*l/96.3%
*-commutative96.3%
Simplified96.3%
Taylor expanded in z around inf 38.8%
Final simplification38.8%
(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 2024019
(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)))