
(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 9 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 (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 82.6%
+-commutative82.6%
associate-/l*98.5%
fma-define98.5%
Simplified98.5%
Final simplification98.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (<= t_1 -1e+305)
(* (- z t) (/ y (- z a)))
(if (<= t_1 1e+278) (+ x t_1) (/ y (/ (- z a) (- z t)))))))
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+305) {
tmp = (z - t) * (y / (z - a));
} else if (t_1 <= 1e+278) {
tmp = x + t_1;
} else {
tmp = y / ((z - a) / (z - t));
}
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+305)) then
tmp = (z - t) * (y / (z - a))
else if (t_1 <= 1d+278) then
tmp = x + t_1
else
tmp = y / ((z - a) / (z - t))
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+305) {
tmp = (z - t) * (y / (z - a));
} else if (t_1 <= 1e+278) {
tmp = x + t_1;
} else {
tmp = y / ((z - a) / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (z - a) tmp = 0 if t_1 <= -1e+305: tmp = (z - t) * (y / (z - a)) elif t_1 <= 1e+278: tmp = x + t_1 else: tmp = y / ((z - a) / (z - t)) 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+305) tmp = Float64(Float64(z - t) * Float64(y / Float64(z - a))); elseif (t_1 <= 1e+278) tmp = Float64(x + t_1); else tmp = Float64(y / Float64(Float64(z - a) / Float64(z - t))); 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+305) tmp = (z - t) * (y / (z - a)); elseif (t_1 <= 1e+278) tmp = x + t_1; else tmp = y / ((z - a) / (z - t)); 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[LessEqual[t$95$1, -1e+305], N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+278], N[(x + t$95$1), $MachinePrecision], N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $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^{+305}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{elif}\;t\_1 \leq 10^{+278}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z - a}{z - t}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -9.9999999999999994e304Initial program 39.5%
+-commutative39.5%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around inf 92.3%
div-sub92.3%
associate-*r/39.5%
associate-*l/92.3%
Simplified92.3%
if -9.9999999999999994e304 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 9.99999999999999964e277Initial program 99.9%
if 9.99999999999999964e277 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 32.0%
+-commutative32.0%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around inf 88.5%
div-sub88.5%
associate-*r/32.0%
associate-*l/88.3%
Simplified88.3%
associate-/r/88.5%
Applied egg-rr88.5%
Final simplification97.3%
(FPCore (x y z t a)
:precision binary64
(if (or (<= y -9.5e+20)
(not (or (<= y 5.2e-61) (and (not (<= y 1.3e+76)) (<= y 3.8e+160)))))
(* (- z t) (/ y (- z a)))
(+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -9.5e+20) || !((y <= 5.2e-61) || (!(y <= 1.3e+76) && (y <= 3.8e+160)))) {
tmp = (z - t) * (y / (z - a));
} else {
tmp = y + 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 ((y <= (-9.5d+20)) .or. (.not. (y <= 5.2d-61) .or. (.not. (y <= 1.3d+76)) .and. (y <= 3.8d+160))) then
tmp = (z - t) * (y / (z - a))
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -9.5e+20) || !((y <= 5.2e-61) || (!(y <= 1.3e+76) && (y <= 3.8e+160)))) {
tmp = (z - t) * (y / (z - a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -9.5e+20) or not ((y <= 5.2e-61) or (not (y <= 1.3e+76) and (y <= 3.8e+160))): tmp = (z - t) * (y / (z - a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -9.5e+20) || !((y <= 5.2e-61) || (!(y <= 1.3e+76) && (y <= 3.8e+160)))) tmp = Float64(Float64(z - t) * Float64(y / Float64(z - a))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -9.5e+20) || ~(((y <= 5.2e-61) || (~((y <= 1.3e+76)) && (y <= 3.8e+160))))) tmp = (z - t) * (y / (z - a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -9.5e+20], N[Not[Or[LessEqual[y, 5.2e-61], And[N[Not[LessEqual[y, 1.3e+76]], $MachinePrecision], LessEqual[y, 3.8e+160]]]], $MachinePrecision]], N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{+20} \lor \neg \left(y \leq 5.2 \cdot 10^{-61} \lor \neg \left(y \leq 1.3 \cdot 10^{+76}\right) \land y \leq 3.8 \cdot 10^{+160}\right):\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if y < -9.5e20 or 5.20000000000000021e-61 < y < 1.3e76 or 3.80000000000000012e160 < y Initial program 67.8%
+-commutative67.8%
associate-/l*97.7%
fma-define97.7%
Simplified97.7%
Taylor expanded in y around inf 77.9%
div-sub77.9%
associate-*r/51.7%
associate-*l/78.7%
Simplified78.7%
if -9.5e20 < y < 5.20000000000000021e-61 or 1.3e76 < y < 3.80000000000000012e160Initial program 97.0%
+-commutative97.0%
associate-/l*99.2%
fma-define99.2%
Simplified99.2%
Taylor expanded in z around inf 82.9%
+-commutative82.9%
Simplified82.9%
Final simplification80.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ z (- z a))))))
(if (<= z -3.7e+20)
t_1
(if (<= z -9.2e-101)
(- x (/ (* y t) z))
(if (<= z -6.5e-122)
(* (- z t) (/ y (- z a)))
(if (<= z 2e-10) (+ x (* y (/ t a))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -3.7e+20) {
tmp = t_1;
} else if (z <= -9.2e-101) {
tmp = x - ((y * t) / z);
} else if (z <= -6.5e-122) {
tmp = (z - t) * (y / (z - a));
} else if (z <= 2e-10) {
tmp = x + (y * (t / a));
} else {
tmp = 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 = x + (y * (z / (z - a)))
if (z <= (-3.7d+20)) then
tmp = t_1
else if (z <= (-9.2d-101)) then
tmp = x - ((y * t) / z)
else if (z <= (-6.5d-122)) then
tmp = (z - t) * (y / (z - a))
else if (z <= 2d-10) then
tmp = x + (y * (t / a))
else
tmp = 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 = x + (y * (z / (z - a)));
double tmp;
if (z <= -3.7e+20) {
tmp = t_1;
} else if (z <= -9.2e-101) {
tmp = x - ((y * t) / z);
} else if (z <= -6.5e-122) {
tmp = (z - t) * (y / (z - a));
} else if (z <= 2e-10) {
tmp = x + (y * (t / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (z / (z - a))) tmp = 0 if z <= -3.7e+20: tmp = t_1 elif z <= -9.2e-101: tmp = x - ((y * t) / z) elif z <= -6.5e-122: tmp = (z - t) * (y / (z - a)) elif z <= 2e-10: tmp = x + (y * (t / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(z / Float64(z - a)))) tmp = 0.0 if (z <= -3.7e+20) tmp = t_1; elseif (z <= -9.2e-101) tmp = Float64(x - Float64(Float64(y * t) / z)); elseif (z <= -6.5e-122) tmp = Float64(Float64(z - t) * Float64(y / Float64(z - a))); elseif (z <= 2e-10) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (z / (z - a))); tmp = 0.0; if (z <= -3.7e+20) tmp = t_1; elseif (z <= -9.2e-101) tmp = x - ((y * t) / z); elseif (z <= -6.5e-122) tmp = (z - t) * (y / (z - a)); elseif (z <= 2e-10) tmp = x + (y * (t / a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.7e+20], t$95$1, If[LessEqual[z, -9.2e-101], N[(x - N[(N[(y * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6.5e-122], N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e-10], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -9.2 \cdot 10^{-101}:\\
\;\;\;\;x - \frac{y \cdot t}{z}\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{-122}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-10}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.7e20 or 2.00000000000000007e-10 < z Initial program 72.9%
Taylor expanded in t around 0 66.6%
associate-/l*89.1%
Simplified89.1%
if -3.7e20 < z < -9.1999999999999998e-101Initial program 95.7%
+-commutative95.7%
associate-/l*95.9%
fma-define95.9%
Simplified95.9%
Taylor expanded in a around 0 86.7%
+-commutative86.7%
associate-/l*82.7%
Simplified82.7%
Taylor expanded in z around 0 82.7%
neg-mul-182.7%
distribute-neg-frac82.7%
Simplified82.7%
Taylor expanded in y around 0 86.7%
mul-1-neg86.7%
*-commutative86.7%
associate-*r/82.7%
sub-neg82.7%
associate-*r/86.7%
Simplified86.7%
if -9.1999999999999998e-101 < z < -6.49999999999999965e-122Initial program 99.6%
+-commutative99.6%
associate-/l*75.9%
fma-define75.9%
Simplified75.9%
Taylor expanded in y around inf 52.5%
div-sub52.5%
associate-*r/76.2%
associate-*l/76.2%
Simplified76.2%
if -6.49999999999999965e-122 < z < 2.00000000000000007e-10Initial program 94.5%
Taylor expanded in z around 0 85.7%
*-commutative85.7%
associate-/l*87.8%
Applied egg-rr87.8%
Final simplification88.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ z (- z a))))))
(if (<= z -5.6e+23)
t_1
(if (<= z -3.15e-105)
(- x (/ (* y t) z))
(if (<= z -9.2e-122)
(* (- z t) (/ y (- z a)))
(if (<= z 1.6e-7) (+ x (* y (/ (- t z) a))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -5.6e+23) {
tmp = t_1;
} else if (z <= -3.15e-105) {
tmp = x - ((y * t) / z);
} else if (z <= -9.2e-122) {
tmp = (z - t) * (y / (z - a));
} else if (z <= 1.6e-7) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = 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 = x + (y * (z / (z - a)))
if (z <= (-5.6d+23)) then
tmp = t_1
else if (z <= (-3.15d-105)) then
tmp = x - ((y * t) / z)
else if (z <= (-9.2d-122)) then
tmp = (z - t) * (y / (z - a))
else if (z <= 1.6d-7) then
tmp = x + (y * ((t - z) / a))
else
tmp = 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 = x + (y * (z / (z - a)));
double tmp;
if (z <= -5.6e+23) {
tmp = t_1;
} else if (z <= -3.15e-105) {
tmp = x - ((y * t) / z);
} else if (z <= -9.2e-122) {
tmp = (z - t) * (y / (z - a));
} else if (z <= 1.6e-7) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (z / (z - a))) tmp = 0 if z <= -5.6e+23: tmp = t_1 elif z <= -3.15e-105: tmp = x - ((y * t) / z) elif z <= -9.2e-122: tmp = (z - t) * (y / (z - a)) elif z <= 1.6e-7: tmp = x + (y * ((t - z) / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(z / Float64(z - a)))) tmp = 0.0 if (z <= -5.6e+23) tmp = t_1; elseif (z <= -3.15e-105) tmp = Float64(x - Float64(Float64(y * t) / z)); elseif (z <= -9.2e-122) tmp = Float64(Float64(z - t) * Float64(y / Float64(z - a))); elseif (z <= 1.6e-7) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (z / (z - a))); tmp = 0.0; if (z <= -5.6e+23) tmp = t_1; elseif (z <= -3.15e-105) tmp = x - ((y * t) / z); elseif (z <= -9.2e-122) tmp = (z - t) * (y / (z - a)); elseif (z <= 1.6e-7) tmp = x + (y * ((t - z) / a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.6e+23], t$95$1, If[LessEqual[z, -3.15e-105], N[(x - N[(N[(y * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9.2e-122], N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e-7], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -5.6 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.15 \cdot 10^{-105}:\\
\;\;\;\;x - \frac{y \cdot t}{z}\\
\mathbf{elif}\;z \leq -9.2 \cdot 10^{-122}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-7}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.6e23 or 1.6e-7 < z Initial program 72.9%
Taylor expanded in t around 0 66.6%
associate-/l*89.1%
Simplified89.1%
if -5.6e23 < z < -3.15e-105Initial program 95.7%
+-commutative95.7%
associate-/l*95.9%
fma-define95.9%
Simplified95.9%
Taylor expanded in a around 0 86.7%
+-commutative86.7%
associate-/l*82.7%
Simplified82.7%
Taylor expanded in z around 0 82.7%
neg-mul-182.7%
distribute-neg-frac82.7%
Simplified82.7%
Taylor expanded in y around 0 86.7%
mul-1-neg86.7%
*-commutative86.7%
associate-*r/82.7%
sub-neg82.7%
associate-*r/86.7%
Simplified86.7%
if -3.15e-105 < z < -9.20000000000000028e-122Initial program 99.6%
+-commutative99.6%
associate-/l*75.9%
fma-define75.9%
Simplified75.9%
Taylor expanded in y around inf 52.5%
div-sub52.5%
associate-*r/76.2%
associate-*l/76.2%
Simplified76.2%
if -9.20000000000000028e-122 < z < 1.6e-7Initial program 94.5%
+-commutative94.5%
associate-/l*97.7%
fma-define97.7%
Simplified97.7%
Taylor expanded in a around inf 88.0%
mul-1-neg88.0%
unsub-neg88.0%
associate-/l*90.0%
Simplified90.0%
Final simplification89.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.4e+27) (not (<= z 2.2e+41))) (+ y x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.4e+27) || !(z <= 2.2e+41)) {
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 <= (-9.4d+27)) .or. (.not. (z <= 2.2d+41))) 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 <= -9.4e+27) || !(z <= 2.2e+41)) {
tmp = y + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.4e+27) or not (z <= 2.2e+41): tmp = y + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.4e+27) || !(z <= 2.2e+41)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -9.4e+27) || ~((z <= 2.2e+41))) tmp = y + x; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.4e+27], N[Not[LessEqual[z, 2.2e+41]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.4 \cdot 10^{+27} \lor \neg \left(z \leq 2.2 \cdot 10^{+41}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -9.39999999999999952e27 or 2.1999999999999999e41 < z Initial program 71.2%
+-commutative71.2%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in z around inf 76.8%
+-commutative76.8%
Simplified76.8%
if -9.39999999999999952e27 < z < 2.1999999999999999e41Initial program 94.6%
Taylor expanded in z around 0 77.7%
*-commutative77.7%
associate-/l*79.9%
Applied egg-rr79.9%
Final simplification78.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.3e+26) (not (<= z 5.9e+23))) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.3e+26) || !(z <= 5.9e+23)) {
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 <= (-3.3d+26)) .or. (.not. (z <= 5.9d+23))) 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 <= -3.3e+26) || !(z <= 5.9e+23)) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.3e+26) or not (z <= 5.9e+23): tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.3e+26) || !(z <= 5.9e+23)) 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 <= -3.3e+26) || ~((z <= 5.9e+23))) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.3e+26], N[Not[LessEqual[z, 5.9e+23]], $MachinePrecision]], N[(y + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+26} \lor \neg \left(z \leq 5.9 \cdot 10^{+23}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.29999999999999993e26 or 5.89999999999999987e23 < z Initial program 72.1%
+-commutative72.1%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in z around inf 76.7%
+-commutative76.7%
Simplified76.7%
if -3.29999999999999993e26 < z < 5.89999999999999987e23Initial program 94.4%
+-commutative94.4%
associate-/l*96.8%
fma-define96.8%
Simplified96.8%
Taylor expanded in y around 0 52.7%
Final simplification65.4%
(FPCore (x y z t a) :precision binary64 (+ x (/ -1.0 (/ (/ (- z a) (- t z)) y))))
double code(double x, double y, double z, double t, double a) {
return x + (-1.0 / (((z - a) / (t - z)) / y));
}
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 + ((-1.0d0) / (((z - a) / (t - z)) / y))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (-1.0 / (((z - a) / (t - z)) / y));
}
def code(x, y, z, t, a): return x + (-1.0 / (((z - a) / (t - z)) / y))
function code(x, y, z, t, a) return Float64(x + Float64(-1.0 / Float64(Float64(Float64(z - a) / Float64(t - z)) / y))) end
function tmp = code(x, y, z, t, a) tmp = x + (-1.0 / (((z - a) / (t - z)) / y)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(-1.0 / N[(N[(N[(z - a), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{-1}{\frac{\frac{z - a}{t - z}}{y}}
\end{array}
Initial program 82.6%
clear-num82.6%
inv-pow82.6%
Applied egg-rr82.6%
unpow-182.6%
*-commutative82.6%
associate-/r*98.4%
Simplified98.4%
Final simplification98.4%
(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 82.6%
+-commutative82.6%
associate-/l*98.5%
fma-define98.5%
Simplified98.5%
Taylor expanded in y around 0 49.6%
Final simplification49.6%
(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 2024074
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:alt
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))