
(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 9 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 86.8%
associate-/l*98.1%
Simplified98.1%
Final simplification98.1%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.32e+91)
x
(if (<= z -0.00116)
(* x (/ y (- z)))
(if (<= z -4.7e-35) x (if (<= z 950000.0) (* x (/ y t)) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.32e+91) {
tmp = x;
} else if (z <= -0.00116) {
tmp = x * (y / -z);
} else if (z <= -4.7e-35) {
tmp = x;
} else if (z <= 950000.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.32d+91)) then
tmp = x
else if (z <= (-0.00116d0)) then
tmp = x * (y / -z)
else if (z <= (-4.7d-35)) then
tmp = x
else if (z <= 950000.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.32e+91) {
tmp = x;
} else if (z <= -0.00116) {
tmp = x * (y / -z);
} else if (z <= -4.7e-35) {
tmp = x;
} else if (z <= 950000.0) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.32e+91: tmp = x elif z <= -0.00116: tmp = x * (y / -z) elif z <= -4.7e-35: tmp = x elif z <= 950000.0: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.32e+91) tmp = x; elseif (z <= -0.00116) tmp = Float64(x * Float64(y / Float64(-z))); elseif (z <= -4.7e-35) tmp = x; elseif (z <= 950000.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.32e+91) tmp = x; elseif (z <= -0.00116) tmp = x * (y / -z); elseif (z <= -4.7e-35) tmp = x; elseif (z <= 950000.0) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.32e+91], x, If[LessEqual[z, -0.00116], N[(x * N[(y / (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.7e-35], x, If[LessEqual[z, 950000.0], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.32 \cdot 10^{+91}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -0.00116:\\
\;\;\;\;x \cdot \frac{y}{-z}\\
\mathbf{elif}\;z \leq -4.7 \cdot 10^{-35}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 950000:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.32000000000000003e91 or -0.00116 < z < -4.7e-35 or 9.5e5 < z Initial program 75.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 70.7%
if -1.32000000000000003e91 < z < -0.00116Initial program 86.3%
associate-/l*99.6%
Simplified99.6%
clear-num99.6%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 54.7%
associate-*l/59.4%
*-commutative59.4%
Simplified59.4%
Taylor expanded in t around 0 45.0%
mul-1-neg45.0%
associate-/l*45.0%
distribute-rgt-neg-in45.0%
Simplified45.0%
if -4.7e-35 < z < 9.5e5Initial program 95.4%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in z around 0 64.1%
associate-/l*65.5%
Simplified65.5%
Final simplification65.8%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.32e+91)
x
(if (<= z -0.000102)
(/ (* x y) (- z))
(if (<= z -1.05e-34) x (if (<= z 410000.0) (* x (/ y t)) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.32e+91) {
tmp = x;
} else if (z <= -0.000102) {
tmp = (x * y) / -z;
} else if (z <= -1.05e-34) {
tmp = x;
} else if (z <= 410000.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.32d+91)) then
tmp = x
else if (z <= (-0.000102d0)) then
tmp = (x * y) / -z
else if (z <= (-1.05d-34)) then
tmp = x
else if (z <= 410000.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.32e+91) {
tmp = x;
} else if (z <= -0.000102) {
tmp = (x * y) / -z;
} else if (z <= -1.05e-34) {
tmp = x;
} else if (z <= 410000.0) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.32e+91: tmp = x elif z <= -0.000102: tmp = (x * y) / -z elif z <= -1.05e-34: tmp = x elif z <= 410000.0: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.32e+91) tmp = x; elseif (z <= -0.000102) tmp = Float64(Float64(x * y) / Float64(-z)); elseif (z <= -1.05e-34) tmp = x; elseif (z <= 410000.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.32e+91) tmp = x; elseif (z <= -0.000102) tmp = (x * y) / -z; elseif (z <= -1.05e-34) tmp = x; elseif (z <= 410000.0) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.32e+91], x, If[LessEqual[z, -0.000102], N[(N[(x * y), $MachinePrecision] / (-z)), $MachinePrecision], If[LessEqual[z, -1.05e-34], x, If[LessEqual[z, 410000.0], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.32 \cdot 10^{+91}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -0.000102:\\
\;\;\;\;\frac{x \cdot y}{-z}\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-34}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 410000:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.32000000000000003e91 or -1.01999999999999999e-4 < z < -1.05e-34 or 4.1e5 < z Initial program 75.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 70.7%
if -1.32000000000000003e91 < z < -1.01999999999999999e-4Initial program 86.3%
associate-/l*99.6%
Simplified99.6%
clear-num99.6%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 54.7%
associate-*l/59.4%
*-commutative59.4%
Simplified59.4%
Taylor expanded in t around 0 45.0%
associate-*r/45.0%
mul-1-neg45.0%
distribute-rgt-neg-out45.0%
Simplified45.0%
if -1.05e-34 < z < 4.1e5Initial program 95.4%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in z around 0 64.1%
associate-/l*65.5%
Simplified65.5%
Final simplification65.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.2e-89) (not (<= z 290000.0))) (* x (- 1.0 (/ y z))) (* x (/ y t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.2e-89) || !(z <= 290000.0)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * (y / 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 <= (-3.2d-89)) .or. (.not. (z <= 290000.0d0))) then
tmp = x * (1.0d0 - (y / z))
else
tmp = x * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.2e-89) || !(z <= 290000.0)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.2e-89) or not (z <= 290000.0): tmp = x * (1.0 - (y / z)) else: tmp = x * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.2e-89) || !(z <= 290000.0)) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = Float64(x * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.2e-89) || ~((z <= 290000.0))) tmp = x * (1.0 - (y / z)); else tmp = x * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.2e-89], N[Not[LessEqual[z, 290000.0]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{-89} \lor \neg \left(z \leq 290000\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\end{array}
\end{array}
if z < -3.19999999999999998e-89 or 2.9e5 < z Initial program 78.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 58.4%
mul-1-neg58.4%
associate-/l*72.7%
distribute-rgt-neg-in72.7%
distribute-frac-neg72.7%
neg-sub072.7%
associate--r-72.7%
neg-sub072.7%
+-commutative72.7%
sub-neg72.7%
div-sub72.7%
*-inverses72.7%
Simplified72.7%
if -3.19999999999999998e-89 < z < 2.9e5Initial program 95.7%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in z around 0 68.1%
associate-/l*68.9%
Simplified68.9%
Final simplification70.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -0.0034) (not (<= y 2.1e-56))) (* y (/ x (- t z))) (* x (/ z (- z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -0.0034) || !(y <= 2.1e-56)) {
tmp = y * (x / (t - z));
} else {
tmp = x * (z / (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 ((y <= (-0.0034d0)) .or. (.not. (y <= 2.1d-56))) then
tmp = y * (x / (t - z))
else
tmp = x * (z / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -0.0034) || !(y <= 2.1e-56)) {
tmp = y * (x / (t - z));
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -0.0034) or not (y <= 2.1e-56): tmp = y * (x / (t - z)) else: tmp = x * (z / (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -0.0034) || !(y <= 2.1e-56)) tmp = Float64(y * Float64(x / Float64(t - z))); else tmp = Float64(x * Float64(z / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -0.0034) || ~((y <= 2.1e-56))) tmp = y * (x / (t - z)); else tmp = x * (z / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -0.0034], N[Not[LessEqual[y, 2.1e-56]], $MachinePrecision]], N[(y * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.0034 \lor \neg \left(y \leq 2.1 \cdot 10^{-56}\right):\\
\;\;\;\;y \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if y < -0.00339999999999999981 or 2.10000000000000006e-56 < y Initial program 88.9%
associate-/l*97.5%
Simplified97.5%
clear-num97.5%
un-div-inv97.6%
Applied egg-rr97.6%
Taylor expanded in y around inf 75.2%
associate-*l/74.2%
*-commutative74.2%
Simplified74.2%
if -0.00339999999999999981 < y < 2.10000000000000006e-56Initial program 84.6%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in y around 0 71.3%
mul-1-neg71.3%
distribute-neg-frac271.3%
neg-sub071.3%
associate--r-71.3%
neg-sub071.3%
+-commutative71.3%
sub-neg71.3%
associate-/l*84.4%
Simplified84.4%
Final simplification79.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -0.00335) (not (<= y 6e-56))) (/ x (/ (- t z) y)) (* x (/ z (- z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -0.00335) || !(y <= 6e-56)) {
tmp = x / ((t - z) / y);
} else {
tmp = x * (z / (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 ((y <= (-0.00335d0)) .or. (.not. (y <= 6d-56))) then
tmp = x / ((t - z) / y)
else
tmp = x * (z / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -0.00335) || !(y <= 6e-56)) {
tmp = x / ((t - z) / y);
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -0.00335) or not (y <= 6e-56): tmp = x / ((t - z) / y) else: tmp = x * (z / (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -0.00335) || !(y <= 6e-56)) tmp = Float64(x / Float64(Float64(t - z) / y)); else tmp = Float64(x * Float64(z / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -0.00335) || ~((y <= 6e-56))) tmp = x / ((t - z) / y); else tmp = x * (z / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -0.00335], N[Not[LessEqual[y, 6e-56]], $MachinePrecision]], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00335 \lor \neg \left(y \leq 6 \cdot 10^{-56}\right):\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if y < -0.00335000000000000011 or 5.99999999999999979e-56 < y Initial program 88.9%
associate-/l*97.5%
Simplified97.5%
clear-num97.5%
un-div-inv97.6%
Applied egg-rr97.6%
Taylor expanded in y around inf 80.9%
if -0.00335000000000000011 < y < 5.99999999999999979e-56Initial program 84.6%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in y around 0 71.3%
mul-1-neg71.3%
distribute-neg-frac271.3%
neg-sub071.3%
associate--r-71.3%
neg-sub071.3%
+-commutative71.3%
sub-neg71.3%
associate-/l*84.4%
Simplified84.4%
Final simplification82.7%
(FPCore (x y z t) :precision binary64 (if (<= z -1.9e-89) (* x (- 1.0 (/ y z))) (if (<= z 1.1e-18) (* x (/ y t)) (* x (/ z (- z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.9e-89) {
tmp = x * (1.0 - (y / z));
} else if (z <= 1.1e-18) {
tmp = x * (y / t);
} else {
tmp = x * (z / (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 <= (-1.9d-89)) then
tmp = x * (1.0d0 - (y / z))
else if (z <= 1.1d-18) then
tmp = x * (y / t)
else
tmp = x * (z / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.9e-89) {
tmp = x * (1.0 - (y / z));
} else if (z <= 1.1e-18) {
tmp = x * (y / t);
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.9e-89: tmp = x * (1.0 - (y / z)) elif z <= 1.1e-18: tmp = x * (y / t) else: tmp = x * (z / (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.9e-89) tmp = Float64(x * Float64(1.0 - Float64(y / z))); elseif (z <= 1.1e-18) tmp = Float64(x * Float64(y / t)); else tmp = Float64(x * Float64(z / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.9e-89) tmp = x * (1.0 - (y / z)); elseif (z <= 1.1e-18) tmp = x * (y / t); else tmp = x * (z / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.9e-89], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-18], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-89}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-18}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if z < -1.9000000000000001e-89Initial program 80.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 60.2%
mul-1-neg60.2%
associate-/l*70.3%
distribute-rgt-neg-in70.3%
distribute-frac-neg70.3%
neg-sub070.3%
associate--r-70.3%
neg-sub070.3%
+-commutative70.3%
sub-neg70.3%
div-sub70.4%
*-inverses70.4%
Simplified70.4%
if -1.9000000000000001e-89 < z < 1.0999999999999999e-18Initial program 96.2%
associate-/l*96.0%
Simplified96.0%
Taylor expanded in z around 0 71.6%
associate-/l*71.6%
Simplified71.6%
if 1.0999999999999999e-18 < z Initial program 77.5%
associate-/l*99.5%
Simplified99.5%
Taylor expanded in y around 0 66.5%
mul-1-neg66.5%
distribute-neg-frac266.5%
neg-sub066.5%
associate--r-66.5%
neg-sub066.5%
+-commutative66.5%
sub-neg66.5%
associate-/l*83.7%
Simplified83.7%
Final simplification74.0%
(FPCore (x y z t) :precision binary64 (if (<= z -1.2e-34) x (if (<= z 43000.0) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.2e-34) {
tmp = x;
} else if (z <= 43000.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.2d-34)) then
tmp = x
else if (z <= 43000.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.2e-34) {
tmp = x;
} else if (z <= 43000.0) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.2e-34: tmp = x elif z <= 43000.0: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.2e-34) tmp = x; elseif (z <= 43000.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.2e-34) tmp = x; elseif (z <= 43000.0) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.2e-34], x, If[LessEqual[z, 43000.0], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{-34}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 43000:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.19999999999999996e-34 or 43000 < z Initial program 77.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 62.2%
if -1.19999999999999996e-34 < z < 43000Initial program 95.4%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in z around 0 64.1%
associate-/l*65.5%
Simplified65.5%
Final simplification63.9%
(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 86.8%
associate-/l*98.1%
Simplified98.1%
Taylor expanded in z around inf 34.1%
Final simplification34.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 2024130
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:alt
(/ x (/ (- t z) (- y z)))
(/ (* x (- y z)) (- t z)))