
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (or (<= t_1 -1e+296) (not (<= t_1 2e+279)))
(+ x (* (- z t) (/ y (- z a))))
(+ x t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -1e+296) || !(t_1 <= 2e+279)) {
tmp = x + ((z - t) * (y / (z - a)));
} else {
tmp = x + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (y * (z - t)) / (z - a)
if ((t_1 <= (-1d+296)) .or. (.not. (t_1 <= 2d+279))) then
tmp = x + ((z - t) * (y / (z - a)))
else
tmp = x + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -1e+296) || !(t_1 <= 2e+279)) {
tmp = x + ((z - t) * (y / (z - a)));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (z - a) tmp = 0 if (t_1 <= -1e+296) or not (t_1 <= 2e+279): tmp = x + ((z - t) * (y / (z - a))) else: tmp = x + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a)) tmp = 0.0 if ((t_1 <= -1e+296) || !(t_1 <= 2e+279)) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a)))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / (z - a); tmp = 0.0; if ((t_1 <= -1e+296) || ~((t_1 <= 2e+279))) tmp = x + ((z - t) * (y / (z - a))); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+296], N[Not[LessEqual[t$95$1, 2e+279]], $MachinePrecision]], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+296} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+279}\right):\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -9.99999999999999981e295 or 2.00000000000000012e279 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 41.1%
+-commutative41.1%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
fma-undefine99.9%
associate-/l*41.1%
div-inv41.1%
*-commutative41.1%
associate-*r*99.8%
div-inv99.9%
Applied egg-rr99.9%
if -9.99999999999999981e295 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.00000000000000012e279Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a) :precision binary64 (fma y (/ (- z t) (- z a)) x))
double code(double x, double y, double z, double t, double a) {
return fma(y, ((z - t) / (z - a)), x);
}
function code(x, y, z, t, a) return fma(y, Float64(Float64(z - t) / Float64(z - a)), x) end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)
\end{array}
Initial program 87.0%
+-commutative87.0%
associate-/l*97.4%
fma-define97.4%
Simplified97.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.8e+103) (not (<= z 1.7e+110))) (- x (* y (/ (- t z) z))) (+ x (/ (* y (- z t)) (- z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.8e+103) || !(z <= 1.7e+110)) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = x + ((y * (z - t)) / (z - a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-3.8d+103)) .or. (.not. (z <= 1.7d+110))) then
tmp = x - (y * ((t - z) / z))
else
tmp = x + ((y * (z - t)) / (z - a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.8e+103) || !(z <= 1.7e+110)) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = x + ((y * (z - t)) / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.8e+103) or not (z <= 1.7e+110): tmp = x - (y * ((t - z) / z)) else: tmp = x + ((y * (z - t)) / (z - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.8e+103) || !(z <= 1.7e+110)) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); else tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.8e+103) || ~((z <= 1.7e+110))) tmp = x - (y * ((t - z) / z)); else tmp = x + ((y * (z - t)) / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.8e+103], N[Not[LessEqual[z, 1.7e+110]], $MachinePrecision]], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+103} \lor \neg \left(z \leq 1.7 \cdot 10^{+110}\right):\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\
\end{array}
\end{array}
if z < -3.7999999999999997e103 or 1.7000000000000001e110 < z Initial program 71.6%
+-commutative71.6%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 70.2%
+-commutative70.2%
associate-/l*97.5%
Simplified97.5%
if -3.7999999999999997e103 < z < 1.7000000000000001e110Initial program 94.9%
Final simplification95.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -330000000000.0) (not (<= z 9e-125))) (- x (* y (/ z (- a z)))) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -330000000000.0) || !(z <= 9e-125)) {
tmp = x - (y * (z / (a - z)));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-330000000000.0d0)) .or. (.not. (z <= 9d-125))) then
tmp = x - (y * (z / (a - z)))
else
tmp = x + (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -330000000000.0) || !(z <= 9e-125)) {
tmp = x - (y * (z / (a - z)));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -330000000000.0) or not (z <= 9e-125): tmp = x - (y * (z / (a - z))) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -330000000000.0) || !(z <= 9e-125)) tmp = Float64(x - Float64(y * Float64(z / Float64(a - z)))); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -330000000000.0) || ~((z <= 9e-125))) tmp = x - (y * (z / (a - z))); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -330000000000.0], N[Not[LessEqual[z, 9e-125]], $MachinePrecision]], N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -330000000000 \lor \neg \left(z \leq 9 \cdot 10^{-125}\right):\\
\;\;\;\;x - y \cdot \frac{z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -3.3e11 or 9.00000000000000024e-125 < z Initial program 79.9%
Taylor expanded in t around 0 71.2%
associate-/l*87.7%
Simplified87.7%
if -3.3e11 < z < 9.00000000000000024e-125Initial program 96.5%
+-commutative96.5%
associate-/l*94.0%
fma-define94.0%
Simplified94.0%
Taylor expanded in z around 0 81.9%
+-commutative81.9%
associate-/l*83.5%
Simplified83.5%
Final simplification85.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -4500000000000.0) (- x (* y (/ (- t z) z))) (if (<= z 6e-122) (+ x (* t (/ y (- a z)))) (- x (* y (/ z (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4500000000000.0) {
tmp = x - (y * ((t - z) / z));
} else if (z <= 6e-122) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x - (y * (z / (a - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-4500000000000.0d0)) then
tmp = x - (y * ((t - z) / z))
else if (z <= 6d-122) then
tmp = x + (t * (y / (a - z)))
else
tmp = x - (y * (z / (a - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4500000000000.0) {
tmp = x - (y * ((t - z) / z));
} else if (z <= 6e-122) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x - (y * (z / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4500000000000.0: tmp = x - (y * ((t - z) / z)) elif z <= 6e-122: tmp = x + (t * (y / (a - z))) else: tmp = x - (y * (z / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4500000000000.0) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); elseif (z <= 6e-122) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x - Float64(y * Float64(z / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4500000000000.0) tmp = x - (y * ((t - z) / z)); elseif (z <= 6e-122) tmp = x + (t * (y / (a - z))); else tmp = x - (y * (z / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4500000000000.0], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e-122], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4500000000000:\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-122}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{a - z}\\
\end{array}
\end{array}
if z < -4.5e12Initial program 79.8%
+-commutative79.8%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 75.1%
+-commutative75.1%
associate-/l*92.1%
Simplified92.1%
if -4.5e12 < z < 6.00000000000000009e-122Initial program 96.5%
Taylor expanded in t around inf 89.7%
mul-1-neg89.7%
associate-/l*89.8%
distribute-rgt-neg-in89.8%
distribute-frac-neg289.8%
Simplified89.8%
if 6.00000000000000009e-122 < z Initial program 79.7%
Taylor expanded in t around 0 73.9%
associate-/l*90.0%
Simplified90.0%
Final simplification90.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.7e+18) (- x (* y (/ (- t z) z))) (if (<= z 3.8e-126) (- x (* y (/ (- z t) a))) (- x (* y (/ z (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.7e+18) {
tmp = x - (y * ((t - z) / z));
} else if (z <= 3.8e-126) {
tmp = x - (y * ((z - t) / a));
} else {
tmp = x - (y * (z / (a - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.7d+18)) then
tmp = x - (y * ((t - z) / z))
else if (z <= 3.8d-126) then
tmp = x - (y * ((z - t) / a))
else
tmp = x - (y * (z / (a - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.7e+18) {
tmp = x - (y * ((t - z) / z));
} else if (z <= 3.8e-126) {
tmp = x - (y * ((z - t) / a));
} else {
tmp = x - (y * (z / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.7e+18: tmp = x - (y * ((t - z) / z)) elif z <= 3.8e-126: tmp = x - (y * ((z - t) / a)) else: tmp = x - (y * (z / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.7e+18) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); elseif (z <= 3.8e-126) tmp = Float64(x - Float64(y * Float64(Float64(z - t) / a))); else tmp = Float64(x - Float64(y * Float64(z / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.7e+18) tmp = x - (y * ((t - z) / z)); elseif (z <= 3.8e-126) tmp = x - (y * ((z - t) / a)); else tmp = x - (y * (z / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.7e+18], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e-126], N[(x - N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+18}:\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-126}:\\
\;\;\;\;x - y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{a - z}\\
\end{array}
\end{array}
if z < -1.7e18Initial program 79.5%
+-commutative79.5%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 76.1%
+-commutative76.1%
associate-/l*93.5%
Simplified93.5%
if -1.7e18 < z < 3.7999999999999999e-126Initial program 96.5%
+-commutative96.5%
associate-/l*94.1%
fma-define94.1%
Simplified94.1%
Taylor expanded in a around inf 84.3%
mul-1-neg84.3%
unsub-neg84.3%
associate-/l*83.6%
Simplified83.6%
if 3.7999999999999999e-126 < z Initial program 79.9%
Taylor expanded in t around 0 73.0%
associate-/l*89.0%
Simplified89.0%
Final simplification87.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.8e-15) (- x (* y (/ (- t z) z))) (if (<= z 2e-124) (+ x (* t (/ y a))) (- x (* y (/ z (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.8e-15) {
tmp = x - (y * ((t - z) / z));
} else if (z <= 2e-124) {
tmp = x + (t * (y / a));
} else {
tmp = x - (y * (z / (a - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.8d-15)) then
tmp = x - (y * ((t - z) / z))
else if (z <= 2d-124) then
tmp = x + (t * (y / a))
else
tmp = x - (y * (z / (a - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.8e-15) {
tmp = x - (y * ((t - z) / z));
} else if (z <= 2e-124) {
tmp = x + (t * (y / a));
} else {
tmp = x - (y * (z / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.8e-15: tmp = x - (y * ((t - z) / z)) elif z <= 2e-124: tmp = x + (t * (y / a)) else: tmp = x - (y * (z / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.8e-15) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); elseif (z <= 2e-124) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x - Float64(y * Float64(z / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.8e-15) tmp = x - (y * ((t - z) / z)); elseif (z <= 2e-124) tmp = x + (t * (y / a)); else tmp = x - (y * (z / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.8e-15], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e-124], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-15}:\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-124}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{a - z}\\
\end{array}
\end{array}
if z < -1.8000000000000001e-15Initial program 82.6%
+-commutative82.6%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 74.5%
+-commutative74.5%
associate-/l*89.2%
Simplified89.2%
if -1.8000000000000001e-15 < z < 1.99999999999999987e-124Initial program 96.1%
+-commutative96.1%
associate-/l*93.4%
fma-define93.4%
Simplified93.4%
Taylor expanded in z around 0 83.0%
+-commutative83.0%
associate-/l*84.9%
Simplified84.9%
if 1.99999999999999987e-124 < z Initial program 79.9%
Taylor expanded in t around 0 73.0%
associate-/l*89.0%
Simplified89.0%
Final simplification87.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4000000000000.0) (not (<= z 3.2e+43))) (+ y x) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4000000000000.0) || !(z <= 3.2e+43)) {
tmp = y + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-4000000000000.0d0)) .or. (.not. (z <= 3.2d+43))) then
tmp = y + x
else
tmp = x + (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4000000000000.0) || !(z <= 3.2e+43)) {
tmp = y + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4000000000000.0) or not (z <= 3.2e+43): tmp = y + x else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4000000000000.0) || !(z <= 3.2e+43)) tmp = Float64(y + x); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4000000000000.0) || ~((z <= 3.2e+43))) tmp = y + x; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4000000000000.0], N[Not[LessEqual[z, 3.2e+43]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4000000000000 \lor \neg \left(z \leq 3.2 \cdot 10^{+43}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -4e12 or 3.20000000000000014e43 < z Initial program 77.0%
+-commutative77.0%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 80.1%
+-commutative80.1%
Simplified80.1%
if -4e12 < z < 3.20000000000000014e43Initial program 95.8%
+-commutative95.8%
associate-/l*95.2%
fma-define95.2%
Simplified95.2%
Taylor expanded in z around 0 79.1%
+-commutative79.1%
associate-/l*81.0%
Simplified81.0%
Final simplification80.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -470000000000.0) (not (<= z 8.2e+43))) (+ y x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -470000000000.0) || !(z <= 8.2e+43)) {
tmp = y + x;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-470000000000.0d0)) .or. (.not. (z <= 8.2d+43))) then
tmp = y + x
else
tmp = x + ((y * t) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -470000000000.0) || !(z <= 8.2e+43)) {
tmp = y + x;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -470000000000.0) or not (z <= 8.2e+43): tmp = y + x else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -470000000000.0) || !(z <= 8.2e+43)) tmp = Float64(y + x); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -470000000000.0) || ~((z <= 8.2e+43))) tmp = y + x; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -470000000000.0], N[Not[LessEqual[z, 8.2e+43]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -470000000000 \lor \neg \left(z \leq 8.2 \cdot 10^{+43}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -4.7e11 or 8.2000000000000001e43 < z Initial program 77.0%
+-commutative77.0%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 80.1%
+-commutative80.1%
Simplified80.1%
if -4.7e11 < z < 8.2000000000000001e43Initial program 95.8%
Taylor expanded in z around 0 79.1%
Final simplification79.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.75e-122) (not (<= z 3.5e+42))) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.75e-122) || !(z <= 3.5e+42)) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-2.75d-122)) .or. (.not. (z <= 3.5d+42))) then
tmp = y + x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.75e-122) || !(z <= 3.5e+42)) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.75e-122) or not (z <= 3.5e+42): tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.75e-122) || !(z <= 3.5e+42)) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.75e-122) || ~((z <= 3.5e+42))) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.75e-122], N[Not[LessEqual[z, 3.5e+42]], $MachinePrecision]], N[(y + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.75 \cdot 10^{-122} \lor \neg \left(z \leq 3.5 \cdot 10^{+42}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.75000000000000026e-122 or 3.50000000000000023e42 < z Initial program 81.7%
+-commutative81.7%
associate-/l*98.7%
fma-define98.7%
Simplified98.7%
Taylor expanded in z around inf 72.2%
+-commutative72.2%
Simplified72.2%
if -2.75000000000000026e-122 < z < 3.50000000000000023e42Initial program 94.7%
+-commutative94.7%
associate-/l*95.5%
fma-define95.5%
Simplified95.5%
Taylor expanded in y around 0 55.4%
Final simplification65.3%
(FPCore (x y z t a) :precision binary64 (if (<= x -2.6e-220) x (if (<= x 2.7e-103) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.6e-220) {
tmp = x;
} else if (x <= 2.7e-103) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-2.6d-220)) then
tmp = x
else if (x <= 2.7d-103) then
tmp = y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.6e-220) {
tmp = x;
} else if (x <= 2.7e-103) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -2.6e-220: tmp = x elif x <= 2.7e-103: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -2.6e-220) tmp = x; elseif (x <= 2.7e-103) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -2.6e-220) tmp = x; elseif (x <= 2.7e-103) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.6e-220], x, If[LessEqual[x, 2.7e-103], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-220}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-103}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.6e-220 or 2.7000000000000001e-103 < x Initial program 86.9%
+-commutative86.9%
associate-/l*97.4%
fma-define97.4%
Simplified97.4%
Taylor expanded in y around 0 64.3%
if -2.6e-220 < x < 2.7000000000000001e-103Initial program 87.3%
+-commutative87.3%
associate-/l*97.3%
fma-define97.3%
Simplified97.3%
Taylor expanded in z around inf 45.3%
+-commutative45.3%
Simplified45.3%
Taylor expanded in y around inf 37.0%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 87.0%
+-commutative87.0%
associate-/l*97.4%
fma-define97.4%
Simplified97.4%
Taylor expanded in y around 0 51.8%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024141
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (/ (* y (- z t)) (- z a))))