
(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 13 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 (/ (- 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}
Initial program 85.9%
associate-/l*96.0%
Simplified96.0%
Final simplification96.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ (- z y) z))))
(if (<= z -1.55e+44)
t_1
(if (<= z -0.18)
(/ x (/ t (- y z)))
(if (or (<= z -1.02e-11) (not (<= z 135.0)))
t_1
(* x (/ y (- t z))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((z - y) / z);
double tmp;
if (z <= -1.55e+44) {
tmp = t_1;
} else if (z <= -0.18) {
tmp = x / (t / (y - z));
} else if ((z <= -1.02e-11) || !(z <= 135.0)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x * ((z - y) / z)
if (z <= (-1.55d+44)) then
tmp = t_1
else if (z <= (-0.18d0)) then
tmp = x / (t / (y - z))
else if ((z <= (-1.02d-11)) .or. (.not. (z <= 135.0d0))) then
tmp = t_1
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 t_1 = x * ((z - y) / z);
double tmp;
if (z <= -1.55e+44) {
tmp = t_1;
} else if (z <= -0.18) {
tmp = x / (t / (y - z));
} else if ((z <= -1.02e-11) || !(z <= 135.0)) {
tmp = t_1;
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((z - y) / z) tmp = 0 if z <= -1.55e+44: tmp = t_1 elif z <= -0.18: tmp = x / (t / (y - z)) elif (z <= -1.02e-11) or not (z <= 135.0): tmp = t_1 else: tmp = x * (y / (t - z)) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(z - y) / z)) tmp = 0.0 if (z <= -1.55e+44) tmp = t_1; elseif (z <= -0.18) tmp = Float64(x / Float64(t / Float64(y - z))); elseif ((z <= -1.02e-11) || !(z <= 135.0)) tmp = t_1; else tmp = Float64(x * Float64(y / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((z - y) / z); tmp = 0.0; if (z <= -1.55e+44) tmp = t_1; elseif (z <= -0.18) tmp = x / (t / (y - z)); elseif ((z <= -1.02e-11) || ~((z <= 135.0))) tmp = t_1; else tmp = x * (y / (t - z)); 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, -1.55e+44], t$95$1, If[LessEqual[z, -0.18], N[(x / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -1.02e-11], N[Not[LessEqual[z, 135.0]], $MachinePrecision]], t$95$1, N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{z - y}{z}\\
\mathbf{if}\;z \leq -1.55 \cdot 10^{+44}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -0.18:\\
\;\;\;\;\frac{x}{\frac{t}{y - z}}\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{-11} \lor \neg \left(z \leq 135\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -1.54999999999999998e44 or -0.17999999999999999 < z < -1.01999999999999994e-11 or 135 < z Initial program 78.7%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 67.2%
mul-1-neg67.2%
associate-/l*60.5%
distribute-neg-frac60.5%
neg-sub060.5%
associate--r-60.5%
neg-sub060.5%
Simplified60.5%
Taylor expanded in x around 0 67.2%
associate-/l*60.5%
associate-/r/86.6%
Simplified86.6%
if -1.54999999999999998e44 < z < -0.17999999999999999Initial program 84.3%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in t around inf 99.7%
if -1.01999999999999994e-11 < z < 135Initial program 91.7%
associate-*r/91.8%
Simplified91.8%
Taylor expanded in y around inf 77.7%
Final simplification82.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ (- z y) z))))
(if (<= z -1.55e+44)
t_1
(if (<= z -0.23)
(/ x (/ t (- y z)))
(if (or (<= z -4.1e-12) (not (<= z 0.7))) t_1 (/ x (/ (- t z) y)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((z - y) / z);
double tmp;
if (z <= -1.55e+44) {
tmp = t_1;
} else if (z <= -0.23) {
tmp = x / (t / (y - z));
} else if ((z <= -4.1e-12) || !(z <= 0.7)) {
tmp = t_1;
} else {
tmp = x / ((t - z) / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * ((z - y) / z)
if (z <= (-1.55d+44)) then
tmp = t_1
else if (z <= (-0.23d0)) then
tmp = x / (t / (y - z))
else if ((z <= (-4.1d-12)) .or. (.not. (z <= 0.7d0))) then
tmp = t_1
else
tmp = x / ((t - z) / y)
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 <= -1.55e+44) {
tmp = t_1;
} else if (z <= -0.23) {
tmp = x / (t / (y - z));
} else if ((z <= -4.1e-12) || !(z <= 0.7)) {
tmp = t_1;
} else {
tmp = x / ((t - z) / y);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((z - y) / z) tmp = 0 if z <= -1.55e+44: tmp = t_1 elif z <= -0.23: tmp = x / (t / (y - z)) elif (z <= -4.1e-12) or not (z <= 0.7): tmp = t_1 else: tmp = x / ((t - z) / y) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(z - y) / z)) tmp = 0.0 if (z <= -1.55e+44) tmp = t_1; elseif (z <= -0.23) tmp = Float64(x / Float64(t / Float64(y - z))); elseif ((z <= -4.1e-12) || !(z <= 0.7)) tmp = t_1; else tmp = Float64(x / Float64(Float64(t - z) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((z - y) / z); tmp = 0.0; if (z <= -1.55e+44) tmp = t_1; elseif (z <= -0.23) tmp = x / (t / (y - z)); elseif ((z <= -4.1e-12) || ~((z <= 0.7))) tmp = t_1; else tmp = x / ((t - z) / y); 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, -1.55e+44], t$95$1, If[LessEqual[z, -0.23], N[(x / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -4.1e-12], N[Not[LessEqual[z, 0.7]], $MachinePrecision]], t$95$1, N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{z - y}{z}\\
\mathbf{if}\;z \leq -1.55 \cdot 10^{+44}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -0.23:\\
\;\;\;\;\frac{x}{\frac{t}{y - z}}\\
\mathbf{elif}\;z \leq -4.1 \cdot 10^{-12} \lor \neg \left(z \leq 0.7\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\end{array}
\end{array}
if z < -1.54999999999999998e44 or -0.23000000000000001 < z < -4.0999999999999999e-12 or 0.69999999999999996 < z Initial program 78.7%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 67.2%
mul-1-neg67.2%
associate-/l*60.5%
distribute-neg-frac60.5%
neg-sub060.5%
associate--r-60.5%
neg-sub060.5%
Simplified60.5%
Taylor expanded in x around 0 67.2%
associate-/l*60.5%
associate-/r/86.6%
Simplified86.6%
if -1.54999999999999998e44 < z < -0.23000000000000001Initial program 84.3%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in t around inf 99.7%
if -4.0999999999999999e-12 < z < 0.69999999999999996Initial program 91.7%
associate-/l*92.8%
Simplified92.8%
Taylor expanded in y around inf 79.1%
Final simplification82.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ y (/ (- t z) x))))
(if (<= z -3800000.0)
(/ x (/ (- z t) z))
(if (<= z 5e-216)
t_1
(if (<= z 3.3e-62)
(/ (- y z) (/ t x))
(if (<= z 400.0) t_1 (* x (/ (- z y) z))))))))
double code(double x, double y, double z, double t) {
double t_1 = y / ((t - z) / x);
double tmp;
if (z <= -3800000.0) {
tmp = x / ((z - t) / z);
} else if (z <= 5e-216) {
tmp = t_1;
} else if (z <= 3.3e-62) {
tmp = (y - z) / (t / x);
} else if (z <= 400.0) {
tmp = t_1;
} else {
tmp = x * ((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) :: t_1
real(8) :: tmp
t_1 = y / ((t - z) / x)
if (z <= (-3800000.0d0)) then
tmp = x / ((z - t) / z)
else if (z <= 5d-216) then
tmp = t_1
else if (z <= 3.3d-62) then
tmp = (y - z) / (t / x)
else if (z <= 400.0d0) then
tmp = t_1
else
tmp = x * ((z - y) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y / ((t - z) / x);
double tmp;
if (z <= -3800000.0) {
tmp = x / ((z - t) / z);
} else if (z <= 5e-216) {
tmp = t_1;
} else if (z <= 3.3e-62) {
tmp = (y - z) / (t / x);
} else if (z <= 400.0) {
tmp = t_1;
} else {
tmp = x * ((z - y) / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = y / ((t - z) / x) tmp = 0 if z <= -3800000.0: tmp = x / ((z - t) / z) elif z <= 5e-216: tmp = t_1 elif z <= 3.3e-62: tmp = (y - z) / (t / x) elif z <= 400.0: tmp = t_1 else: tmp = x * ((z - y) / z) return tmp
function code(x, y, z, t) t_1 = Float64(y / Float64(Float64(t - z) / x)) tmp = 0.0 if (z <= -3800000.0) tmp = Float64(x / Float64(Float64(z - t) / z)); elseif (z <= 5e-216) tmp = t_1; elseif (z <= 3.3e-62) tmp = Float64(Float64(y - z) / Float64(t / x)); elseif (z <= 400.0) tmp = t_1; else tmp = Float64(x * Float64(Float64(z - y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y / ((t - z) / x); tmp = 0.0; if (z <= -3800000.0) tmp = x / ((z - t) / z); elseif (z <= 5e-216) tmp = t_1; elseif (z <= 3.3e-62) tmp = (y - z) / (t / x); elseif (z <= 400.0) tmp = t_1; else tmp = x * ((z - y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y / N[(N[(t - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3800000.0], N[(x / N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e-216], t$95$1, If[LessEqual[z, 3.3e-62], N[(N[(y - z), $MachinePrecision] / N[(t / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 400.0], t$95$1, N[(x * N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{\frac{t - z}{x}}\\
\mathbf{if}\;z \leq -3800000:\\
\;\;\;\;\frac{x}{\frac{z - t}{z}}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-216}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-62}:\\
\;\;\;\;\frac{y - z}{\frac{t}{x}}\\
\mathbf{elif}\;z \leq 400:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z - y}{z}\\
\end{array}
\end{array}
if z < -3.8e6Initial program 80.0%
associate-/l*99.9%
Simplified99.9%
div-inv99.9%
add-cube-cbrt98.1%
clear-num98.1%
associate-*l*98.1%
pow298.1%
Applied egg-rr98.1%
Taylor expanded in y around 0 71.7%
associate-*r/71.7%
mul-1-neg71.7%
distribute-lft-neg-out71.7%
*-commutative71.7%
associate-/l*85.9%
Simplified85.9%
frac-2neg85.9%
div-inv85.7%
sub-neg85.7%
distribute-neg-in85.7%
remove-double-neg85.7%
remove-double-neg85.7%
Applied egg-rr85.7%
associate-*r/85.9%
*-rgt-identity85.9%
+-commutative85.9%
unsub-neg85.9%
Simplified85.9%
if -3.8e6 < z < 5.00000000000000021e-216 or 3.30000000000000004e-62 < z < 400Initial program 92.6%
associate-*r/90.4%
Simplified90.4%
associate-*r/92.6%
associate-/l*92.3%
div-inv92.2%
associate-/r*95.0%
Applied egg-rr95.0%
Taylor expanded in y around inf 81.7%
associate-/l*84.7%
Simplified84.7%
if 5.00000000000000021e-216 < z < 3.30000000000000004e-62Initial program 90.4%
associate-*r/96.7%
Simplified96.7%
Taylor expanded in t around inf 75.3%
associate-/l*82.5%
Simplified82.5%
if 400 < z Initial program 76.7%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 66.7%
mul-1-neg66.7%
associate-/l*59.3%
distribute-neg-frac59.3%
neg-sub059.3%
associate--r-59.3%
neg-sub059.3%
Simplified59.3%
Taylor expanded in x around 0 66.7%
associate-/l*59.3%
associate-/r/86.9%
Simplified86.9%
Final simplification85.2%
(FPCore (x y z t) :precision binary64 (if (<= z -1.85e+83) x (if (<= z -4.6e-105) (* y (/ (- x) z)) (if (<= z 1.3) (* y (/ x t)) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.85e+83) {
tmp = x;
} else if (z <= -4.6e-105) {
tmp = y * (-x / z);
} else if (z <= 1.3) {
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.85d+83)) then
tmp = x
else if (z <= (-4.6d-105)) then
tmp = y * (-x / z)
else if (z <= 1.3d0) 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.85e+83) {
tmp = x;
} else if (z <= -4.6e-105) {
tmp = y * (-x / z);
} else if (z <= 1.3) {
tmp = y * (x / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.85e+83: tmp = x elif z <= -4.6e-105: tmp = y * (-x / z) elif z <= 1.3: tmp = y * (x / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.85e+83) tmp = x; elseif (z <= -4.6e-105) tmp = Float64(y * Float64(Float64(-x) / z)); elseif (z <= 1.3) 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.85e+83) tmp = x; elseif (z <= -4.6e-105) tmp = y * (-x / z); elseif (z <= 1.3) tmp = y * (x / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.85e+83], x, If[LessEqual[z, -4.6e-105], N[(y * N[((-x) / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3], N[(y * N[(x / t), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+83}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -4.6 \cdot 10^{-105}:\\
\;\;\;\;y \cdot \frac{-x}{z}\\
\mathbf{elif}\;z \leq 1.3:\\
\;\;\;\;y \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.8500000000000001e83 or 1.30000000000000004 < z Initial program 78.0%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in z around inf 71.0%
if -1.8500000000000001e83 < z < -4.6000000000000002e-105Initial program 89.6%
associate-*r/92.0%
Simplified92.0%
Taylor expanded in y around inf 62.6%
Taylor expanded in t around 0 42.0%
associate-*r/42.0%
mul-1-neg42.0%
*-commutative42.0%
distribute-rgt-neg-in42.0%
Simplified42.0%
Taylor expanded in x around 0 42.0%
mul-1-neg42.0%
associate-*r/46.4%
*-commutative46.4%
distribute-rgt-neg-in46.4%
Simplified46.4%
if -4.6000000000000002e-105 < z < 1.30000000000000004Initial program 91.8%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in z around 0 71.8%
associate-/r/73.5%
Applied egg-rr73.5%
Final simplification68.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.65e+44) (not (<= z 470.0))) (* x (/ (- z y) z)) (* x (/ y (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.65e+44) || !(z <= 470.0)) {
tmp = x * ((z - 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 <= (-1.65d+44)) .or. (.not. (z <= 470.0d0))) then
tmp = x * ((z - 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 <= -1.65e+44) || !(z <= 470.0)) {
tmp = x * ((z - y) / z);
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.65e+44) or not (z <= 470.0): tmp = x * ((z - y) / z) else: tmp = x * (y / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.65e+44) || !(z <= 470.0)) tmp = Float64(x * Float64(Float64(z - 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 <= -1.65e+44) || ~((z <= 470.0))) tmp = x * ((z - y) / z); else tmp = x * (y / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.65e+44], N[Not[LessEqual[z, 470.0]], $MachinePrecision]], N[(x * N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+44} \lor \neg \left(z \leq 470\right):\\
\;\;\;\;x \cdot \frac{z - y}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -1.65000000000000007e44 or 470 < z Initial program 78.0%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 66.0%
mul-1-neg66.0%
associate-/l*59.1%
distribute-neg-frac59.1%
neg-sub059.1%
associate--r-59.1%
neg-sub059.1%
Simplified59.1%
Taylor expanded in x around 0 66.0%
associate-/l*59.1%
associate-/r/86.1%
Simplified86.1%
if -1.65000000000000007e44 < z < 470Initial program 91.6%
associate-*r/92.4%
Simplified92.4%
Taylor expanded in y around inf 76.0%
Final simplification80.2%
(FPCore (x y z t) :precision binary64 (if (<= z -6.5e+81) x (if (<= z 4800.0) (* x (/ y (- t z))) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.5e+81) {
tmp = x;
} else if (z <= 4800.0) {
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 <= (-6.5d+81)) then
tmp = x
else if (z <= 4800.0d0) 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 <= -6.5e+81) {
tmp = x;
} else if (z <= 4800.0) {
tmp = x * (y / (t - z));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -6.5e+81: tmp = x elif z <= 4800.0: tmp = x * (y / (t - z)) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -6.5e+81) tmp = x; elseif (z <= 4800.0) 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 <= -6.5e+81) tmp = x; elseif (z <= 4800.0) tmp = x * (y / (t - z)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6.5e+81], x, If[LessEqual[z, 4800.0], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+81}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4800:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -6.4999999999999996e81 or 4800 < z Initial program 78.0%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in z around inf 71.0%
if -6.4999999999999996e81 < z < 4800Initial program 91.2%
associate-*r/92.6%
Simplified92.6%
Taylor expanded in y around inf 75.2%
Final simplification73.5%
(FPCore (x y z t) :precision binary64 (if (<= z -2300000000.0) (/ x (/ (- z t) z)) (if (<= z 1.05) (/ x (/ (- t z) y)) (* x (/ (- z y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2300000000.0) {
tmp = x / ((z - t) / z);
} else if (z <= 1.05) {
tmp = x / ((t - z) / y);
} else {
tmp = x * ((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 (z <= (-2300000000.0d0)) then
tmp = x / ((z - t) / z)
else if (z <= 1.05d0) then
tmp = x / ((t - z) / y)
else
tmp = x * ((z - y) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2300000000.0) {
tmp = x / ((z - t) / z);
} else if (z <= 1.05) {
tmp = x / ((t - z) / y);
} else {
tmp = x * ((z - y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2300000000.0: tmp = x / ((z - t) / z) elif z <= 1.05: tmp = x / ((t - z) / y) else: tmp = x * ((z - y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2300000000.0) tmp = Float64(x / Float64(Float64(z - t) / z)); elseif (z <= 1.05) tmp = Float64(x / Float64(Float64(t - z) / y)); else tmp = Float64(x * Float64(Float64(z - y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2300000000.0) tmp = x / ((z - t) / z); elseif (z <= 1.05) tmp = x / ((t - z) / y); else tmp = x * ((z - y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2300000000.0], N[(x / N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2300000000:\\
\;\;\;\;\frac{x}{\frac{z - t}{z}}\\
\mathbf{elif}\;z \leq 1.05:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z - y}{z}\\
\end{array}
\end{array}
if z < -2.3e9Initial program 80.0%
associate-/l*99.9%
Simplified99.9%
div-inv99.9%
add-cube-cbrt98.1%
clear-num98.1%
associate-*l*98.1%
pow298.1%
Applied egg-rr98.1%
Taylor expanded in y around 0 71.7%
associate-*r/71.7%
mul-1-neg71.7%
distribute-lft-neg-out71.7%
*-commutative71.7%
associate-/l*85.9%
Simplified85.9%
frac-2neg85.9%
div-inv85.7%
sub-neg85.7%
distribute-neg-in85.7%
remove-double-neg85.7%
remove-double-neg85.7%
Applied egg-rr85.7%
associate-*r/85.9%
*-rgt-identity85.9%
+-commutative85.9%
unsub-neg85.9%
Simplified85.9%
if -2.3e9 < z < 1.05000000000000004Initial program 92.0%
associate-/l*93.0%
Simplified93.0%
Taylor expanded in y around inf 78.5%
if 1.05000000000000004 < z Initial program 76.7%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 66.7%
mul-1-neg66.7%
associate-/l*59.3%
distribute-neg-frac59.3%
neg-sub059.3%
associate--r-59.3%
neg-sub059.3%
Simplified59.3%
Taylor expanded in x around 0 66.7%
associate-/l*59.3%
associate-/r/86.9%
Simplified86.9%
Final simplification82.0%
(FPCore (x y z t) :precision binary64 (if (<= z -1.85) (/ x (/ (- z t) z)) (if (<= z 25.0) (/ y (/ (- t z) x)) (* x (/ (- z y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.85) {
tmp = x / ((z - t) / z);
} else if (z <= 25.0) {
tmp = y / ((t - z) / x);
} else {
tmp = x * ((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 (z <= (-1.85d0)) then
tmp = x / ((z - t) / z)
else if (z <= 25.0d0) then
tmp = y / ((t - z) / x)
else
tmp = x * ((z - y) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.85) {
tmp = x / ((z - t) / z);
} else if (z <= 25.0) {
tmp = y / ((t - z) / x);
} else {
tmp = x * ((z - y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.85: tmp = x / ((z - t) / z) elif z <= 25.0: tmp = y / ((t - z) / x) else: tmp = x * ((z - y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.85) tmp = Float64(x / Float64(Float64(z - t) / z)); elseif (z <= 25.0) tmp = Float64(y / Float64(Float64(t - z) / x)); else tmp = Float64(x * Float64(Float64(z - y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.85) tmp = x / ((z - t) / z); elseif (z <= 25.0) tmp = y / ((t - z) / x); else tmp = x * ((z - y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.85], N[(x / N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 25.0], N[(y / N[(N[(t - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85:\\
\;\;\;\;\frac{x}{\frac{z - t}{z}}\\
\mathbf{elif}\;z \leq 25:\\
\;\;\;\;\frac{y}{\frac{t - z}{x}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z - y}{z}\\
\end{array}
\end{array}
if z < -1.8500000000000001Initial program 80.0%
associate-/l*99.9%
Simplified99.9%
div-inv99.9%
add-cube-cbrt98.1%
clear-num98.1%
associate-*l*98.1%
pow298.1%
Applied egg-rr98.1%
Taylor expanded in y around 0 71.7%
associate-*r/71.7%
mul-1-neg71.7%
distribute-lft-neg-out71.7%
*-commutative71.7%
associate-/l*85.9%
Simplified85.9%
frac-2neg85.9%
div-inv85.7%
sub-neg85.7%
distribute-neg-in85.7%
remove-double-neg85.7%
remove-double-neg85.7%
Applied egg-rr85.7%
associate-*r/85.9%
*-rgt-identity85.9%
+-commutative85.9%
unsub-neg85.9%
Simplified85.9%
if -1.8500000000000001 < z < 25Initial program 92.0%
associate-*r/92.1%
Simplified92.1%
associate-*r/92.0%
associate-/l*93.0%
div-inv92.9%
associate-/r*95.6%
Applied egg-rr95.6%
Taylor expanded in y around inf 78.1%
associate-/l*80.9%
Simplified80.9%
if 25 < z Initial program 76.7%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 66.7%
mul-1-neg66.7%
associate-/l*59.3%
distribute-neg-frac59.3%
neg-sub059.3%
associate--r-59.3%
neg-sub059.3%
Simplified59.3%
Taylor expanded in x around 0 66.7%
associate-/l*59.3%
associate-/r/86.9%
Simplified86.9%
Final simplification83.4%
(FPCore (x y z t) :precision binary64 (if (<= z -1.55e+44) x (if (<= z 4200.0) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.55e+44) {
tmp = x;
} else if (z <= 4200.0) {
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 <= (-1.55d+44)) then
tmp = x
else if (z <= 4200.0d0) 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 <= -1.55e+44) {
tmp = x;
} else if (z <= 4200.0) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.55e+44: tmp = x elif z <= 4200.0: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.55e+44) tmp = x; elseif (z <= 4200.0) 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 <= -1.55e+44) tmp = x; elseif (z <= 4200.0) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.55e+44], x, If[LessEqual[z, 4200.0], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+44}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4200:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.54999999999999998e44 or 4200 < z Initial program 78.0%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in z around inf 69.4%
if -1.54999999999999998e44 < z < 4200Initial program 91.6%
associate-*r/92.4%
Simplified92.4%
Taylor expanded in z around 0 63.9%
Final simplification66.2%
(FPCore (x y z t) :precision binary64 (if (<= z -1.55e+44) x (if (<= z 290.0) (* y (/ x t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.55e+44) {
tmp = x;
} else if (z <= 290.0) {
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.55d+44)) then
tmp = x
else if (z <= 290.0d0) 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.55e+44) {
tmp = x;
} else if (z <= 290.0) {
tmp = y * (x / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.55e+44: tmp = x elif z <= 290.0: tmp = y * (x / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.55e+44) tmp = x; elseif (z <= 290.0) 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.55e+44) tmp = x; elseif (z <= 290.0) tmp = y * (x / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.55e+44], x, If[LessEqual[z, 290.0], N[(y * N[(x / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+44}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 290:\\
\;\;\;\;y \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.54999999999999998e44 or 290 < z Initial program 78.0%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in z around inf 69.4%
if -1.54999999999999998e44 < z < 290Initial program 91.6%
associate-/l*93.3%
Simplified93.3%
Taylor expanded in z around 0 64.1%
associate-/r/64.8%
Applied egg-rr64.8%
Final simplification66.7%
(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 85.9%
associate-*r/95.5%
Simplified95.5%
Final simplification95.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 85.9%
associate-*r/95.5%
Simplified95.5%
Taylor expanded in z around inf 35.7%
Final simplification35.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 2023185
(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)))