
(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 87.1%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in x around 0 87.1%
*-rgt-identity87.1%
times-frac81.8%
/-rgt-identity81.8%
associate-/r/97.4%
Simplified97.4%
(FPCore (x y z t) :precision binary64 (if (<= z -1.65e+93) x (if (<= z -1e-84) (* y (/ x (- z))) (if (<= z 1.28e+39) (/ x (/ t y)) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.65e+93) {
tmp = x;
} else if (z <= -1e-84) {
tmp = y * (x / -z);
} else if (z <= 1.28e+39) {
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.65d+93)) then
tmp = x
else if (z <= (-1d-84)) then
tmp = y * (x / -z)
else if (z <= 1.28d+39) 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.65e+93) {
tmp = x;
} else if (z <= -1e-84) {
tmp = y * (x / -z);
} else if (z <= 1.28e+39) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.65e+93: tmp = x elif z <= -1e-84: tmp = y * (x / -z) elif z <= 1.28e+39: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.65e+93) tmp = x; elseif (z <= -1e-84) tmp = Float64(y * Float64(x / Float64(-z))); elseif (z <= 1.28e+39) 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.65e+93) tmp = x; elseif (z <= -1e-84) tmp = y * (x / -z); elseif (z <= 1.28e+39) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.65e+93], x, If[LessEqual[z, -1e-84], N[(y * N[(x / (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.28e+39], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+93}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-84}:\\
\;\;\;\;y \cdot \frac{x}{-z}\\
\mathbf{elif}\;z \leq 1.28 \cdot 10^{+39}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.65000000000000004e93 or 1.27999999999999994e39 < z Initial program 79.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 70.2%
if -1.65000000000000004e93 < z < -1e-84Initial program 97.4%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in x around 0 97.4%
*-rgt-identity97.4%
times-frac90.8%
/-rgt-identity90.8%
associate-/r/97.4%
Simplified97.4%
Taylor expanded in y around inf 65.4%
associate-*l/60.9%
*-commutative60.9%
Simplified60.9%
Taylor expanded in t around 0 48.1%
neg-mul-148.1%
distribute-neg-frac48.1%
Simplified48.1%
if -1e-84 < z < 1.27999999999999994e39Initial program 89.8%
associate-/l*94.9%
Simplified94.9%
Taylor expanded in x around 0 89.8%
*-rgt-identity89.8%
times-frac93.1%
/-rgt-identity93.1%
associate-/r/95.4%
Simplified95.4%
Taylor expanded in z around 0 64.7%
Final simplification64.1%
(FPCore (x y z t) :precision binary64 (if (<= z -1.65e+93) x (if (<= z -9.8e-85) (* x (/ y (- z))) (if (<= z 9.5e+38) (/ x (/ t y)) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.65e+93) {
tmp = x;
} else if (z <= -9.8e-85) {
tmp = x * (y / -z);
} else if (z <= 9.5e+38) {
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.65d+93)) then
tmp = x
else if (z <= (-9.8d-85)) then
tmp = x * (y / -z)
else if (z <= 9.5d+38) 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.65e+93) {
tmp = x;
} else if (z <= -9.8e-85) {
tmp = x * (y / -z);
} else if (z <= 9.5e+38) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.65e+93: tmp = x elif z <= -9.8e-85: tmp = x * (y / -z) elif z <= 9.5e+38: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.65e+93) tmp = x; elseif (z <= -9.8e-85) tmp = Float64(x * Float64(y / Float64(-z))); elseif (z <= 9.5e+38) 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.65e+93) tmp = x; elseif (z <= -9.8e-85) tmp = x * (y / -z); elseif (z <= 9.5e+38) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.65e+93], x, If[LessEqual[z, -9.8e-85], N[(x * N[(y / (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e+38], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+93}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -9.8 \cdot 10^{-85}:\\
\;\;\;\;x \cdot \frac{y}{-z}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+38}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.65000000000000004e93 or 9.4999999999999995e38 < z Initial program 79.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 70.2%
if -1.65000000000000004e93 < z < -9.80000000000000029e-85Initial program 97.4%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in t around 0 58.9%
mul-1-neg58.9%
associate-/l*58.9%
distribute-rgt-neg-in58.9%
distribute-frac-neg58.9%
sub-neg58.9%
distribute-neg-in58.9%
remove-double-neg58.9%
+-commutative58.9%
sub-neg58.9%
div-sub58.9%
*-inverses58.9%
Simplified58.9%
Taylor expanded in y around inf 43.9%
mul-1-neg43.9%
associate-/l*43.8%
distribute-rgt-neg-in43.8%
distribute-frac-neg43.8%
Simplified43.8%
if -9.80000000000000029e-85 < z < 9.4999999999999995e38Initial program 89.8%
associate-/l*94.9%
Simplified94.9%
Taylor expanded in x around 0 89.8%
*-rgt-identity89.8%
times-frac93.1%
/-rgt-identity93.1%
associate-/r/95.4%
Simplified95.4%
Taylor expanded in z around 0 64.7%
Final simplification63.4%
(FPCore (x y z t) :precision binary64 (if (<= y -4e+40) (/ x (/ (- t z) y)) (if (<= y 7.4e-16) (/ (- x) (+ (/ t z) -1.0)) (/ (* x y) (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4e+40) {
tmp = x / ((t - z) / y);
} else if (y <= 7.4e-16) {
tmp = -x / ((t / z) + -1.0);
} 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 (y <= (-4d+40)) then
tmp = x / ((t - z) / y)
else if (y <= 7.4d-16) then
tmp = -x / ((t / z) + (-1.0d0))
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 (y <= -4e+40) {
tmp = x / ((t - z) / y);
} else if (y <= 7.4e-16) {
tmp = -x / ((t / z) + -1.0);
} else {
tmp = (x * y) / (t - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4e+40: tmp = x / ((t - z) / y) elif y <= 7.4e-16: tmp = -x / ((t / z) + -1.0) else: tmp = (x * y) / (t - z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4e+40) tmp = Float64(x / Float64(Float64(t - z) / y)); elseif (y <= 7.4e-16) tmp = Float64(Float64(-x) / Float64(Float64(t / z) + -1.0)); else tmp = Float64(Float64(x * y) / Float64(t - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4e+40) tmp = x / ((t - z) / y); elseif (y <= 7.4e-16) tmp = -x / ((t / z) + -1.0); else tmp = (x * y) / (t - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4e+40], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.4e-16], N[((-x) / N[(N[(t / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{+40}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{elif}\;y \leq 7.4 \cdot 10^{-16}:\\
\;\;\;\;\frac{-x}{\frac{t}{z} + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{t - z}\\
\end{array}
\end{array}
if y < -4.00000000000000012e40Initial program 81.8%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in x around 0 81.8%
*-rgt-identity81.8%
times-frac87.8%
/-rgt-identity87.8%
associate-/r/99.0%
Simplified99.0%
Taylor expanded in y around inf 80.4%
if -4.00000000000000012e40 < y < 7.3999999999999999e-16Initial program 88.7%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in x around 0 88.7%
*-rgt-identity88.7%
times-frac80.5%
/-rgt-identity80.5%
associate-/r/98.4%
Simplified98.4%
Taylor expanded in y around 0 82.9%
mul-1-neg82.9%
div-sub82.9%
sub-neg82.9%
*-inverses82.9%
metadata-eval82.9%
Simplified82.9%
if 7.3999999999999999e-16 < y Initial program 89.1%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in y around inf 75.7%
Final simplification80.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.8e+41) (not (<= y 2.2e-21))) (/ x (/ (- t z) y)) (* x (/ z (- z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.8e+41) || !(y <= 2.2e-21)) {
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 <= (-1.8d+41)) .or. (.not. (y <= 2.2d-21))) 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 <= -1.8e+41) || !(y <= 2.2e-21)) {
tmp = x / ((t - z) / y);
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.8e+41) or not (y <= 2.2e-21): tmp = x / ((t - z) / y) else: tmp = x * (z / (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.8e+41) || !(y <= 2.2e-21)) 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 <= -1.8e+41) || ~((y <= 2.2e-21))) 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, -1.8e+41], N[Not[LessEqual[y, 2.2e-21]], $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 -1.8 \cdot 10^{+41} \lor \neg \left(y \leq 2.2 \cdot 10^{-21}\right):\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if y < -1.80000000000000013e41 or 2.2000000000000001e-21 < y Initial program 85.7%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in x around 0 85.7%
*-rgt-identity85.7%
times-frac83.0%
/-rgt-identity83.0%
associate-/r/96.6%
Simplified96.6%
Taylor expanded in y around inf 77.2%
if -1.80000000000000013e41 < y < 2.2000000000000001e-21Initial program 88.7%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in y around 0 73.4%
mul-1-neg73.4%
distribute-neg-frac273.4%
sub-neg73.4%
distribute-neg-in73.4%
remove-double-neg73.4%
+-commutative73.4%
sub-neg73.4%
associate-/l*82.8%
Simplified82.8%
Final simplification79.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -6e+40) (not (<= y 2.4e-14))) (* x (/ y (- t z))) (* x (/ z (- z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6e+40) || !(y <= 2.4e-14)) {
tmp = x * (y / (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 <= (-6d+40)) .or. (.not. (y <= 2.4d-14))) then
tmp = x * (y / (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 <= -6e+40) || !(y <= 2.4e-14)) {
tmp = x * (y / (t - z));
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -6e+40) or not (y <= 2.4e-14): tmp = x * (y / (t - z)) else: tmp = x * (z / (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -6e+40) || !(y <= 2.4e-14)) tmp = Float64(x * Float64(y / 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 <= -6e+40) || ~((y <= 2.4e-14))) tmp = x * (y / (t - z)); else tmp = x * (z / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -6e+40], N[Not[LessEqual[y, 2.4e-14]], $MachinePrecision]], N[(x * N[(y / 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 -6 \cdot 10^{+40} \lor \neg \left(y \leq 2.4 \cdot 10^{-14}\right):\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if y < -6.0000000000000004e40 or 2.4e-14 < y Initial program 85.7%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in y around inf 72.6%
associate-/l*76.8%
Simplified76.8%
if -6.0000000000000004e40 < y < 2.4e-14Initial program 88.7%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in y around 0 73.4%
mul-1-neg73.4%
distribute-neg-frac273.4%
sub-neg73.4%
distribute-neg-in73.4%
remove-double-neg73.4%
+-commutative73.4%
sub-neg73.4%
associate-/l*82.8%
Simplified82.8%
Final simplification79.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.55e+50) (not (<= z 9e+38))) (* x (- 1.0 (/ y z))) (* x (/ y (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.55e+50) || !(z <= 9e+38)) {
tmp = x * (1.0 - (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.55d+50)) .or. (.not. (z <= 9d+38))) then
tmp = x * (1.0d0 - (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.55e+50) || !(z <= 9e+38)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.55e+50) or not (z <= 9e+38): tmp = x * (1.0 - (y / z)) else: tmp = x * (y / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.55e+50) || !(z <= 9e+38)) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = Float64(x * Float64(y / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.55e+50) || ~((z <= 9e+38))) tmp = x * (1.0 - (y / z)); else tmp = x * (y / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.55e+50], N[Not[LessEqual[z, 9e+38]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+50} \lor \neg \left(z \leq 9 \cdot 10^{+38}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -1.55000000000000001e50 or 8.99999999999999961e38 < z Initial program 80.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 67.7%
mul-1-neg67.7%
associate-/l*84.6%
distribute-rgt-neg-in84.6%
distribute-frac-neg84.6%
sub-neg84.6%
distribute-neg-in84.6%
remove-double-neg84.6%
+-commutative84.6%
sub-neg84.6%
div-sub84.6%
*-inverses84.6%
Simplified84.6%
if -1.55000000000000001e50 < z < 8.99999999999999961e38Initial program 91.8%
associate-/l*95.2%
Simplified95.2%
Taylor expanded in y around inf 69.0%
associate-/l*70.5%
Simplified70.5%
Final simplification76.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -9.2e-86) (not (<= z 3.15e+38))) (* x (- 1.0 (/ y z))) (/ x (/ t y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9.2e-86) || !(z <= 3.15e+38)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x / (t / 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) :: tmp
if ((z <= (-9.2d-86)) .or. (.not. (z <= 3.15d+38))) then
tmp = x * (1.0d0 - (y / z))
else
tmp = x / (t / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9.2e-86) || !(z <= 3.15e+38)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x / (t / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -9.2e-86) or not (z <= 3.15e+38): tmp = x * (1.0 - (y / z)) else: tmp = x / (t / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -9.2e-86) || !(z <= 3.15e+38)) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = Float64(x / Float64(t / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -9.2e-86) || ~((z <= 3.15e+38))) tmp = x * (1.0 - (y / z)); else tmp = x / (t / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -9.2e-86], N[Not[LessEqual[z, 3.15e+38]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{-86} \lor \neg \left(z \leq 3.15 \cdot 10^{+38}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\end{array}
\end{array}
if z < -9.19999999999999985e-86 or 3.15000000000000001e38 < z Initial program 84.9%
associate-/l*99.2%
Simplified99.2%
Taylor expanded in t around 0 64.3%
mul-1-neg64.3%
associate-/l*76.9%
distribute-rgt-neg-in76.9%
distribute-frac-neg76.9%
sub-neg76.9%
distribute-neg-in76.9%
remove-double-neg76.9%
+-commutative76.9%
sub-neg76.9%
div-sub76.9%
*-inverses76.9%
Simplified76.9%
if -9.19999999999999985e-86 < z < 3.15000000000000001e38Initial program 89.8%
associate-/l*94.9%
Simplified94.9%
Taylor expanded in x around 0 89.8%
*-rgt-identity89.8%
times-frac93.1%
/-rgt-identity93.1%
associate-/r/95.4%
Simplified95.4%
Taylor expanded in z around 0 64.7%
Final simplification71.4%
(FPCore (x y z t) :precision binary64 (if (<= y -6e+40) (/ x (/ (- t z) y)) (if (<= y 7e-26) (* x (/ z (- z t))) (/ (* x y) (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6e+40) {
tmp = x / ((t - z) / y);
} else if (y <= 7e-26) {
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 (y <= (-6d+40)) then
tmp = x / ((t - z) / y)
else if (y <= 7d-26) 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 (y <= -6e+40) {
tmp = x / ((t - z) / y);
} else if (y <= 7e-26) {
tmp = x * (z / (z - t));
} else {
tmp = (x * y) / (t - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6e+40: tmp = x / ((t - z) / y) elif y <= 7e-26: tmp = x * (z / (z - t)) else: tmp = (x * y) / (t - z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6e+40) tmp = Float64(x / Float64(Float64(t - z) / y)); elseif (y <= 7e-26) tmp = Float64(x * Float64(z / Float64(z - t))); else tmp = Float64(Float64(x * y) / Float64(t - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6e+40) tmp = x / ((t - z) / y); elseif (y <= 7e-26) tmp = x * (z / (z - t)); else tmp = (x * y) / (t - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6e+40], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e-26], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{+40}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-26}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{t - z}\\
\end{array}
\end{array}
if y < -6.0000000000000004e40Initial program 81.8%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in x around 0 81.8%
*-rgt-identity81.8%
times-frac87.8%
/-rgt-identity87.8%
associate-/r/99.0%
Simplified99.0%
Taylor expanded in y around inf 80.4%
if -6.0000000000000004e40 < y < 6.9999999999999997e-26Initial program 88.7%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in y around 0 73.4%
mul-1-neg73.4%
distribute-neg-frac273.4%
sub-neg73.4%
distribute-neg-in73.4%
remove-double-neg73.4%
+-commutative73.4%
sub-neg73.4%
associate-/l*82.8%
Simplified82.8%
if 6.9999999999999997e-26 < y Initial program 89.1%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in y around inf 75.7%
(FPCore (x y z t) :precision binary64 (if (<= z -4.4e+50) x (if (<= z 1.95e+39) (/ x (/ t y)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.4e+50) {
tmp = x;
} else if (z <= 1.95e+39) {
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 <= (-4.4d+50)) then
tmp = x
else if (z <= 1.95d+39) 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 <= -4.4e+50) {
tmp = x;
} else if (z <= 1.95e+39) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.4e+50: tmp = x elif z <= 1.95e+39: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.4e+50) tmp = x; elseif (z <= 1.95e+39) 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 <= -4.4e+50) tmp = x; elseif (z <= 1.95e+39) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.4e+50], x, If[LessEqual[z, 1.95e+39], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+50}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{+39}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.40000000000000034e50 or 1.95e39 < z Initial program 80.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 65.6%
if -4.40000000000000034e50 < z < 1.95e39Initial program 91.8%
associate-/l*95.2%
Simplified95.2%
Taylor expanded in x around 0 91.8%
*-rgt-identity91.8%
times-frac91.9%
/-rgt-identity91.9%
associate-/r/95.6%
Simplified95.6%
Taylor expanded in z around 0 57.8%
(FPCore (x y z t) :precision binary64 (if (<= z -1.55e+50) x (if (<= z 8e+39) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.55e+50) {
tmp = x;
} else if (z <= 8e+39) {
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+50)) then
tmp = x
else if (z <= 8d+39) 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+50) {
tmp = x;
} else if (z <= 8e+39) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.55e+50: tmp = x elif z <= 8e+39: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.55e+50) tmp = x; elseif (z <= 8e+39) 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+50) tmp = x; elseif (z <= 8e+39) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.55e+50], x, If[LessEqual[z, 8e+39], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+50}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+39}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.55000000000000001e50 or 7.99999999999999952e39 < z Initial program 80.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 65.6%
if -1.55000000000000001e50 < z < 7.99999999999999952e39Initial program 91.8%
associate-/l*95.2%
Simplified95.2%
Taylor expanded in z around 0 55.7%
associate-/l*57.4%
Simplified57.4%
(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.1%
associate-/l*97.2%
Simplified97.2%
(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.1%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around inf 34.9%
(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 2024145
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (/ x (/ (- t z) (- y z))))
(/ (* x (- y z)) (- t z)))