
(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 84.9%
associate-/l*97.0%
Simplified97.0%
Final simplification97.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ y (- t z)))))
(if (<= y -6.4e+46)
t_1
(if (<= y -1.8e-31)
(* x (- 1.0 (/ y z)))
(if (<= y -1.52e-38)
t_1
(if (<= y 1.5e+88)
(/ x (- (/ t (- z)) -1.0))
(/ x (/ (- t z) y))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y / (t - z));
double tmp;
if (y <= -6.4e+46) {
tmp = t_1;
} else if (y <= -1.8e-31) {
tmp = x * (1.0 - (y / z));
} else if (y <= -1.52e-38) {
tmp = t_1;
} else if (y <= 1.5e+88) {
tmp = x / ((t / -z) - -1.0);
} 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 * (y / (t - z))
if (y <= (-6.4d+46)) then
tmp = t_1
else if (y <= (-1.8d-31)) then
tmp = x * (1.0d0 - (y / z))
else if (y <= (-1.52d-38)) then
tmp = t_1
else if (y <= 1.5d+88) then
tmp = x / ((t / -z) - (-1.0d0))
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 * (y / (t - z));
double tmp;
if (y <= -6.4e+46) {
tmp = t_1;
} else if (y <= -1.8e-31) {
tmp = x * (1.0 - (y / z));
} else if (y <= -1.52e-38) {
tmp = t_1;
} else if (y <= 1.5e+88) {
tmp = x / ((t / -z) - -1.0);
} else {
tmp = x / ((t - z) / y);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y / (t - z)) tmp = 0 if y <= -6.4e+46: tmp = t_1 elif y <= -1.8e-31: tmp = x * (1.0 - (y / z)) elif y <= -1.52e-38: tmp = t_1 elif y <= 1.5e+88: tmp = x / ((t / -z) - -1.0) else: tmp = x / ((t - z) / y) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y / Float64(t - z))) tmp = 0.0 if (y <= -6.4e+46) tmp = t_1; elseif (y <= -1.8e-31) tmp = Float64(x * Float64(1.0 - Float64(y / z))); elseif (y <= -1.52e-38) tmp = t_1; elseif (y <= 1.5e+88) tmp = Float64(x / Float64(Float64(t / Float64(-z)) - -1.0)); else tmp = Float64(x / Float64(Float64(t - z) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y / (t - z)); tmp = 0.0; if (y <= -6.4e+46) tmp = t_1; elseif (y <= -1.8e-31) tmp = x * (1.0 - (y / z)); elseif (y <= -1.52e-38) tmp = t_1; elseif (y <= 1.5e+88) tmp = x / ((t / -z) - -1.0); else tmp = x / ((t - z) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.4e+46], t$95$1, If[LessEqual[y, -1.8e-31], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.52e-38], t$95$1, If[LessEqual[y, 1.5e+88], N[(x / N[(N[(t / (-z)), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{t - z}\\
\mathbf{if}\;y \leq -6.4 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.8 \cdot 10^{-31}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;y \leq -1.52 \cdot 10^{-38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+88}:\\
\;\;\;\;\frac{x}{\frac{t}{-z} - -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\end{array}
\end{array}
if y < -6.3999999999999996e46 or -1.80000000000000002e-31 < y < -1.5200000000000001e-38Initial program 86.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around inf 76.8%
associate-/l*84.4%
Simplified84.4%
if -6.3999999999999996e46 < y < -1.80000000000000002e-31Initial program 83.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 52.1%
mul-1-neg52.1%
associate-/l*68.9%
distribute-rgt-neg-in68.9%
distribute-frac-neg68.9%
neg-sub068.9%
associate--r-68.9%
neg-sub068.9%
+-commutative68.9%
sub-neg68.9%
div-sub68.9%
*-inverses68.9%
Simplified68.9%
if -1.5200000000000001e-38 < y < 1.50000000000000003e88Initial program 86.9%
associate-/l*97.4%
Simplified97.4%
clear-num97.2%
un-div-inv97.2%
Applied egg-rr97.2%
Taylor expanded in y around 0 84.1%
mul-1-neg84.1%
div-sub84.1%
sub-neg84.1%
*-inverses84.1%
metadata-eval84.1%
Simplified84.1%
if 1.50000000000000003e88 < y Initial program 76.1%
associate-/l*89.1%
Simplified89.1%
clear-num89.1%
un-div-inv89.4%
Applied egg-rr89.4%
Taylor expanded in y around inf 73.0%
Final simplification81.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ y (- t z)))))
(if (<= y -1.7e+43)
t_1
(if (<= y -2.25e-32)
(* x (- 1.0 (/ y z)))
(if (or (<= y -8.2e-39) (not (<= y 1.45e+88)))
t_1
(* x (/ z (- z t))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y / (t - z));
double tmp;
if (y <= -1.7e+43) {
tmp = t_1;
} else if (y <= -2.25e-32) {
tmp = x * (1.0 - (y / z));
} else if ((y <= -8.2e-39) || !(y <= 1.45e+88)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x * (y / (t - z))
if (y <= (-1.7d+43)) then
tmp = t_1
else if (y <= (-2.25d-32)) then
tmp = x * (1.0d0 - (y / z))
else if ((y <= (-8.2d-39)) .or. (.not. (y <= 1.45d+88))) then
tmp = t_1
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 t_1 = x * (y / (t - z));
double tmp;
if (y <= -1.7e+43) {
tmp = t_1;
} else if (y <= -2.25e-32) {
tmp = x * (1.0 - (y / z));
} else if ((y <= -8.2e-39) || !(y <= 1.45e+88)) {
tmp = t_1;
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y / (t - z)) tmp = 0 if y <= -1.7e+43: tmp = t_1 elif y <= -2.25e-32: tmp = x * (1.0 - (y / z)) elif (y <= -8.2e-39) or not (y <= 1.45e+88): tmp = t_1 else: tmp = x * (z / (z - t)) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y / Float64(t - z))) tmp = 0.0 if (y <= -1.7e+43) tmp = t_1; elseif (y <= -2.25e-32) tmp = Float64(x * Float64(1.0 - Float64(y / z))); elseif ((y <= -8.2e-39) || !(y <= 1.45e+88)) tmp = t_1; else tmp = Float64(x * Float64(z / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y / (t - z)); tmp = 0.0; if (y <= -1.7e+43) tmp = t_1; elseif (y <= -2.25e-32) tmp = x * (1.0 - (y / z)); elseif ((y <= -8.2e-39) || ~((y <= 1.45e+88))) tmp = t_1; else tmp = x * (z / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.7e+43], t$95$1, If[LessEqual[y, -2.25e-32], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -8.2e-39], N[Not[LessEqual[y, 1.45e+88]], $MachinePrecision]], t$95$1, N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{t - z}\\
\mathbf{if}\;y \leq -1.7 \cdot 10^{+43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.25 \cdot 10^{-32}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;y \leq -8.2 \cdot 10^{-39} \lor \neg \left(y \leq 1.45 \cdot 10^{+88}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if y < -1.70000000000000006e43 or -2.25000000000000002e-32 < y < -8.2e-39 or 1.45e88 < y Initial program 82.4%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in y around inf 73.6%
associate-/l*80.1%
Simplified80.1%
if -1.70000000000000006e43 < y < -2.25000000000000002e-32Initial program 83.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 52.1%
mul-1-neg52.1%
associate-/l*68.9%
distribute-rgt-neg-in68.9%
distribute-frac-neg68.9%
neg-sub068.9%
associate--r-68.9%
neg-sub068.9%
+-commutative68.9%
sub-neg68.9%
div-sub68.9%
*-inverses68.9%
Simplified68.9%
if -8.2e-39 < y < 1.45e88Initial program 86.9%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in y around 0 74.0%
mul-1-neg74.0%
distribute-neg-frac274.0%
neg-sub074.0%
associate--r-74.0%
neg-sub074.0%
+-commutative74.0%
sub-neg74.0%
associate-/l*84.1%
Simplified84.1%
Final simplification81.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ y (- t z)))))
(if (<= y -2.4e+45)
t_1
(if (<= y -7e-33)
(* x (- 1.0 (/ y z)))
(if (<= y -2.25e-38)
t_1
(if (<= y 1.35e+89) (* x (/ z (- z t))) (/ x (/ (- t z) y))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y / (t - z));
double tmp;
if (y <= -2.4e+45) {
tmp = t_1;
} else if (y <= -7e-33) {
tmp = x * (1.0 - (y / z));
} else if (y <= -2.25e-38) {
tmp = t_1;
} else if (y <= 1.35e+89) {
tmp = x * (z / (z - t));
} 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 * (y / (t - z))
if (y <= (-2.4d+45)) then
tmp = t_1
else if (y <= (-7d-33)) then
tmp = x * (1.0d0 - (y / z))
else if (y <= (-2.25d-38)) then
tmp = t_1
else if (y <= 1.35d+89) then
tmp = x * (z / (z - t))
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 * (y / (t - z));
double tmp;
if (y <= -2.4e+45) {
tmp = t_1;
} else if (y <= -7e-33) {
tmp = x * (1.0 - (y / z));
} else if (y <= -2.25e-38) {
tmp = t_1;
} else if (y <= 1.35e+89) {
tmp = x * (z / (z - t));
} else {
tmp = x / ((t - z) / y);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y / (t - z)) tmp = 0 if y <= -2.4e+45: tmp = t_1 elif y <= -7e-33: tmp = x * (1.0 - (y / z)) elif y <= -2.25e-38: tmp = t_1 elif y <= 1.35e+89: tmp = x * (z / (z - t)) else: tmp = x / ((t - z) / y) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y / Float64(t - z))) tmp = 0.0 if (y <= -2.4e+45) tmp = t_1; elseif (y <= -7e-33) tmp = Float64(x * Float64(1.0 - Float64(y / z))); elseif (y <= -2.25e-38) tmp = t_1; elseif (y <= 1.35e+89) tmp = Float64(x * Float64(z / Float64(z - t))); else tmp = Float64(x / Float64(Float64(t - z) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y / (t - z)); tmp = 0.0; if (y <= -2.4e+45) tmp = t_1; elseif (y <= -7e-33) tmp = x * (1.0 - (y / z)); elseif (y <= -2.25e-38) tmp = t_1; elseif (y <= 1.35e+89) tmp = x * (z / (z - t)); else tmp = x / ((t - z) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.4e+45], t$95$1, If[LessEqual[y, -7e-33], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.25e-38], t$95$1, If[LessEqual[y, 1.35e+89], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{t - z}\\
\mathbf{if}\;y \leq -2.4 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -7 \cdot 10^{-33}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;y \leq -2.25 \cdot 10^{-38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+89}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\end{array}
\end{array}
if y < -2.39999999999999989e45 or -6.9999999999999997e-33 < y < -2.25000000000000004e-38Initial program 86.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around inf 76.8%
associate-/l*84.4%
Simplified84.4%
if -2.39999999999999989e45 < y < -6.9999999999999997e-33Initial program 83.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 52.1%
mul-1-neg52.1%
associate-/l*68.9%
distribute-rgt-neg-in68.9%
distribute-frac-neg68.9%
neg-sub068.9%
associate--r-68.9%
neg-sub068.9%
+-commutative68.9%
sub-neg68.9%
div-sub68.9%
*-inverses68.9%
Simplified68.9%
if -2.25000000000000004e-38 < y < 1.35e89Initial program 86.9%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in y around 0 74.0%
mul-1-neg74.0%
distribute-neg-frac274.0%
neg-sub074.0%
associate--r-74.0%
neg-sub074.0%
+-commutative74.0%
sub-neg74.0%
associate-/l*84.1%
Simplified84.1%
if 1.35e89 < y Initial program 76.1%
associate-/l*89.1%
Simplified89.1%
clear-num89.1%
un-div-inv89.4%
Applied egg-rr89.4%
Taylor expanded in y around inf 73.0%
Final simplification81.3%
(FPCore (x y z t) :precision binary64 (if (<= z -3.55e+115) x (if (<= z -1.45e+53) (/ x (/ z (- y))) (if (<= z 3e+93) (* x (/ y t)) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.55e+115) {
tmp = x;
} else if (z <= -1.45e+53) {
tmp = x / (z / -y);
} else if (z <= 3e+93) {
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.55d+115)) then
tmp = x
else if (z <= (-1.45d+53)) then
tmp = x / (z / -y)
else if (z <= 3d+93) 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.55e+115) {
tmp = x;
} else if (z <= -1.45e+53) {
tmp = x / (z / -y);
} else if (z <= 3e+93) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.55e+115: tmp = x elif z <= -1.45e+53: tmp = x / (z / -y) elif z <= 3e+93: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.55e+115) tmp = x; elseif (z <= -1.45e+53) tmp = Float64(x / Float64(z / Float64(-y))); elseif (z <= 3e+93) 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.55e+115) tmp = x; elseif (z <= -1.45e+53) tmp = x / (z / -y); elseif (z <= 3e+93) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.55e+115], x, If[LessEqual[z, -1.45e+53], N[(x / N[(z / (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+93], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.55 \cdot 10^{+115}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{+53}:\\
\;\;\;\;\frac{x}{\frac{z}{-y}}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+93}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.5499999999999998e115 or 2.99999999999999978e93 < z Initial program 71.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 75.6%
if -3.5499999999999998e115 < z < -1.4500000000000001e53Initial program 99.7%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in y around inf 83.1%
associate-/l*82.9%
Simplified82.9%
Taylor expanded in t around 0 71.2%
mul-1-neg71.2%
associate-/l*70.9%
distribute-rgt-neg-in70.9%
mul-1-neg70.9%
associate-*r/70.9%
neg-mul-170.9%
Simplified70.9%
distribute-frac-neg70.9%
distribute-rgt-neg-out70.9%
add-sqr-sqrt34.5%
sqrt-unprod29.8%
sqr-neg29.8%
sqrt-unprod11.4%
add-sqr-sqrt20.3%
clear-num20.3%
un-div-inv20.3%
add-sqr-sqrt11.4%
sqrt-unprod29.8%
sqr-neg29.8%
sqrt-unprod34.5%
add-sqr-sqrt71.2%
Applied egg-rr71.2%
if -1.4500000000000001e53 < z < 2.99999999999999978e93Initial program 91.4%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in z around 0 60.1%
associate-/l*62.6%
Simplified62.6%
Final simplification67.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -9e-39) (not (<= z 4.2e-112))) (* x (- 1.0 (/ y z))) (* x (/ y t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9e-39) || !(z <= 4.2e-112)) {
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 <= (-9d-39)) .or. (.not. (z <= 4.2d-112))) 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 <= -9e-39) || !(z <= 4.2e-112)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -9e-39) or not (z <= 4.2e-112): tmp = x * (1.0 - (y / z)) else: tmp = x * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -9e-39) || !(z <= 4.2e-112)) 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 <= -9e-39) || ~((z <= 4.2e-112))) 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, -9e-39], N[Not[LessEqual[z, 4.2e-112]], $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 -9 \cdot 10^{-39} \lor \neg \left(z \leq 4.2 \cdot 10^{-112}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\end{array}
\end{array}
if z < -9.0000000000000002e-39 or 4.2000000000000001e-112 < z Initial program 80.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 59.0%
mul-1-neg59.0%
associate-/l*72.1%
distribute-rgt-neg-in72.1%
distribute-frac-neg72.1%
neg-sub072.1%
associate--r-72.1%
neg-sub072.1%
+-commutative72.1%
sub-neg72.1%
div-sub72.1%
*-inverses72.1%
Simplified72.1%
if -9.0000000000000002e-39 < z < 4.2000000000000001e-112Initial program 91.4%
associate-/l*92.7%
Simplified92.7%
Taylor expanded in z around 0 73.2%
associate-/l*74.1%
Simplified74.1%
Final simplification72.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4e+96) (not (<= z 7.2e+94))) (* x (- 1.0 (/ y z))) (* x (/ y (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4e+96) || !(z <= 7.2e+94)) {
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 <= (-4d+96)) .or. (.not. (z <= 7.2d+94))) 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 <= -4e+96) || !(z <= 7.2e+94)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4e+96) or not (z <= 7.2e+94): 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 <= -4e+96) || !(z <= 7.2e+94)) 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 <= -4e+96) || ~((z <= 7.2e+94))) 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, -4e+96], N[Not[LessEqual[z, 7.2e+94]], $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 -4 \cdot 10^{+96} \lor \neg \left(z \leq 7.2 \cdot 10^{+94}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -4.0000000000000002e96 or 7.19999999999999985e94 < z Initial program 71.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 61.3%
mul-1-neg61.3%
associate-/l*83.1%
distribute-rgt-neg-in83.1%
distribute-frac-neg83.1%
neg-sub083.1%
associate--r-83.1%
neg-sub083.1%
+-commutative83.1%
sub-neg83.1%
div-sub83.1%
*-inverses83.1%
Simplified83.1%
if -4.0000000000000002e96 < z < 7.19999999999999985e94Initial program 92.0%
associate-/l*95.4%
Simplified95.4%
Taylor expanded in y around inf 70.0%
associate-/l*72.8%
Simplified72.8%
Final simplification76.5%
(FPCore (x y z t) :precision binary64 (if (<= z -7.8e+105) x (if (<= z 2.9e+93) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.8e+105) {
tmp = x;
} else if (z <= 2.9e+93) {
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 <= (-7.8d+105)) then
tmp = x
else if (z <= 2.9d+93) 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 <= -7.8e+105) {
tmp = x;
} else if (z <= 2.9e+93) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -7.8e+105: tmp = x elif z <= 2.9e+93: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -7.8e+105) tmp = x; elseif (z <= 2.9e+93) 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 <= -7.8e+105) tmp = x; elseif (z <= 2.9e+93) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -7.8e+105], x, If[LessEqual[z, 2.9e+93], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{+105}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+93}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.79999999999999957e105 or 2.8999999999999998e93 < z Initial program 71.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 74.8%
if -7.79999999999999957e105 < z < 2.8999999999999998e93Initial program 92.0%
associate-/l*95.4%
Simplified95.4%
Taylor expanded in z around 0 58.4%
associate-/l*60.7%
Simplified60.7%
Final simplification65.7%
(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 84.9%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in z around inf 36.3%
Final simplification36.3%
(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 2024072
(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)))