
(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 10 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
(let* ((t_1 (/ (* x (- y z)) (- t z))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 -5e-318)))
(* x (/ (- y z) (- t z)))
t_1)))
double code(double x, double y, double z, double t) {
double t_1 = (x * (y - z)) / (t - z);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= -5e-318)) {
tmp = x * ((y - z) / (t - z));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (x * (y - z)) / (t - z);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= -5e-318)) {
tmp = x * ((y - z) / (t - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * (y - z)) / (t - z) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= -5e-318): tmp = x * ((y - z) / (t - z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * Float64(y - z)) / Float64(t - z)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= -5e-318)) tmp = Float64(x * Float64(Float64(y - z) / Float64(t - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * (y - z)) / (t - z); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= -5e-318))) tmp = x * ((y - z) / (t - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, -5e-318]], $MachinePrecision]], N[(x * N[(N[(y - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot \left(y - z\right)}{t - z}\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq -5 \cdot 10^{-318}\right):\\
\;\;\;\;x \cdot \frac{y - z}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -inf.0 or -4.9999987e-318 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 74.3%
associate-*r/99.9%
Simplified99.9%
if -inf.0 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -4.9999987e-318Initial program 99.4%
Final simplification99.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ (- z y) z))))
(if (<= z -1550000000.0)
t_1
(if (<= z -1.5e-40)
(* x (/ (- y z) t))
(if (<= z -5.8e-51) x (if (<= z 8.8e+45) (* y (/ x (- t z))) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((z - y) / z);
double tmp;
if (z <= -1550000000.0) {
tmp = t_1;
} else if (z <= -1.5e-40) {
tmp = x * ((y - z) / t);
} else if (z <= -5.8e-51) {
tmp = x;
} else if (z <= 8.8e+45) {
tmp = y * (x / (t - z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * ((z - y) / z)
if (z <= (-1550000000.0d0)) then
tmp = t_1
else if (z <= (-1.5d-40)) then
tmp = x * ((y - z) / t)
else if (z <= (-5.8d-51)) then
tmp = x
else if (z <= 8.8d+45) then
tmp = y * (x / (t - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((z - y) / z);
double tmp;
if (z <= -1550000000.0) {
tmp = t_1;
} else if (z <= -1.5e-40) {
tmp = x * ((y - z) / t);
} else if (z <= -5.8e-51) {
tmp = x;
} else if (z <= 8.8e+45) {
tmp = y * (x / (t - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((z - y) / z) tmp = 0 if z <= -1550000000.0: tmp = t_1 elif z <= -1.5e-40: tmp = x * ((y - z) / t) elif z <= -5.8e-51: tmp = x elif z <= 8.8e+45: tmp = y * (x / (t - z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(z - y) / z)) tmp = 0.0 if (z <= -1550000000.0) tmp = t_1; elseif (z <= -1.5e-40) tmp = Float64(x * Float64(Float64(y - z) / t)); elseif (z <= -5.8e-51) tmp = x; elseif (z <= 8.8e+45) tmp = Float64(y * Float64(x / Float64(t - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((z - y) / z); tmp = 0.0; if (z <= -1550000000.0) tmp = t_1; elseif (z <= -1.5e-40) tmp = x * ((y - z) / t); elseif (z <= -5.8e-51) tmp = x; elseif (z <= 8.8e+45) tmp = y * (x / (t - z)); else tmp = t_1; 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, -1550000000.0], t$95$1, If[LessEqual[z, -1.5e-40], N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.8e-51], x, If[LessEqual[z, 8.8e+45], N[(y * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{z - y}{z}\\
\mathbf{if}\;z \leq -1550000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-40}:\\
\;\;\;\;x \cdot \frac{y - z}{t}\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-51}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{+45}:\\
\;\;\;\;y \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.55e9 or 8.8000000000000001e45 < z Initial program 72.7%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 59.3%
mul-1-neg59.3%
associate-/l*60.6%
distribute-neg-frac60.6%
neg-sub060.6%
associate--r-60.6%
neg-sub060.6%
Simplified60.6%
Taylor expanded in x around 0 59.3%
associate-/l*60.6%
associate-/r/81.4%
Simplified81.4%
if -1.55e9 < z < -1.5000000000000001e-40Initial program 99.7%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around inf 64.9%
if -1.5000000000000001e-40 < z < -5.79999999999999945e-51Initial program 100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in z around inf 75.9%
if -5.79999999999999945e-51 < z < 8.8000000000000001e45Initial program 88.5%
associate-*r/92.9%
Simplified92.9%
Taylor expanded in y around inf 77.5%
associate-*r/85.2%
Simplified85.2%
Final simplification82.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5e-44) (not (<= y 3.3e-51))) (* x (/ y (- t z))) (/ x (- 1.0 (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5e-44) || !(y <= 3.3e-51)) {
tmp = x * (y / (t - z));
} else {
tmp = x / (1.0 - (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 <= (-5d-44)) .or. (.not. (y <= 3.3d-51))) then
tmp = x * (y / (t - z))
else
tmp = x / (1.0d0 - (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5e-44) || !(y <= 3.3e-51)) {
tmp = x * (y / (t - z));
} else {
tmp = x / (1.0 - (t / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -5e-44) or not (y <= 3.3e-51): tmp = x * (y / (t - z)) else: tmp = x / (1.0 - (t / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -5e-44) || !(y <= 3.3e-51)) tmp = Float64(x * Float64(y / Float64(t - z))); else tmp = Float64(x / Float64(1.0 - Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -5e-44) || ~((y <= 3.3e-51))) tmp = x * (y / (t - z)); else tmp = x / (1.0 - (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5e-44], N[Not[LessEqual[y, 3.3e-51]], $MachinePrecision]], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-44} \lor \neg \left(y \leq 3.3 \cdot 10^{-51}\right):\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 - \frac{t}{z}}\\
\end{array}
\end{array}
if y < -5.00000000000000039e-44 or 3.29999999999999973e-51 < y Initial program 79.5%
associate-*r/97.4%
Simplified97.4%
Taylor expanded in y around inf 78.9%
if -5.00000000000000039e-44 < y < 3.29999999999999973e-51Initial program 87.3%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in y around 0 85.0%
associate-*r/85.0%
neg-mul-185.0%
neg-sub085.0%
associate--r-85.0%
neg-sub085.0%
Simplified85.0%
Taylor expanded in t around 0 85.0%
mul-1-neg85.0%
unsub-neg85.0%
Simplified85.0%
Final simplification81.2%
(FPCore (x y z t) :precision binary64 (if (<= z -7.5e+83) x (if (<= z 1.2e+106) (* x (/ y (- t z))) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.5e+83) {
tmp = x;
} else if (z <= 1.2e+106) {
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 <= (-7.5d+83)) then
tmp = x
else if (z <= 1.2d+106) 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 <= -7.5e+83) {
tmp = x;
} else if (z <= 1.2e+106) {
tmp = x * (y / (t - z));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -7.5e+83: tmp = x elif z <= 1.2e+106: tmp = x * (y / (t - z)) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -7.5e+83) tmp = x; elseif (z <= 1.2e+106) 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 <= -7.5e+83) tmp = x; elseif (z <= 1.2e+106) tmp = x * (y / (t - z)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -7.5e+83], x, If[LessEqual[z, 1.2e+106], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+83}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+106}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.49999999999999989e83 or 1.2e106 < z Initial program 66.8%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around inf 71.2%
if -7.49999999999999989e83 < z < 1.2e106Initial program 90.3%
associate-*r/94.6%
Simplified94.6%
Taylor expanded in y around inf 75.6%
Final simplification74.1%
(FPCore (x y z t) :precision binary64 (if (<= y -1.5e-43) (* x (/ y (- t z))) (if (<= y 1.6e-51) (/ x (- 1.0 (/ t z))) (/ x (/ (- t z) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.5e-43) {
tmp = x * (y / (t - z));
} else if (y <= 1.6e-51) {
tmp = x / (1.0 - (t / z));
} 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) :: tmp
if (y <= (-1.5d-43)) then
tmp = x * (y / (t - z))
else if (y <= 1.6d-51) then
tmp = x / (1.0d0 - (t / z))
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 tmp;
if (y <= -1.5e-43) {
tmp = x * (y / (t - z));
} else if (y <= 1.6e-51) {
tmp = x / (1.0 - (t / z));
} else {
tmp = x / ((t - z) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.5e-43: tmp = x * (y / (t - z)) elif y <= 1.6e-51: tmp = x / (1.0 - (t / z)) else: tmp = x / ((t - z) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.5e-43) tmp = Float64(x * Float64(y / Float64(t - z))); elseif (y <= 1.6e-51) tmp = Float64(x / Float64(1.0 - Float64(t / z))); else tmp = Float64(x / Float64(Float64(t - z) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.5e-43) tmp = x * (y / (t - z)); elseif (y <= 1.6e-51) tmp = x / (1.0 - (t / z)); else tmp = x / ((t - z) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.5e-43], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e-51], N[(x / N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{-43}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-51}:\\
\;\;\;\;\frac{x}{1 - \frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\end{array}
\end{array}
if y < -1.50000000000000002e-43Initial program 77.8%
associate-*r/97.4%
Simplified97.4%
Taylor expanded in y around inf 78.5%
if -1.50000000000000002e-43 < y < 1.6e-51Initial program 87.3%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in y around 0 85.0%
associate-*r/85.0%
neg-mul-185.0%
neg-sub085.0%
associate--r-85.0%
neg-sub085.0%
Simplified85.0%
Taylor expanded in t around 0 85.0%
mul-1-neg85.0%
unsub-neg85.0%
Simplified85.0%
if 1.6e-51 < y Initial program 81.2%
associate-*r/97.4%
Simplified97.4%
Taylor expanded in y around inf 79.3%
clear-num79.2%
un-div-inv79.9%
Applied egg-rr79.9%
Final simplification81.4%
(FPCore (x y z t) :precision binary64 (if (<= z -5.6e-51) x (if (<= z 5.2e+69) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.6e-51) {
tmp = x;
} else if (z <= 5.2e+69) {
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 <= (-5.6d-51)) then
tmp = x
else if (z <= 5.2d+69) 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 <= -5.6e-51) {
tmp = x;
} else if (z <= 5.2e+69) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.6e-51: tmp = x elif z <= 5.2e+69: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.6e-51) tmp = x; elseif (z <= 5.2e+69) 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 <= -5.6e-51) tmp = x; elseif (z <= 5.2e+69) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.6e-51], x, If[LessEqual[z, 5.2e+69], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{-51}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+69}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.6e-51 or 5.2000000000000004e69 < z Initial program 75.7%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in z around inf 60.2%
if -5.6e-51 < z < 5.2000000000000004e69Initial program 88.9%
associate-*r/93.1%
Simplified93.1%
Taylor expanded in z around 0 73.7%
Final simplification67.2%
(FPCore (x y z t) :precision binary64 (if (<= z -5.8e-51) x (if (<= z 3.3e+69) (/ x (/ t y)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.8e-51) {
tmp = x;
} else if (z <= 3.3e+69) {
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 <= (-5.8d-51)) then
tmp = x
else if (z <= 3.3d+69) 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 <= -5.8e-51) {
tmp = x;
} else if (z <= 3.3e+69) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.8e-51: tmp = x elif z <= 3.3e+69: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.8e-51) tmp = x; elseif (z <= 3.3e+69) 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 <= -5.8e-51) tmp = x; elseif (z <= 3.3e+69) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.8e-51], x, If[LessEqual[z, 3.3e+69], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{-51}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+69}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.79999999999999945e-51 or 3.2999999999999999e69 < z Initial program 75.7%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in z around inf 60.2%
if -5.79999999999999945e-51 < z < 3.2999999999999999e69Initial program 88.9%
associate-/l*93.5%
Simplified93.5%
Taylor expanded in z around 0 74.1%
Final simplification67.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 82.5%
associate-*r/96.4%
Simplified96.4%
Final simplification96.4%
(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 82.5%
associate-/l*96.5%
Simplified96.5%
Final simplification96.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 82.5%
associate-*r/96.4%
Simplified96.4%
Taylor expanded in z around inf 33.8%
Final simplification33.8%
(FPCore (x y z t) :precision binary64 (/ x (/ (- t z) (- y z))))
double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((t - z) / (y - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
def code(x, y, z, t): return x / ((t - z) / (y - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(t - z) / Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = x / ((t - z) / (y - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{t - z}{y - z}}
\end{array}
herbie shell --seed 2023224
(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)))